Lev Serebryakov
2017-Feb-22 20:47 UTC
Is it known problem, that zfs.ko could not be built with system compiler (clang 3.9.1) without optimization?
Hello Freebsd-stable, Now if you build zfs.ko with -O0 it panics on boot. If you use default optimization level, a lot of fbt DTreace probes are missing. -- Best regards, Lev mailto:lev at FreeBSD.org
Steven Hartland
2017-Feb-22 20:51 UTC
Is it known problem, that zfs.ko could not be built with system compiler (clang 3.9.1) without optimization?
I seem to remember this happening when I tried it too, likely it blows the stack, what's your panic? When doing similar tracing before I've flagged the relevant methods with __noinline. On 22/02/2017 20:47, Lev Serebryakov wrote:> Hello Freebsd-stable, > > Now if you build zfs.ko with -O0 it panics on boot. > > If you use default optimization level, a lot of fbt DTreace probes are > missing. >
Alan Somers
2017-Feb-22 20:52 UTC
Is it known problem, that zfs.ko could not be built with system compiler (clang 3.9.1) without optimization?
The panic is definitely a bug. You should create a bug on bugzilla for that one, if it isn't there already. It's to be expected that a lot of FBT probes won't be present in the default build. But there are two ways to ameliorate that: 1) Add a "__noinline" attribute to any function you want to trace 2) Add "#pragma clang optimize off" and "#pragma clang optimize on" around the code you want to debug. Note that even with optimization disabled, clang may still choose to inline static functions. But it does make stack traces easier to debug. -Alan On Wed, Feb 22, 2017 at 1:47 PM, Lev Serebryakov <lev at freebsd.org> wrote:> Hello Freebsd-stable, > > Now if you build zfs.ko with -O0 it panics on boot. > > If you use default optimization level, a lot of fbt DTreace probes are > missing. > > -- > Best regards, > Lev mailto:lev at FreeBSD.org > > _______________________________________________ > freebsd-stable at freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe at freebsd.org"
Eugene Grosbein
2017-Feb-22 21:05 UTC
Is it known problem, that zfs.ko could not be built with system compiler (clang 3.9.1) without optimization?
23.02.2017 3:47, Lev Serebryakov ?????:> Hello Freebsd-stable, > > Now if you build zfs.ko with -O0 it panics on boot. > > If you use default optimization level, a lot of fbt DTreace probes are > missing.If you use it with i386 (32 bits), you must use loader.conf tunnable: kern.kstack_pages=4 or corresponding kernel options KSTACK_PAGES=4, do you?
Slawa Olhovchenkov
2017-Feb-22 21:06 UTC
Is it known problem, that zfs.ko could not be built with system compiler (clang 3.9.1) without optimization?
On Wed, Feb 22, 2017 at 11:47:42PM +0300, Lev Serebryakov wrote:> Hello Freebsd-stable, > > Now if you build zfs.ko with -O0 it panics on boot. > > If you use default optimization level, a lot of fbt DTreace probes are > missing.Is this related to http://llvm.org/bugs/show_bug.cgi?id=18420 ?
Andriy Gapon
2017-Feb-22 21:57 UTC
Is it known problem, that zfs.ko could not be built with system compiler (clang 3.9.1) without optimization?
On 22/02/2017 22:47, Lev Serebryakov wrote:> Hello Freebsd-stable, > > Now if you build zfs.ko with -O0 it panics on boot.I have seen a problem that matches your description, but not necessarily the same one: https://lists.freebsd.org/pipermail/freebsd-hackers/2016-July/049768.html> If you use default optimization level, a lot of fbt DTreace probes are > missing.You can try several different (orthogonal, even) approaches: - compile ZFS into the kernel - use higher optimization level, but add -fno-optimize-sibling-calls to CLFAGS - pkg install amd64-xtoolchain-gcc and then use CROSS_TOOLCHAIN=amd64-gcc command line argument for buildkernel -- Andriy Gapon