From: Frederic Weisbecker <fweisbec@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>,
Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>,
Stephane Eranian <eranian@google.com>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [BUG(?)] perf_events: combining multiple tracepoint events into a group produces no counts on member events
Date: Thu, 2 Dec 2010 18:56:53 +0100 [thread overview]
Message-ID: <20101202175647.GB1750@nowhere> (raw)
In-Reply-To: <1291229526.32004.1882.camel@laptop>
On Wed, Dec 01, 2010 at 07:52:06PM +0100, Peter Zijlstra wrote:
> On Wed, 2010-12-01 at 19:02 +0100, Frederic Weisbecker wrote:
>
> > > struct task_struct {
> > > volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */
> > > void *stack;
> > > @@ -1452,6 +1458,9 @@ struct task_struct {
> > > struct perf_event_context *perf_event_ctxp[perf_nr_task_contexts];
> > > struct mutex perf_event_mutex;
> > > struct list_head perf_event_list;
> > > +#ifdef CONFIG_EVENT_TRACING
> > > + struct perf_tp_idr *perf_tp_idr;
> >
> > Why not attaching this to the ctx eventually? This makes one pointer less
> > in task_struct.
>
> What context? :-) There's now two context's (with the possibility of
> even more), which one will hold the tracepoint stuff?
>
> Also, since we only need one such structure, adding it to the context
> doesn't make sense.
Oh you're right, I forgot the per pmu context thing :)
>
> > > @@ -370,6 +372,7 @@ list_del_event(struct perf_event *event,
> > > */
> > > if (event->state > PERF_EVENT_STATE_OFF)
> > > event->state = PERF_EVENT_STATE_OFF;
> > > + ++ctx->generation;
> >
> > What's the role of the ctx->generation? It seems to be incremented two times
> > but doesn't appear to have any purpose.
>
> You didn't look hard enough, its a sequence stamp on the context for
> inheritance, then later, when we want to compare inherited contexts we
> can simply compare generation numbers, if they're the same the contexts
> are the same.
Ah right.
> > > }
> > >
> > > static void perf_group_detach(struct perf_event *event)
> > > @@ -1228,6 +1231,12 @@ void perf_event_context_sched_out(struct
> > > if (!cpuctx->task_ctx)
> > > return;
> > >
> > > +#if 0
> > > + /*
> > > + * Need to sort out how to make task_struct::perf_tp_idr
> > > + * work with this fancy switching stuff.. tracepoints could be
> > > + * in multiple contexts due to the software event muck.
> > > + */
> >
> > Not sure what's the issue here. Each ctx have the perf_tp_idr matching
> > active tracepoints, isn't it?
>
> No, there's only 1 idr per task. Having one per context means we have to
> iterate all contexts when a tracepoint triggers and it adds yet another
> pointer chase. It also means we have to manage more stuff when
> tracepoints change context etc..
>
> But yes, it would make this part easier, I just don't like the added
> fast path overhead.
Ok.
next prev parent reply other threads:[~2010-12-02 17:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-01 1:00 [BUG(?)] perf_events: combining multiple tracepoint events into a group produces no counts on member events Corey Ashford
2010-12-01 11:46 ` Peter Zijlstra
2010-12-01 12:04 ` Peter Zijlstra
2010-12-01 18:02 ` Frederic Weisbecker
2010-12-01 18:52 ` Peter Zijlstra
2010-12-02 17:56 ` Frederic Weisbecker [this message]
2010-12-01 18:29 ` Frederic Weisbecker
2010-12-01 18:37 ` Peter Zijlstra
2010-12-01 19:22 ` Corey Ashford
2010-12-01 19:30 ` Peter Zijlstra
2010-12-02 8:58 ` Corey Ashford
2010-12-09 19:56 ` Peter Zijlstra
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=20101202175647.GB1750@nowhere \
--to=fweisbec@gmail.com \
--cc=cjashfor@linux.vnet.ibm.com \
--cc=eranian@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.