[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.1.10.0812040953470.5240@gandalf.stny.rr.com>
Date: Thu, 4 Dec 2008 09:57:40 -0500 (EST)
From: Steven Rostedt <rostedt@...dmis.org>
To: "Eric W. Biederman" <ebiederm@...ssion.com>
cc: linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
Andrew Morton <akpm@...ux-foundation.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Peter Zijlstra <peterz@...radead.org>,
Dave Hansen <dave@...ux.vnet.ibm.com>,
containers@...ts.osdl.org,
Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>,
"Serge E. Hallyn" <serue@...ibm.com>,
Steven Rostedt <srostedt@...hat.com>,
Oleg Nesterov <oleg@...sign.ru>
Subject: Re: [PATCH 3/3] ftrace: add ability to only trace swapper tasks
On Thu, 4 Dec 2008, Eric W. Biederman wrote:
> Steven Rostedt <rostedt@...dmis.org> writes:
> >
> > diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> > index 10b1d7c..eb57dc1 100644
> > --- a/kernel/trace/ftrace.c
> > +++ b/kernel/trace/ftrace.c
> > @@ -49,6 +49,7 @@ static int last_ftrace_enabled;
> >
> > /* set when tracing only a pid */
> > struct pid *ftrace_pid_trace;
> > +static struct pid * const ftrace_swapper_pid = (struct pid *)1;
>
> The initializer should be spelled &init_struct_pid instead of (struct pid *)1;
>
> Except for the special case of finding this unhashed pid, by making the
> attach_pid(p, PIDTYPE_PID, pid) unconditional in copy_process, you can
> make the rest of the special cases go away.
Not that easy. It turns out that all idle tasks share the init_struct_pid,
and if you add the attach_pid() outside the if statement, you only change
the owner of the init_struct_pid to the last CPU to come on line.
I tried to allocate the pid, but by doing that it seems that the alloc_pid
code will assign a number other than 0. The changes needed to fork.c to
make this work is quickly going beyond a trivial fix, where I do not want
to become a pid container developer in order to implement it.
-- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists