public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* about thread_info in task_struct
@ 2007-07-30 10:29 Wenji Huang
  2007-07-30 18:05 ` Stone, Joshua I
  0 siblings, 1 reply; 2+ messages in thread
From: Wenji Huang @ 2007-07-30 10:29 UTC (permalink / raw)
  To: systemtap

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-07-30 17:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-30 10:29 about thread_info in task_struct Wenji Huang
2007-07-30 18:05 ` Stone, Joshua I

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).