Robert Milkowski
2006-Nov-15 10:53 UTC
[dtrace-discuss] tick-1s doesn''t work properly from user with dtrace privileges
Hi. S10U2 + patches (Generic_118855-19).>From root account:bash-3.00# dtrace -n ''tick-1s{printf("%Y", walltimestamp);}'' dtrace: description ''tick-1s'' matched 1 probe CPU ID FUNCTION:NAME 1 42196 :tick-1s 2006 Nov 15 11:43:33 1 42196 :tick-1s 2006 Nov 15 11:43:34 1 42196 :tick-1s 2006 Nov 15 11:43:35 1 42196 :tick-1s 2006 Nov 15 11:43:36 1 42196 :tick-1s 2006 Nov 15 11:43:37 ^C>From a user account:bash-3.00# su - gmyra Sun Microsystems Inc. SunOS 5.10 Generic January 2005 [gmyra@ ~]$ dtrace -n ''tick-1s{printf("%Y", walltimestamp);}'' dtrace: description ''tick-1s'' matched 1 probe [I get output every few minutes instead every second, and wlltimestamp is printed only once every few minutes[ user gmyra has defaultpriv=basic,dtrace_proc,dtrace_user bash-3.00# su - gmyra Sun Microsystems Inc. SunOS 5.10 Generic January 2005 [gmyra@ ~]$ ppriv $$ 16809: -bash flags = <none> E: basic,dtrace_proc,dtrace_user I: basic,dtrace_proc,dtrace_user P: basic,dtrace_proc,dtrace_user L: all [gmyra@ ~]$ So I changed default priv for user gmyra to all and: bash-3.00# su - gmyra Sun Microsystems Inc. SunOS 5.10 Generic January 2005 [gmyra@ ~]$ ppriv $$ 16888: -bash flags = <none> E: all I: all P: all L: all [gmyra@ ~]$ dtrace -n ''tick-1s{printf("%Y", walltimestamp);}'' dtrace: description ''tick-1s'' matched 1 probe CPU ID FUNCTION:NAME 0 42196 :tick-1s 2006 Nov 15 11:50:19 0 42196 :tick-1s 2006 Nov 15 11:50:20 0 42196 :tick-1s 2006 Nov 15 11:50:21 0 42196 :tick-1s 2006 Nov 15 11:50:22 0 42196 :tick-1s 2006 Nov 15 11:50:23 ^C [gmyra@ ~]$ ok, lets try to add dtrace_kernel bash-3.00# su - gmyra Sun Microsystems Inc. SunOS 5.10 Generic January 2005 [gmyra@ ~]$ ppriv $$ 16911: -bash flags = <none> E: basic,dtrace_kernel,dtrace_proc,dtrace_user I: basic,dtrace_kernel,dtrace_proc,dtrace_user P: basic,dtrace_kernel,dtrace_proc,dtrace_user L: all [gmyra@ ~]$ dtrace -n ''tick-1s{printf("%Y", walltimestamp);}'' dtrace: description ''tick-1s'' matched 1 probe CPU ID FUNCTION:NAME 0 42196 :tick-1s 2006 Nov 15 11:52:27 0 42196 :tick-1s 2006 Nov 15 11:52:28 0 42196 :tick-1s 2006 Nov 15 11:52:29 0 42196 :tick-1s 2006 Nov 15 11:52:30 ^C [gmyra@ ~]$ And now it works. It shouldn''t behave that way. This message posted from opensolaris.org
Adam Leventhal
2006-Nov-15 15:51 UTC
[dtrace-discuss] tick-1s doesn''t work properly from user with dtrace privileges
Hi Robert, The effect you''re seeing is due to a couple of issues. There''s a single provider for ''tick'' and ''profile'' probes -- the ''profile'' provider -- and it was originally designed for timer based sampling (profiling). Accordingly, both kinds of probes only fire when a process the user owns is running. This has occurred to us, but (until now) there hasn''t been user demand to justify the non-trivial project of addressing this issue. One solution would be to have profile probes continue to work as they do (only firing when a process you own is running), and have tick probes always fire, but not allow the collection of data when you don''t have sufficient permissions. Profile probes are for profiling, and tick probes are really only useful as timers in your D programs. Feel free to file an RFE/bug to address this issue. Adam On Wed, Nov 15, 2006 at 02:53:53AM -0800, Robert Milkowski wrote:> Hi. > > S10U2 + patches (Generic_118855-19). > > >From root account: > > bash-3.00# dtrace -n ''tick-1s{printf("%Y", walltimestamp);}'' > dtrace: description ''tick-1s'' matched 1 probe > CPU ID FUNCTION:NAME > 1 42196 :tick-1s 2006 Nov 15 11:43:33 > 1 42196 :tick-1s 2006 Nov 15 11:43:34 > 1 42196 :tick-1s 2006 Nov 15 11:43:35 > 1 42196 :tick-1s 2006 Nov 15 11:43:36 > 1 42196 :tick-1s 2006 Nov 15 11:43:37 > ^C > > > >From a user account: > > bash-3.00# su - gmyra > Sun Microsystems Inc. SunOS 5.10 Generic January 2005 > [gmyra@ ~]$ dtrace -n ''tick-1s{printf("%Y", walltimestamp);}'' > dtrace: description ''tick-1s'' matched 1 probe > > [I get output every few minutes instead every second, and wlltimestamp is printed > only once every few minutes[ > > > user gmyra has defaultpriv=basic,dtrace_proc,dtrace_user > > bash-3.00# su - gmyra > Sun Microsystems Inc. SunOS 5.10 Generic January 2005 > [gmyra@ ~]$ ppriv $$ > 16809: -bash > flags = <none> > E: basic,dtrace_proc,dtrace_user > I: basic,dtrace_proc,dtrace_user > P: basic,dtrace_proc,dtrace_user > L: all > [gmyra@ ~]$ > > So I changed default priv for user gmyra to all and: > > bash-3.00# su - gmyra > Sun Microsystems Inc. SunOS 5.10 Generic January 2005 > [gmyra@ ~]$ ppriv $$ > 16888: -bash > flags = <none> > E: all > I: all > P: all > L: all > [gmyra@ ~]$ dtrace -n ''tick-1s{printf("%Y", walltimestamp);}'' > dtrace: description ''tick-1s'' matched 1 probe > CPU ID FUNCTION:NAME > 0 42196 :tick-1s 2006 Nov 15 11:50:19 > 0 42196 :tick-1s 2006 Nov 15 11:50:20 > 0 42196 :tick-1s 2006 Nov 15 11:50:21 > 0 42196 :tick-1s 2006 Nov 15 11:50:22 > 0 42196 :tick-1s 2006 Nov 15 11:50:23 > ^C > > [gmyra@ ~]$ > > > ok, lets try to add dtrace_kernel > bash-3.00# su - gmyra > Sun Microsystems Inc. SunOS 5.10 Generic January 2005 > [gmyra@ ~]$ ppriv $$ > 16911: -bash > flags = <none> > E: basic,dtrace_kernel,dtrace_proc,dtrace_user > I: basic,dtrace_kernel,dtrace_proc,dtrace_user > P: basic,dtrace_kernel,dtrace_proc,dtrace_user > L: all > [gmyra@ ~]$ dtrace -n ''tick-1s{printf("%Y", walltimestamp);}'' > dtrace: description ''tick-1s'' matched 1 probe > CPU ID FUNCTION:NAME > 0 42196 :tick-1s 2006 Nov 15 11:52:27 > 0 42196 :tick-1s 2006 Nov 15 11:52:28 > 0 42196 :tick-1s 2006 Nov 15 11:52:29 > 0 42196 :tick-1s 2006 Nov 15 11:52:30 > ^C > > [gmyra@ ~]$ > > > And now it works. > > It shouldn''t behave that way. > > > This message posted from opensolaris.org > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Solaris Kernel Development http://blogs.sun.com/ahl