Brendan Gregg
2011-Jul-27 23:00 UTC
[dtrace-discuss] isenabled probles broken on Mac OS X Lion
G''Day, The way isenabled probes are compiled on Mac OS X Lion has changed in a way that dosen''t compile (at least, with some compilers). Here''s the test to try: $ cat -n liontest.d 1 provider lion { 2 probe hello(const char *world); 3 }; $ dtrace -h -s liontest.d -o liontest.h On Snow Leopard this output: $ cat -n liontest.h [...] 24 #define LION_HELLO_ENABLED() \ 25 __dtrace_isenabled$lion$hello$v1() On Lion that is now: $ can -n liontest.h [...] 26 #define LION_HELLO_ENABLED() \ 27 ({ int _r = __dtrace_isenabled$lion$hello$v1(); \ 28 __asm__ volatile(""); \ 29 _r; }) Which doesn''t compile when used in if statements (the use case for isenabled). Which means, some software that has DTrace probes is now not compiling on Lion. Another difference is the addition of: #if !defined(DTRACE_PROBES_DISABLED) || !DTRACE_PROBES_DISABLED but I don''t think that is breaking anything. I''ve attached both header files from the OS versions. Does Apple know of this? thanks, Brendan -- Brendan Gregg, Joyent http://dtrace.org/blogs/brendan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20110727/62ff632b/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: lion.h Type: text/x-chdr Size: 1061 bytes Desc: not available URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20110727/62ff632b/attachment.bin> -------------- next part -------------- A non-text attachment was scrubbed... Name: snowleopard.h Type: text/x-chdr Size: 711 bytes Desc: not available URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20110727/62ff632b/attachment-0001.bin>
James McIlree
2011-Jul-28 05:07 UTC
[dtrace-discuss] isenabled probles broken on Mac OS X Lion
I''m not able to reproduce, what compiler are you using? James M On Jul 27, 2011, at 4:00 PM, Brendan Gregg wrote:> G''Day, > > The way isenabled probes are compiled on Mac OS X Lion has changed in a way that dosen''t compile (at least, with some compilers). Here''s the test to try: > > $ cat -n liontest.d > 1 provider lion { > 2 probe hello(const char *world); > 3 }; > $ dtrace -h -s liontest.d -o liontest.h > > On Snow Leopard this output: > > $ cat -n liontest.h > [...] > 24 #define LION_HELLO_ENABLED() \ > 25 __dtrace_isenabled$lion$hello$v1() > > On Lion that is now: > > $ can -n liontest.h > [...] > 26 #define LION_HELLO_ENABLED() \ > 27 ({ int _r = __dtrace_isenabled$lion$hello$v1(); \ > 28 __asm__ volatile(""); \ > 29 _r; }) > > Which doesn''t compile when used in if statements (the use case for isenabled). Which means, some software that has DTrace probes is now not compiling on Lion. > > Another difference is the addition of: > > #if !defined(DTRACE_PROBES_DISABLED) || !DTRACE_PROBES_DISABLED > > but I don''t think that is breaking anything. > > I''ve attached both header files from the OS versions. Does Apple know of this? > > thanks, > > Brendan > > -- > Brendan Gregg, Joyent http://dtrace.org/blogs/brendan > <lion.h><snowleopard.h>_______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20110727/cea7b934/attachment.html>
Brendan Gregg
2011-Jul-28 06:44 UTC
[dtrace-discuss] isenabled probles broken on Mac OS X Lion
Oh, is this a gcc issue? Does xcode handle it ok? Brendan On Thu, Jul 28, 2011 at 5:07 AM, James McIlree <jmcilree at apple.com> wrote:> > I''m not able to reproduce, what compiler are you using? > > James M > > On Jul 27, 2011, at 4:00 PM, Brendan Gregg wrote: > > G''Day, > > The way isenabled probes are compiled on Mac OS X Lion has changed in a way > that dosen''t compile (at least, with some compilers). Here''s the test to > try: > > $ cat -n liontest.d > 1 provider lion { > 2 probe hello(const char *world); > 3 }; > $ dtrace -h -s liontest.d -o liontest.h > > On Snow Leopard this output: > > $ cat -n liontest.h > [...] > 24 #define LION_HELLO_ENABLED() \ > 25 __dtrace_isenabled$lion$hello$v1() > > On Lion that is now: > > $ can -n liontest.h > [...] > 26 #define LION_HELLO_ENABLED() \ > 27 ({ int _r = __dtrace_isenabled$lion$hello$v1(); \ > 28 __asm__ volatile(""); \ > 29 _r; }) > > Which doesn''t compile when used in if statements (the use case for > isenabled). Which means, some software that has DTrace probes is now not > compiling on Lion. > > Another difference is the addition of: > > #if !defined(DTRACE_PROBES_DISABLED) || !DTRACE_PROBES_DISABLED > > but I don''t think that is breaking anything. > > I''ve attached both header files from the OS versions. Does Apple know of > this? > > thanks, > > Brendan > > -- > Brendan Gregg, Joyent http://dtrace.org/blogs/brendan > <lion.h><snowleopard.h>_______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org > > >-- Brendan Gregg, Joyent http://dtrace.org/blogs/brendan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20110728/9e249cdf/attachment.html>
James McIlree
2011-Jul-28 21:35 UTC
[dtrace-discuss] isenabled probles broken on Mac OS X Lion
I tried llvm-gcc and clang, both worked for me. It looks like invoking gcc "by name" gives you llvm-gcc on a default Xcode install. I think everything we ship should work, are you building your own gcc? James M On Jul 27, 2011, at 11:44 PM, Brendan Gregg wrote:> Oh, is this a gcc issue? Does xcode handle it ok? > > Brendan > > On Thu, Jul 28, 2011 at 5:07 AM, James McIlree <jmcilree at apple.com> wrote: > > I''m not able to reproduce, what compiler are you using? > > James M > > On Jul 27, 2011, at 4:00 PM, Brendan Gregg wrote: > >> G''Day, >> >> The way isenabled probes are compiled on Mac OS X Lion has changed in a way that dosen''t compile (at least, with some compilers). Here''s the test to try: >> >> $ cat -n liontest.d >> 1 provider lion { >> 2 probe hello(const char *world); >> 3 }; >> $ dtrace -h -s liontest.d -o liontest.h >> >> On Snow Leopard this output: >> >> $ cat -n liontest.h >> [...] >> 24 #define LION_HELLO_ENABLED() \ >> 25 __dtrace_isenabled$lion$hello$v1() >> >> On Lion that is now: >> >> $ can -n liontest.h >> [...] >> 26 #define LION_HELLO_ENABLED() \ >> 27 ({ int _r = __dtrace_isenabled$lion$hello$v1(); \ >> 28 __asm__ volatile(""); \ >> 29 _r; }) >> >> Which doesn''t compile when used in if statements (the use case for isenabled). Which means, some software that has DTrace probes is now not compiling on Lion. >> >> Another difference is the addition of: >> >> #if !defined(DTRACE_PROBES_DISABLED) || !DTRACE_PROBES_DISABLED >> >> but I don''t think that is breaking anything. >> >> I''ve attached both header files from the OS versions. Does Apple know of this? >> >> thanks, >> >> Brendan >> >> -- >> Brendan Gregg, Joyent http://dtrace.org/blogs/brendan >> <lion.h><snowleopard.h>_______________________________________________ >> dtrace-discuss mailing list >> dtrace-discuss at opensolaris.org > > > > > -- > Brendan Gregg, Joyent http://dtrace.org/blogs/brendan-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20110728/08b87d45/attachment.html>