Re: [RFC PATCH 2/3 v3] perf: Implement Nehalem uncore pmu

Lin Ming
2010-12-02T05:55:09Z

On Thu, 2010-12-02 at 13:20 +0800, Lin Ming wrote:
> Changelogs of v3:
>
> - Allocate uncore data with kmalloc_node, like AMD NB stuff. (Peter
> Zijlstra)
>
> - per-task uncore event is not allowed. Simply set pmu::task_ctx_nr =
> perf_invalid_context. (Peter Zijlstra)

<snip>

> +
> +static struct pmu uncore_pmu = {
> + .event_init = uncore_pmu_event_init,
> + .add = uncore_pmu_add,
> + .del = uncore_pmu_del,
> + .start = uncore_pmu_start,
> + .stop = uncore_pmu_stop,
> + .read = uncore_pmu_read,
> +};

Sorry, I send out an old version, need below additional code to disallow
per-task uncore event.

diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
index d2c10d8..d2a22ba 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
@@ -252,6 +252,8 @@ static void uncore_pmu_read(struct perf_event *event)
}

static struct pmu uncore_pmu = {
+ .task_ctx_nr = perf_invalid_context, /* per-task uncore event is not allowed */
+
.event_init = uncore_pmu_event_init,
.add = uncore_pmu_add,
.del = uncore_pmu_del,