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


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
>
>


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