From: Frederic Weisbecker <fweisbec@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
Paul Mackerras <paulus@samba.org>,
Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@redhat.com>,
Jason Baron <jbaron@redhat.com>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: Re: [PATCH 2/2] perf: Walk through the relevant events only
Date: Fri, 5 Mar 2010 18:03:33 +0100 [thread overview]
Message-ID: <20100305170331.GB5244@nowhere> (raw)
In-Reply-To: <1267781969.16716.55.camel@laptop>
On Fri, Mar 05, 2010 at 10:39:29AM +0100, Peter Zijlstra wrote:
> On Fri, 2010-03-05 at 08:00 +0100, Frederic Weisbecker wrote:
> > Each time a trace event triggers, we walk through the entire
> > list of events from the active contexts to find the perf events
> > that match the current one.
> >
> > This is wasteful. To solve this, we maintain a per cpu list of
> > the active perf events for each running trace events and we
> > directly commit to these.
>
> Right, so this seems a little trace specific. I once thought about using
> a hash table to do this for all software events. It also keeps it all
> nicely inside perf_event.[ch].
Right. We could have a per cpu type:event_id based hlist that would
cover trace events and other software events.
That would do the trick more generically wrt perf.
Now isn't the problem more in the fact that most of the swevents
should be tracepoints?
This is the case for most of them. Only PERF_COUNT_SW_CPU_CLOCK
and PERF_COUNT_SW_TASK_CLOCK seem to be the exception, and they
manage their own path by calling perf_event_overflow() directly.
And as you guess, turning them into tracepoints would benefit
to everyone. We'll have interesting trace events in fault paths,
we won't have zillions of hooks in the same place (in the context
switch, we have the usual tracepoint plus the perf call).
And eventually the off-case is better optimized, and further
optimizations there (jmp/nop patching/whatever) will propagate
to all tracepoint users.
Finally, we would have only one path to maintain for the swevents.
next prev parent reply other threads:[~2010-03-05 17:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-05 7:00 [PATCH 1/2] perf: Drop the obsolete profile naming for trace events Frederic Weisbecker
2010-03-05 7:00 ` [PATCH 2/2] perf: Walk through the relevant events only Frederic Weisbecker
2010-03-05 9:39 ` Peter Zijlstra
2010-03-05 17:03 ` Frederic Weisbecker [this message]
2010-03-05 17:20 ` Peter Zijlstra
2010-03-05 17:33 ` Frederic Weisbecker
2010-03-05 17:39 ` Peter Zijlstra
2010-03-05 17:46 ` Frederic Weisbecker
2010-03-08 18:35 ` [RFC PATCH] perf: Store relevant events in a hlist Frederic Weisbecker
2010-03-10 19:34 ` Peter Zijlstra
2010-03-10 20:33 ` Frederic Weisbecker
2010-03-10 20:46 ` Peter Zijlstra
2010-03-10 21:04 ` Frederic Weisbecker
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=20100305170331.GB5244@nowhere \
--to=fweisbec@gmail.com \
--cc=acme@redhat.com \
--cc=jbaron@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@redhat.com \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.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