[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <i2zaa79d98a1005080433qb2f44069n4548ac3cfdd4772b@mail.gmail.com>
Date: Sat, 8 May 2010 15:33:46 +0400
From: Cyrill Gorcunov <gorcunov@...nvz.org>
To: Cyrill Gorcunov <gorcunov@...nvz.org>
Cc: "mingo@...e.hu" <mingo@...e.hu>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Lin Ming <ming.m.lin@...el.com>,
Robert Richter <robert.richter@....com>
Subject: Re: [patch 1/4] x86,perf: P4 PMU -- configurate predefined events
On Saturday, May 8, 2010, Cyrill Gorcunov <gorcunov@...nvz.org> wrote:
> If an event is not RAW we should exit p4_hw_config
> early but call x86_setup_perfctr as well.
>
Actually i meant "should not"
> CC: Peter Zijlstra <peterz@...radead.org>
> CC: Ingo Molnar <mingo@...e.hu>
> CC: Frederic Weisbecker <fweisbec@...il.com>
> CC: Lin Ming <ming.m.lin@...el.com>
> CC: Robert Richter <robert.richter@....com>
> Signed-off-by: Cyrill Gorcunov <gorcunov@...nvz.org>
> ---
>
> Robert, if only I'm not missing something this is
> a side effect of commit 9d0fcba67e47ff398a6fa86476d4884d472dc98a,
> wonders why don't we hit it earlier. Am I wrong?
>
> arch/x86/kernel/cpu/perf_event_p4.c | 29 ++++++++++++++---------------
> 1 file changed, 14 insertions(+), 15 deletions(-)
>
> Index: linux-2.6.git/arch/x86/kernel/cpu/perf_event_p4.c
> =====================================================================
> --- linux-2.6.git.orig/arch/x86/kernel/cpu/perf_event_p4.c
> +++ linux-2.6.git/arch/x86/kernel/cpu/perf_event_p4.c
> @@ -439,21 +439,20 @@ static int p4_hw_config(struct perf_even
> if (p4_ht_active() && p4_ht_thread(cpu))
> event->hw.config = p4_set_ht_bit(event->hw.config);
>
> - if (event->attr.type != PERF_TYPE_RAW)
> - return 0;
> -
> - /*
> - * We don't control raw events so it's up to the caller
> - * to pass sane values (and we don't count the thread number
> - * on HT machine but allow HT-compatible specifics to be
> - * passed on)
> - *
> - * XXX: HT wide things should check perf_paranoid_cpu() &&
> - * CAP_SYS_ADMIN
> - */
> - event->hw.config |= event->attr.config &
> - (p4_config_pack_escr(P4_ESCR_MASK_HT) |
> - p4_config_pack_cccr(P4_CCCR_MASK_HT));
> + if (event->attr.type == PERF_TYPE_RAW) {
> + /*
> + * We don't control raw events so it's up to the caller
> + * to pass sane values (and we don't count the thread number
> + * on HT machine but allow HT-compatible specifics to be
> + * passed on)
> + *
> + * XXX: HT wide things should check perf_paranoid_cpu() &&
> + * CAP_SYS_ADMIN
> + */
> + event->hw.config |= event->attr.config &
> + (p4_config_pack_escr(P4_ESCR_MASK_HT) |
> + p4_config_pack_cccr(P4_CCCR_MASK_HT));
> + }
>
> return x86_setup_perfctr(event);
> }
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists