public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* function pid2task in task.stp causes a kernel panic?
@ 2013-08-21 14:27 maliubiao
  2013-08-22  5:11 ` Masanari Iida
  0 siblings, 1 reply; 2+ messages in thread
From: maliubiao @ 2013-08-21 14:27 UTC (permalink / raw)
  To: systemtap

uname -a
Linux linux 3.7.10-1.16-desktop #3 SMP PREEMPT Mon Aug 19 10:39:20 CST
2013 x86_64 x86_64 x86_64 GNU/Linux

script:
probe signal.send {
printf("signame: %s\n", sig_name)
printf("pid: %d\n", sig_pid)
printf("execname: %s\n", pid2execname(sig_pid))
}

screenshot :
http://pynotes.cufy.org/images/kernel_panic_2.JPG
The newest frame is find_get_pid

function task2pid:long {pid:long} %{ /*pure*/
    struct task_struct *t = NULL;
    pid_t t_pid  = (pid_t)(long)STAP_ARG_pid;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
    struct pid *p_pid = find_get_pid(t_pid);
    rcu_read_lock();
    t = pid_task(p_pid, PIDTYPE_PID);
    put_pid(p_pid);
#else
    rcu_read_lock();
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
    t = find_task_by_vpid (t_pid);
#else
    t = find_task_by_pid (t_pid);
#endif /* 2.6.24 */
#endif /* 2.6.31 */
    rcu_read_unlock();
    STAP_RETVALUE = (long)t;
%}


any idea?

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

* Re: function pid2task in task.stp causes a kernel panic?
  2013-08-21 14:27 function pid2task in task.stp causes a kernel panic? maliubiao
@ 2013-08-22  5:11 ` Masanari Iida
  0 siblings, 0 replies; 2+ messages in thread
From: Masanari Iida @ 2013-08-22  5:11 UTC (permalink / raw)
  To: maliubiao; +Cc: systemtap

Your sample script works for me without panic.

Fedora 18(x86)
kernel-3.9.9-201-fc18.i686
systemtap release 2.3-33-gfb4d4df

Regards,
Masanari


On Wed, Aug 21, 2013 at 11:27 PM, maliubiao <maliubiao@gmail.com> wrote:
> uname -a
> Linux linux 3.7.10-1.16-desktop #3 SMP PREEMPT Mon Aug 19 10:39:20 CST
> 2013 x86_64 x86_64 x86_64 GNU/Linux
>

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

end of thread, other threads:[~2013-08-22  5:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-21 14:27 function pid2task in task.stp causes a kernel panic? maliubiao
2013-08-22  5:11 ` Masanari Iida

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).