lkml.org 
[lkml]   [2009]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [tip:perfcounters/core] perf_counter: Use PID namespaces properly
On 06/02, Peter Zijlstra wrote:
>
> On Tue, 2009-06-02 at 17:55 +0200, Oleg Nesterov wrote:
> > On 06/02, tip-bot for Peter Zijlstra wrote:
> > >
> > > +static u32 perf_counter_pid(struct perf_counter *counter, struct task_struct *p)
> > > +{
> > > + /*
> > > + * only top level counters have the pid namespace they were created in
> > > + */
> > > + if (counter->parent)
> > > + counter = counter->parent;
> > > +
> > > + return task_tgid_nr_ns(p, counter->ns);
> > > +}
> > > +
> > > +static u32 perf_counter_tid(struct perf_counter *counter, struct task_struct *p)
> > > +{
> > > + /*
> > > + * only top level counters have the pid namespace they were created in
> > > + */
> > > + if (counter->parent)
> > > + counter = counter->parent;
> > > +
> > > + return task_pid_nr_ns(p, counter->ns);
> >
> > Perhaps this should be
> >
> > return task_pid_nr_ns(p->group_leader);
> >
> > ?
>
> That seems to be exactly what task_tgid_nr_ns() does.

Ah, yes, I didn't notice _tgid_ above.

Oleg.



\
 
 \ /
  Last update: 2009-06-02 18:39    [W:0.035 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site