summaryrefslogtreecommitdiffstats
path: root/tapset/task.stp
diff options
context:
space:
mode:
authormmason <mmason>2007-07-25 18:35:30 +0000
committermmason <mmason>2007-07-25 18:35:30 +0000
commit7f4d628d6285195e19c692485d21928c85088b45 (patch)
tree1d14970026ec64917ec80850296886835e14d30c /tapset/task.stp
parentc0b94269bf35be3ad448dc900dcfdde9c3b149fd (diff)
downloadsystemtap-steved-7f4d628d6285195e19c692485d21928c85088b45.tar.gz
systemtap-steved-7f4d628d6285195e19c692485d21928c85088b45.tar.xz
systemtap-steved-7f4d628d6285195e19c692485d21928c85088b45.zip
Fixes for PR4836.
Diffstat (limited to 'tapset/task.stp')
-rw-r--r--tapset/task.stp12
1 files changed, 11 insertions, 1 deletions
diff --git a/tapset/task.stp b/tapset/task.stp
index 2f183838..1a7699d0 100644
--- a/tapset/task.stp
+++ b/tapset/task.stp
@@ -109,9 +109,19 @@ function task_nice:long (task:long) %{ /* pure */
// Return the scheduled cpu for the given task
-function task_cpu:long (task:long) %{ /* pure */
+function task_cpu:long (task:long)
+%( kernel_v >= "2.6.23" %?
+%{ /* pure */
+ struct task_struct *t = (struct task_struct *)(long)THIS->task;
+ struct thread_info *ti = kread(&(t->stack));
+ THIS->__retvalue = kread(&(ti->cpu));
+ CATCH_DEREF_FAULT();
+%}
+%:
+%{ /* pure */
struct task_struct *t = (struct task_struct *)(long)THIS->task;
struct thread_info *ti = kread(&(t->thread_info));
THIS->__retvalue = kread(&(ti->cpu));
CATCH_DEREF_FAULT();
%}
+%)