[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120906132346.GA32717@quad>
Date: Thu, 6 Sep 2012 15:23:46 +0200
From: Stephane Eranian <eranian@...gle.com>
To: linux-kernel@...r.kernel.org
Cc: peterz@...radead.org, mingo@...e.hu, fweisbec@...il.com
Subject: [PATCH] perf: remove sw events from multiplexing rotation list
Software events (sw,tracepoints,...) do not need to be
multiplexed. However, when using a SW event, the SW PMU
(TYPE_SOFTWARE, TYPE_TRACEPOINT) was added to the per-cpu
rotation_list. That list is used by perf_rotate_context()
to iterate over all the PMUs to rotate event lists and
multiplex.
This is not needed for SW events. Doing this adds some
unnecessary overhead, so drop it by rejecting SW PMUs
in perf_pmu_rotate_start().
Signed-off-by: Stephane Eranian <eranian@...gle.com>
---
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 7b9df35..40f42b8 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -651,6 +651,10 @@ static void perf_pmu_rotate_start(struct pmu *pmu)
struct perf_cpu_context *cpuctx = this_cpu_ptr(pmu->pmu_cpu_context);
struct list_head *head = &__get_cpu_var(rotation_list);
+ /* no need to mutliplex software events */
+ if (pmu->task_ctx_nr == perf_sw_context)
+ return;
+
WARN_ON(!irqs_disabled());
if (list_empty(&cpuctx->rotation_list))
--
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