Here''s another cpp buglet on Leopard. Basically, using cpp underneath dtrace doesn''t yield the same results as using it separately. I have posted this bug as ADC Bug ID # 5611720. % cat bug_1 /* bug_1 - demonstrate cpp(1) buglet */ #pragma D option quiet #define BEG_0(code) printf("code={\n") #define END_0 printf("}\n") #define PDN_2(na, name) printf(" na=%d\n", name) profile:::tick-1sec { BEG_0(tt); PDN_2(ts, timestamp); /* timestamp (DTrace variable) */ END_0; } % sudo dtrace -I. -C -s bug_1 code={ na=2031174750815 } code={ na=2032174742727 } code={ na=2033174726501 } ^C % cpp bug_1 > bug_1c % cat bug_1c # 1 "bug_1" # 1 "<built-in>" # 1 "<command line>" # 1 "bug_1" #pragma D option quiet profile:::tick-1sec { printf("tt={\n"); printf(" ts=%d\n", timestamp); printf("}\n"); } % sudo dtrace -I. -s bug_1c tt={ ts=2157891353951 } tt={ ts=2158891404722 } tt={ ts=2159891373135 } tt={ ts=2160891368022 } ^C -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm at cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development
jmcilree at apple.com
2007-Nov-25 04:14 UTC
[dtrace-discuss] Yet another cpp buglet on Leopard
On Sat, November 24, 2007 3:36 pm, Rich Morin wrote:> Here''s another cpp buglet on Leopard. Basically, using cpp > underneath dtrace doesn''t yield the same results as using it > separately. I have posted this bug as ADC Bug ID # 5611720. >Rich, As Quinn mentioned earlier, The OS X DTrace isn''t invoking cpp. It''s no surprise they yield different answers. James M