From: Peter Zijlstra <peterz@infradead.org>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Paul Mackerras <paulus@samba.org>,
Stephane Eranian <eranian@google.com>,
Cyrill Gorcunov <gorcunov@gmail.com>,
Zhang Yanmin <yanmin_zhang@linux.intel.com>,
Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH 3/5] perf: New PERF_EVENT_STATE_PAUSED event state
Date: Thu, 10 Jun 2010 12:55:17 +0200 [thread overview]
Message-ID: <1276167317.2077.109.camel@twins> (raw)
In-Reply-To: <1276141760-11590-4-git-send-regression-fweisbec@gmail.com>
On Thu, 2010-06-10 at 05:49 +0200, Frederic Weisbecker wrote:
> This brings a new PERF_EVENT_STATE_PAUSED state. It means the events
> is enabled but we don't want it to run, it must be in the same state
> than after a pmu->stop() call. So the event has been reserved and
> allocated and it is ready to start after a pmu->start() call.
>
> It is deemed for hardware events when we want them to be reserved on
> the cpu and ready to be started anytime. This is going to be useful
> for the new context exclusion that will follow.
>
> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Stephane Eranian <eranian@google.com>
> Cc: Cyrill Gorcunov <gorcunov@gmail.com>
> Cc: Zhang Yanmin <yanmin_zhang@linux.intel.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> ---
> arch/x86/kernel/cpu/perf_event.c | 6 ++++--
> include/linux/perf_event.h | 3 ++-
> kernel/perf_event.c | 7 ++++---
> 3 files changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
> index f2da20f..9b0e52f 100644
> --- a/arch/x86/kernel/cpu/perf_event.c
> +++ b/arch/x86/kernel/cpu/perf_event.c
> @@ -839,7 +839,8 @@ void hw_perf_enable(void)
> match_prev_assignment(hwc, cpuc, i))
> continue;
>
> - x86_pmu_stop(event);
> + if (event->state != PERF_EVENT_STATE_PAUSED)
> + x86_pmu_stop(event);
> }
>
> for (i = 0; i < cpuc->n_events; i++) {
> @@ -851,7 +852,8 @@ void hw_perf_enable(void)
> else if (i < n_running)
> continue;
>
> - x86_pmu_start(event);
> + if (event->state != PERF_EVENT_STATE_PAUSED)
> + x86_pmu_start(event);
> }
> cpuc->n_added = 0;
> perf_events_lapic_init();
Shouldn't that latter be == PAUSED?
Also, you'll have to audit all struct pmu implementations that
stop/disable or disable/disable is good.
Also, I'd rather keep the whole event->state knowledge in the generic
code.
next prev parent reply other threads:[~2010-06-10 10:55 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-10 3:49 [PATCH 0/5] perf events finer grained context instrumentation / context exclusion Frederic Weisbecker
2010-06-10 3:49 ` [PATCH 1/5] perf: Provide a proper stop action for software events Frederic Weisbecker
2010-06-10 10:46 ` Peter Zijlstra
2010-06-10 11:10 ` Peter Zijlstra
2010-06-10 16:12 ` Frederic Weisbecker
2010-06-10 16:16 ` Peter Zijlstra
2010-06-10 16:29 ` Frederic Weisbecker
2010-06-10 16:38 ` Peter Zijlstra
2010-06-10 17:04 ` Frederic Weisbecker
2010-06-10 19:54 ` Frederic Weisbecker
2010-06-10 12:06 ` Ingo Molnar
2010-06-10 3:49 ` [PATCH 2/5] perf: Support disable() after stop() on " Frederic Weisbecker
2010-06-10 10:50 ` Peter Zijlstra
2010-06-10 16:31 ` Frederic Weisbecker
2010-06-10 3:49 ` [PATCH 3/5] perf: New PERF_EVENT_STATE_PAUSED event state Frederic Weisbecker
2010-06-10 10:55 ` Peter Zijlstra [this message]
2010-06-10 16:26 ` Frederic Weisbecker
2010-06-10 3:49 ` [PATCH 4/5] perf: Introduce task, softirq and hardirq contexts exclusion Frederic Weisbecker
2010-06-10 11:01 ` Peter Zijlstra
2010-06-10 16:24 ` Frederic Weisbecker
2010-06-10 3:49 ` [PATCH 5/5] perf: Support for task/softirq/hardirq exclusion on tools Frederic Weisbecker
2010-06-10 6:26 ` [PATCH 0/5] perf events finer grained context instrumentation / context exclusion Ingo Molnar
2010-06-10 7:15 ` Frederic Weisbecker
2010-06-10 7:31 ` Frederic Weisbecker
2010-06-10 10:16 ` Ingo Molnar
2010-06-10 17:03 ` 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=1276167317.2077.109.camel@twins \
--to=peterz@infradead.org \
--cc=acme@redhat.com \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=gorcunov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=rostedt@goodmis.org \
--cc=yanmin_zhang@linux.intel.com \
/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