about thread_info in task_struct
Wenji Huang
wenji.huang@oracle.com
Mon Jul 30 10:29:00 GMT 2007
Hi,
First thank jim! I got the write access for systemtap.
There is some change about task_struct in sched.h (since 2.6.22)
>Commit f7e4217b007d1f73e7e3cf10ba4fea4a608c603f
>Author: Roman Zippel <zippel@linux-m68k.org>
>Date: Wed May 9 02:35:17 2007 -0700
>
> rename thread_info to stack
>
> This finally renames the thread_info field in task structure to stack, so that
> the assumptions about this field are gone and archs have more freedom about
> placing the thread_info structure.
Therefor task_test.stp failed. Reason in tapset/task.stp:
> function task_cpu:long (task:long)
> %( kernel_v >= "2.6.23" %?
> %{ /* pure */
........
So maybe need a little modification, kernel_v >= "2.6.22" or using macro task_thread_info
Another, I wrote function for returning task addr in case of only knowing pid:
/*return task addr according to process id*/
function get_task: long (pid:long) %{
struct task_struct *p;
pid_t pid;
pid = (pid_t)(long)THIS->pid;
rcu_read_lock();
p = find_task_by_pid(pid);
rcu_read_unlock();
THIS->__retvalue = (long) p;
CATCH_DEREF_FAULT();
%}
Please review it.
Best regards,
Wenji
More information about the Systemtap
mailing list