This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
RE: probe when thread is queued
It still gives error:
======= cmd out start =======
sles11sp1:/stap_scripts # stap -v -e 'probe scheduler.cpu_off { if (@cast(task_prev, "task_struct")->state == 0) { printf ("pid %d queued\n", @cast(task_prev, "task_struct")->pid); } }'
Pass 1: parsed user script and 59 library script(s) in 100usr/0sys/104real ms.
semantic error: not accessible at this address (0xffffffff8139499b): identifier '$prev' at /usr/share/systemtap/tapset/scheduler.stp:38:17
source: task_prev = $prev
^
Pass 2: analyzed script: 1 probe(s), 2 function(s), 0 embed(s), 0 global(s) in 260usr/130sys/401real ms.
Pass 2: analysis failed. Try again with another '--vp 01' option.
======= cmd out end =======
Thanks,
Mehul
-----Original Message-----
From: David Smith [mailto:dsmith@redhat.com]
Sent: Wednesday, February 06, 2013 2:58 AM
To: Mehul Choube
Cc: systemtap@sourceware.org
Subject: Re: probe when thread is queued
On 02/05/2013 02:33 PM, Mehul Choube wrote:
> stap -e 'probe scheduler.cpu_off { if (task_prev->state == 0) { printf ("pid %d queued\n", task_prev->pid); } }'
The way stap works, the convenience variables have no type information.
Add the type information back with the @cast operator. So, all your
'task_prev' references would look like '@cast(task_prev, "task_struct")'.
Here's the whole thing (somewhat mangled by my mailer):
# stap -v -e 'probe scheduler.cpu_off { if (@cast(task_prev,
"task_struct")->state == 0) { printf ("pid %d queued\n",
@cast(task_prev, "task_struct")->pid); } }'
--
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)