This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Command line arg for kernel Tracepoints


On Mon, 2011-01-03 at 15:39 +0100, Mark Wielaard wrote:
> On Mon, 2011-01-03 at 20:02 +0530, h patel wrote:
> > tpoint is the global variable.  I want to enable disable tracepoints
> > at runtime.
> > Adrien suggested following way :
> > 
> >  global tpoint = "whateverDefaultProbeYouLike"
> > probe kernel.trace(tpoint) { printf("oh hai\n") }
> > 
> > # stap -m test test.stp
> > # staprun test.ko tpoint="anotherTracepoint"
> > 
> > I tried kernel.trace(tpoint), kernel.trace($tpoint),
> > kernel.trace("tpoint"), none of them worked.
> 
> Aha. Sorry, I had misunderstood what you were trying to do. Apologies.
> 
> Something like the following should work for that use case:
> $ stap -e 'probe kernel.trace(@1) { log(pp()); exit();}' "sys_enter"
> kernel.trace("sys_enter")
> $ stap -e 'probe kernel.trace(@1) { log(pp()); exit();}' "timer_start"
> kernel.trace("timer_start")

Actually, I see I am missing the point again.
That would compile in the trace point string.
So you cannot change it at staprun time.

I believe there is indeed no way to change the actual probe at staprun
time at the moment.

Sorry,

Mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]