summaryrefslogtreecommitdiffstats
path: root/tapset
diff options
context:
space:
mode:
authorWenji Huang <wenji.huang@oracle.com>2009-07-21 16:24:10 -0400
committerWenji Huang <wenji.huang@oracle.com>2009-07-21 16:24:10 -0400
commita6fade8983a61ecfe58f4824923a5a0f6726c818 (patch)
tree1b91c807181f7b447e7bec8b1f856e550196c3d8 /tapset
parentda8fdd3d1e50f4432574a307f07731bf6a62562d (diff)
downloadsystemtap-steved-a6fade8983a61ecfe58f4824923a5a0f6726c818.tar.gz
systemtap-steved-a6fade8983a61ecfe58f4824923a5a0f6726c818.tar.xz
systemtap-steved-a6fade8983a61ecfe58f4824923a5a0f6726c818.zip
PR10421: Update task.stp for 2.6.31
* tapset/task.stp (pid2task): Use find_get_pid for 2.6.31.
Diffstat (limited to 'tapset')
-rw-r--r--tapset/task.stp12
1 files changed, 9 insertions, 3 deletions
diff --git a/tapset/task.stp b/tapset/task.stp
index 1f4e0e6f..8776a014 100644
--- a/tapset/task.stp
+++ b/tapset/task.stp
@@ -67,13 +67,19 @@ function task_pid:long (task:long)
function pid2task:long (pid:long) %{ /* pure */
struct task_struct *t = NULL;
pid_t t_pid = (pid_t)(long)THIS->pid;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
+ struct pid *p_pid = find_get_pid(t_pid);
+ t = pid_task(p_pid, PIDTYPE_PID);
+ put_pid(p_pid);
+#else
rcu_read_lock();
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
- t = find_task_by_vpid (t_pid);
+ t = find_task_by_vpid (t_pid);
#else
- t = find_task_by_pid (t_pid);
-#endif
+ t = find_task_by_pid (t_pid);
+#endif /* 2.6.24 */
rcu_read_unlock();
+#endif /* 2.6.31 */
THIS->__retvalue = (long)t;
CATCH_DEREF_FAULT();
%}