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


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