This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Command line arg for kernel Tracepoints
- From: h patel <hpatel05 at gmail dot com>
- To: Mark Wielaard <mjw at redhat dot com>
- Cc: Adrien Kunysz <adrien at kunysz dot be>, systemtap at sources dot redhat dot com
- Date: Mon, 3 Jan 2011 20:02:45 +0530
- Subject: Re: Command line arg for kernel Tracepoints
- References: <AANLkTikvBKHHLgD1AqCEUYx98T9ucK=8CzdJWZ2Ci8WK@mail.gmail.com> <20101230092240.GB4390@baltika> <AANLkTinjLCVwnUXxFLV=xfCk698M=ZfO=RC7JM10mgMF@mail.gmail.com> <20101230093858.GC4390@baltika> <AANLkTimU7id3RD1ewhaZiLYJO6GNCUEVCvN91aFVuCxo@mail.gmail.com> <1294058666.2901.19.camel@springer.wildebeest.org>
Hi Mark,
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.
Regards,
hp
On Mon, Jan 3, 2011 at 6:14 PM, Mark Wielaard <mjw@redhat.com> wrote:
> On Mon, 2011-01-03 at 17:39 +0530, h patel wrote:
>> It didn't work. Script can take the argument but kernel.trace can not.
>> Looks like kernel.trace only handles pattern, not argument.
>> In that case, I will limit down the types of events.
>>
>> Error :
>> parse error: expected literal string or number
>> ? ? ? ?saw: identifier 'tpoint' at test.stp:9:20
>> ? ? source: probe kernel.trace(tpoint) { printf("%s
>> called\n",kernel_string($log)) }
>
> Note that kernel.trace() takes a string.
> So it would be kernel.trace("tpoint") in your case.
> To use wildcards, embed * inside the string.
> For example to get a list of all kernel trace points:
> stap -l 'kernel.trace("*")'
>
> Cheers,
>
> Mark
>
>