This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
(Noob) What's the difference between task_pid(task) and new_pid?
- From: Luis Fernando MuÃoz MejÃas <Luis dot Fernando dot Munoz dot Mejias at cern dot ch>
- To: <systemtap at sourceware dot org>
- Date: Mon, 9 Feb 2009 10:48:52 +0100
- Subject: (Noob) What's the difference between task_pid(task) and new_pid?
Hello, world!
I'm doing some toy SystemTap probes and I found a weird thing. I want
to log every process that is created on my system, so I wrote this
tiny probe:
************************************************************
# Provides relevant information when a process is created
probe process.create {
printf ("Process %d spawns child %d under uid (%d:%d)\n",
pid(), new_pid, uid(), euid());
}
************************************************************
It does what I want it to do, but after ~3 hours it crashes. Some
annoying testing gives me a very small message like this:
"failed to access to address 0xYYYYYY on kread(&(t->tgid))"
The message I write by memory, the statement causing the crash is
exactly that one.
On the other hand, the following version:
************************************************************
# Provides relevant information when a process is created
probe process.create {
printf ("Process %d spawns a new child %d under uid (%d:%d)\n",
tid(), task_pid(task), uid(), euid());
}
************************************************************
has been running for three days with no problems. So, what's the
difference? Is it a bug?
I'm using systemtap-0.7.2-2.el5.el5, as shipped with RHEL 5.2.
Thanks.
--
Luis Fernando MuÃoz MejÃas
Luis.Fernando.Munoz.Mejias@cern.ch