summaryrefslogtreecommitdiffstats
path: root/tapset/task.stp
diff options
context:
space:
mode:
Diffstat (limited to 'tapset/task.stp')
-rw-r--r--tapset/task.stp8
1 files changed, 3 insertions, 5 deletions
diff --git a/tapset/task.stp b/tapset/task.stp
index 9cd37026..b8b24d7e 100644
--- a/tapset/task.stp
+++ b/tapset/task.stp
@@ -241,11 +241,9 @@ function task_nice:long (task:long) %{ /* pure */
*/
function task_cpu:long (task:long)
{
-%( kernel_v >= "2.6.22" %?
- ti = @cast(task, "task_struct", "kernel<linux/sched.h>")->stack
-%:
- ti = @cast(task, "task_struct", "kernel<linux/sched.h>")->thread_info
-%)
+ ti = (@defined(@cast(task, "task_struct", "kernel<linux/sched.h>")->stack)
+ ? @defined(@cast(task, "task_struct", "kernel<linux/sched.h>")->stack)
+ : @cast(task, "task_struct", "kernel<linux/sched.h>")->thread_info)
return @cast(ti, "thread_info", "kernel<linux/sched.h>")->cpu
}