mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: "Arnaldo Carvalho de Melo" <acme@redhat.com>,
	"Mike Galbraith" <efault@gmx.de>,
	"Frédéric Weisbecker" <fweisbec@gmail.com>,
	"Tim Blechmann" <tim@klingt.org>,
	linux-kernel@vger.kernel.org
Subject: Re: pref record question
Date: Tue, 20 Oct 2009 11:19:50 +0200	[thread overview]
Message-ID: <1256030390.17774.35.camel@laptop> (raw)
In-Reply-To: <20091020060043.GB8550@elte.hu>

On Tue, 2009-10-20 at 08:00 +0200, Ingo Molnar wrote:
> * Peter Zijlstra <peterz@infradead.org> wrote:
> 
> > On Mon, 2009-10-19 at 19:04 +0200, Tim Blechmann wrote:
> >
> > > i am trying to do some profiling with perf (2.6.31.4). while 
> > > thread-level profiling works fine, i haven't been able to record 
> > > profiling data of a whole process (i.e. main thread + child 
> > > threads). from my understanding, this should be enabled by running 
> > > 'perf record -i' on the main thread. this does only collect the data 
> > > from the main thread, though.
> > > 
> > > is this an issue with perf or with my understanding of perf?
> > 
> > -i will only inherit the counters on new fork()/clone() calls, so an 
> > existing process/task tree will not automagically get the counters.
> 
> Looks like something very much worth fixing.

Well, maybe.

There's two ways to go about this, either iterate the tasks in userspace
and attach a counter to each one (repeat until there's no new ones
left).

Or add a new flag in perf_event_attr to iterate the tasks on attach in
an atomic manner.

We cannot simply extend the current attach behaviour as that would make
it impossible to attach to a single thread in a thread group.

Also, if you extend the interface, it would make sense to allow
automatically attaching to a process group, not only a thread group,
etc.




  reply	other threads:[~2009-10-20  9:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-19 17:04 Tim Blechmann
2009-10-20  4:26 ` Peter Zijlstra
2009-10-20  6:00   ` Ingo Molnar
2009-10-20  9:19     ` Peter Zijlstra [this message]
2009-10-20 12:46       ` Ingo Molnar

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=1256030390.17774.35.camel@laptop \
    --to=peterz@infradead.org \
    --cc=acme@redhat.com \
    --cc=efault@gmx.de \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tim@klingt.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

Powered by JetHome