Re: Is it known problem, that zfs.ko could not be built with system compiler (clang 3.9.1) without optimization?

2017-02-22 Thread Andriy Gapon
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
___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: Is it known problem, that zfs.ko could not be built with system compiler (clang 3.9.1) without optimization?

2017-02-22 Thread Eugene Grosbein

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?


___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"

Re: Is it known problem, that zfs.ko could not be built with system compiler (clang 3.9.1) without optimization?

2017-02-22 Thread Slawa Olhovchenkov
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 ?

___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: Is it known problem, that zfs.ko could not be built with system compiler (clang 3.9.1) without optimization?

2017-02-22 Thread Alan Somers
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  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:l...@freebsd.org
>
> ___
> freebsd-stable@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-stable
> To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"
___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: Is it known problem, that zfs.ko could not be built with system compiler (clang 3.9.1) without optimization?

2017-02-22 Thread Steven Hartland
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.



___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Is it known problem, that zfs.ko could not be built with system compiler (clang 3.9.1) without optimization?

2017-02-22 Thread 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.

-- 
Best regards,
 Lev  mailto:l...@freebsd.org

___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"