Hi, I am seeing the following when I use the pid provider. # dtrace -Fs pid3.d -c "/usr/cluster/bin/scdidadm -r" dtrace: failed to compile script pid3.d: line 5: failed to create probe in process 3132: Not enough space bash-3.00# cat pid3.d #!/usr/sbin/dtrace -Fs #pragma D option flowindent pid$target::: { } But the following script loads and traces the process. bash-3.00# cat pid2.d #!/usr/sbin/dtrace -Fs #pragma D option flowindent pid$target:::entry { } pid$target:::return { } bash-3.00# dtrace -Fs pid2.d -c "/usr/cluster/bin/scdidadm -r" | more dtrace: script ''pid2.d'' matched 43265 probes CPU FUNCTION 0 -> rtld_db_preinit ... I don''t see any difference between the scripts. Why does one work and the other doesn''t? Can someone explain? Thanks Manoj
Gonzalo Siero Humet
2005-Aug-01 07:13 UTC
[dtrace-discuss] Question about the pid provider
Hi Manoj, the big difference is that first script will create a probe for each instruction of your process while the last one only for the entry/return: "The pid provider allows for tracing of the entry and return of any function in a user process as well as any instruction as specified by an absolute address or function offset." Cheers, Gonzalo. Manoj Joseph wrote:> Hi, > > I am seeing the following when I use the pid provider. > > # dtrace -Fs pid3.d -c "/usr/cluster/bin/scdidadm -r" > dtrace: failed to compile script pid3.d: line 5: failed to create probe > in process 3132: Not enough space > bash-3.00# cat pid3.d > #!/usr/sbin/dtrace -Fs > > #pragma D option flowindent > > pid$target::: > { > > } > > But the following script loads and traces the process. > > bash-3.00# cat pid2.d > #!/usr/sbin/dtrace -Fs > > #pragma D option flowindent > > pid$target:::entry > { > > } > > pid$target:::return > { > > } > > bash-3.00# dtrace -Fs pid2.d -c "/usr/cluster/bin/scdidadm -r" | more > dtrace: script ''pid2.d'' matched 43265 probes > CPU FUNCTION > 0 -> rtld_db_preinit > ... > > I don''t see any difference between the scripts. > Why does one work and the other doesn''t? Can someone explain? > > Thanks > Manoj > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org
Michael Schuster - Sun Germany
2005-Aug-01 07:14 UTC
[dtrace-discuss] Question about the pid provider
you need to remember that you can instrument _any_ instruction with the pid provider, which is exactly what your script pid3.d is doing; whereas instrumenting only entry and return (as in pid2.d) is probably what you really want. HTH Michael Manoj Joseph wrote:> > Hi, > > I am seeing the following when I use the pid provider. > > # dtrace -Fs pid3.d -c "/usr/cluster/bin/scdidadm -r" > dtrace: failed to compile script pid3.d: line 5: failed to create probe > in process 3132: Not enough space > bash-3.00# cat pid3.d > #!/usr/sbin/dtrace -Fs > > #pragma D option flowindent > > pid$target::: > { > > } > > But the following script loads and traces the process. > > bash-3.00# cat pid2.d > #!/usr/sbin/dtrace -Fs > > #pragma D option flowindent > > pid$target:::entry > { > > } > > pid$target:::return > { > > } > > bash-3.00# dtrace -Fs pid2.d -c "/usr/cluster/bin/scdidadm -r" | more > dtrace: script ''pid2.d'' matched 43265 probes > CPU FUNCTION > 0 -> rtld_db_preinit > ... > > I don''t see any difference between the scripts. > Why does one work and the other doesn''t? Can someone explain? > > Thanks > Manoj > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Michael Schuster (+49 89) 46008-2974 / x62974 visit the online support center: http://www.sun.com/osc/ Recursion, n.: see ''Recursion''
G''Day Manoj, On Mon, 1 Aug 2005, Manoj Joseph wrote:> Hi, > > I am seeing the following when I use the pid provider. > > # dtrace -Fs pid3.d -c "/usr/cluster/bin/scdidadm -r" > dtrace: failed to compile script pid3.d: line 5: failed to create probe > in process 3132: Not enough space > bash-3.00# cat pid3.d > #!/usr/sbin/dtrace -Fs > > #pragma D option flowindent > > pid$target::: > { > > }This will match down to every CPU instruction, for every function, for every module. Probably not what you want. Eg, # dtrace -ln ''pid$target:::'' -c date | wc -l 188453 # dtrace -ln ''pid$target:::entry'' -c date | wc -l 2894 Just the date command has 188452 probes if I trace everything, or 2893 for just the entries. Some of those extra probes look like this, ID PROVIDER MODULE FUNCTION NAME [...] 40634 pid3338 LM1`ld.so.1 append_alias return 40635 pid3338 LM1`ld.so.1 append_alias entry 40636 pid3338 LM1`ld.so.1 append_alias 0 40637 pid3338 LM1`ld.so.1 append_alias 1 40638 pid3338 LM1`ld.so.1 append_alias 3 40639 pid3338 LM1`ld.so.1 append_alias 6 40640 pid3338 LM1`ld.so.1 append_alias 7 40641 pid3338 LM1`ld.so.1 append_alias 8 40642 pid3338 LM1`ld.so.1 append_alias d [...] This is x86 and unaligned - hence instructions at 0, 1, 3, 6, 7... Brendan