From: Andi Kleen Date: Thu, 13 Oct 2016 21:15:24 +0000 (-0700) Subject: perf pmu: Only print Using CPUID message once X-Git-Tag: v4.10-rc1~190^2~12^2~11 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=fb967063699e25ae73f0991672f99bd7104f70c8;p=tomoyo%2Ftomoyo-test1.git perf pmu: Only print Using CPUID message once 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 Cc: Jiri Olsa Cc: Stephane Eranian Cc: Sukadev Bhattiprolu Link: http://lkml.kernel.org/r/1476393332-20732-3-git-send-email-andi@firstfloor.org Signed-off-by: Arnaldo Carvalho de Melo --- 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) {