Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1507367 > unrolled thread

[PATCH 26/37] perf pmu: Only print Using CPUID message once

Started byArnaldo Carvalho de Melo <acme@kernel.org>
First post2016-10-24 18:30 +0200
Last post2016-10-24 18:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 26/37] perf pmu: Only print Using CPUID message once Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-24 18:30 +0200

#1507367 — [PATCH 26/37] perf pmu: Only print Using CPUID message once

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-10-24 18:30 +0200
Subject[PATCH 26/37] perf pmu: Only print Using CPUID message once
Message-ID<svQim-1Di-29@gated-at.bofh.it>
From: Andi Kleen <ak@linux.intel.com>

With uncore event aliases which are duplicated over multiple PMUs the
"Using CPUID" message with -v could be printed many times.  Only print
it once.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/1476393332-20732-3-git-send-email-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/pmu.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index b1474dcadfa2..d7174f340b53 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -504,6 +504,7 @@ static void pmu_add_cpu_aliases(struct list_head *head)
 	struct pmu_events_map *map;
 	struct pmu_event *pe;
 	char *cpuid;
+	static bool printed;
 
 	cpuid = getenv("PERF_CPUID");
 	if (cpuid)
@@ -513,7 +514,10 @@ static void pmu_add_cpu_aliases(struct list_head *head)
 	if (!cpuid)
 		return;
 
-	pr_debug("Using CPUID %s\n", cpuid);
+	if (!printed) {
+		pr_debug("Using CPUID %s\n", cpuid);
+		printed = true;
+	}
 
 	i = 0;
 	while (1) {
-- 
2.7.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web