From: Wenji Huang <wenji.huang@oracle.com>
To: systemtap@sourceware.org
Subject: about thread_info in task_struct
Date: Mon, 30 Jul 2007 10:29:00 -0000 [thread overview]
Message-ID: <46ADB6BC.3090803@oracle.com> (raw)
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
next reply other threads:[~2007-07-30 10:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-30 10:29 Wenji Huang [this message]
2007-07-30 18:05 ` Stone, Joshua I
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46ADB6BC.3090803@oracle.com \
--to=wenji.huang@oracle.com \
--cc=systemtap@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).