summaryrefslogtreecommitdiffstats
path: root/tapset/task.stp
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2009-03-17 13:09:49 -0400
committerDave Brolley <brolley@redhat.com>2009-03-17 13:09:49 -0400
commit2855f6351e26f51953af11b17c4499df4d3d3441 (patch)
tree2fa84dd226f944ae29e0dae5e9c192a0f0c0a202 /tapset/task.stp
parent9b6d8bd0d7a6f80a613b7c609ff1d71ddfed009b (diff)
parent67aada05e69728327de1c7b8aeeaa0193668bed8 (diff)
downloadsystemtap-steved-2855f6351e26f51953af11b17c4499df4d3d3441.tar.gz
systemtap-steved-2855f6351e26f51953af11b17c4499df4d3d3441.tar.xz
systemtap-steved-2855f6351e26f51953af11b17c4499df4d3d3441.zip
Merge branch 'master' of git://sources.redhat.com/git/systemtap
Diffstat (limited to 'tapset/task.stp')
-rw-r--r--tapset/task.stp24
1 files changed, 24 insertions, 0 deletions
diff --git a/tapset/task.stp b/tapset/task.stp
index 07337156..f1a10b0a 100644
--- a/tapset/task.stp
+++ b/tapset/task.stp
@@ -63,6 +63,30 @@ function task_pid:long (task:long)
}
+// Return the task of the given process id
+function pid2task:long (pid:long) %{ /* pure */
+ struct task_struct *t = NULL;
+ pid_t t_pid = (pid_t)(long)THIS->pid;
+ rcu_read_lock();
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
+ t = find_task_by_vpid (t_pid);
+#else
+ t = find_task_by_pid (t_pid);
+#endif
+ rcu_read_unlock();
+ THIS->__retvalue = (long)t;
+ CATCH_DEREF_FAULT();
+%}
+
+// Return the name of the given process id
+function pid2execname:string (pid:long) {
+ tsk = pid2task(pid)
+ if (tsk)
+ return task_execname(tsk)
+ return ""
+}
+
+
// Return the thread id of the given task
function task_tid:long (task:long)
{