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


Sorry, forgot to reply all.

Hi,

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.

Thanks,
hp

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

On Thu, Dec 30, 2010 at 3:08 PM, Adrien Kunysz <adrien@kunysz.be> wrote:
> I don't think that will ever work like that as @1 and $1 are expanded at
> compile time (I think). You probably need to use a named global variable
> as described in the "ARGUMENTS" section of staprun(8).
>
> ? ? ? ?global tpoint = "whateverDefaultProbeYouLike"
> ? ? ? ?probe kernel.trace(tpoint) { printf("oh hai\n") }
>
> # stap -m test test.stp
> # staprun test.ko tpoint="anotherTracepoint"
>
> I haven't verified this will work.
>
> On Thu, Dec 30, 2010 at 02:59:58PM +0530, h patel wrote:
>> It's cross compile :
>> host> stap -gv -r /linux-2.6.32.10 -I /target/share/systemtap/tapset
>> -R /target/share/systemtap/runtime -m test test.stp -v
>>
>> host> cat test.stp
>>
>> #! /usr/bin/env stap
>>
>> # Note when we turn the monitor on and off
>> probe begin { printf("Monitoring for wncreg\n") }
>> probe end { printf("Stopping monitor\n") }
>>
>> probe kernel.trace(@1) { printf("%s called\n",kernel_string($log)) }
>>
>>
>>
>>
>> On Thu, Dec 30, 2010 at 2:52 PM, Adrien Kunysz <adrien@kunysz.be> wrote:
>> > On Thu, Dec 30, 2010 at 01:55:26PM +0530, h patel wrote:
>> >> parse error: command line argument index 1 out of range [1-0]
>> >
>> > This means @1 and $1 don't exist as no argument was passed to the script
>> > and I doubt this has anything to do with .trace itself. How did you run
>> > the script?
>> >
>> > -----BEGIN PGP SIGNATURE-----
>> > Version: GnuPG v1.4.9 (GNU/Linux)
>> >
>> > iEYEARECAAYFAk0cT2sACgkQKLX03ZSPZGxRBgCeL/KX+tOJDvgXDy/qz9jR4a+U
>> > uNYAoJszrKWPVm2B3a9n56oavpo7gcR3
>> > =NCSz
>> > -----END PGP SIGNATURE-----
>> >
>> >
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAk0cUzIACgkQKLX03ZSPZGwuMQCgisjEWsv6UfkD48ws/TdFt/qL
> 0moAniM28a+br6l+vU245Rjb2czhtTwv
> =PkyI
> -----END PGP SIGNATURE-----
>
>


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