broker5 at seznam.cz
2008-Apr-24 14:03 UTC
[dtrace-discuss] User Function Boundary Tracing - indentation messed up
Hi All, I am just beginning with DTrace. Trying to get trace log of my testing program I am getting wrong indentation in trace log when I use sleep() call in my program. Dtrace script I have is as follow: #!/usr/sbin/dtrace -qs #pragma D option flowindent pid$1::fce1:entry, pid$1::fce1:return { printf("\n"); /* dont know why but without that I am getting all output on single line. In official wiki example there is no printf */ } And my test C program is: int fce1(int x) { // sleep(1); /* if I uncomment this line, trace log output is messed up - it is flat. Otherwise trace output log is correct. */ write(1,"a",1); if (x > 15) return 0; else { fce1(x+1); } return 0; } int main() { while(1) { fce1(1); } } Doesn''t anybody know what I am doing wrong ? thanks for answer
Bryan Cantrill
2008-Apr-24 15:06 UTC
[dtrace-discuss] User Function Boundary Tracing - indentation messed up
> I am just beginning with DTrace. Trying to get trace log of my testing program I am getting wrong indentation in trace log when I use sleep() call in my program. Dtrace script I have is as follow: > > #!/usr/sbin/dtrace -qs > #pragma D option flowindent > > pid$1::fce1:entry, > pid$1::fce1:return > { > printf("\n"); /* dont know why but without that I am getting all output on single line. In official wiki example there is no printf */ > } > > > And my test C program is: > > int fce1(int x) { > > // sleep(1); /* if I uncomment this line, trace log output is messed up - it is flat. Otherwise trace output log is correct. */ > write(1,"a",1); > if (x > 15) > return 0; > else { > fce1(x+1); > } > return 0; > } > > int main() { > while(1) { > fce1(1); > } > } > > > Doesn''t anybody know what I am doing wrong ?It''s the presence of "-q" on your "#!/usr/sbin/dtrace" line that''s screwing you up -- "flowindent" and "quiet" aren''t really meant to go together. (And yes, there should arguably be either an explicit failure here, or better behavior...) - Bryan -------------------------------------------------------------------------- Bryan Cantrill, Sun Microsystems Fishworks. http://blogs.sun.com/bmc
broker5 at seznam.cz
2008-Apr-24 15:58 UTC
[dtrace-discuss] User Function Boundary Tracing - indentation messed up
> It''s the presence of "-q" on your "#!/usr/sbin/dtrace" line that''s screwing > you up -- "flowindent" and "quiet" aren''t really meant to go together. > (And yes, there should arguably be either an explicit failure here, or > better behavior...) > > - BryanHi Bryan, I removed -q from that but the output behavior is exactly the same - sleep() causes trace log to be flat. J.