mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: acme@kernel.org
Cc: jolsa@kernel.org, linux-kernel@vger.kernel.org,
	Andi Kleen <ak@linux.intel.com>
Subject: [PATCH 02/11] perf, tools: Only print Using CPUID message once
Date: Tue, 18 Oct 2016 16:07:40 -0700	[thread overview]
Message-ID: <1476832069-364-3-git-send-email-andi@firstfloor.org> (raw)
In-Reply-To: <1476832069-364-1-git-send-email-andi@firstfloor.org>

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>
---
 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 73a594ff9b9b..739e8aa63b78 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -510,6 +510,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)
@@ -519,7 +520,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.5.5

  parent reply	other threads:[~2016-10-18 23:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-18 23:07 Support Intel uncore event lists v2 Andi Kleen
2016-10-18 23:07 ` [PATCH 01/11] perf, tools: Factor out scale conversion code Andi Kleen
2016-10-18 23:07 ` Andi Kleen [this message]
2016-10-18 23:07 ` [PATCH 03/11] perf, tools: Parse eventcode as number in jevents Andi Kleen
2016-10-18 23:07 ` [PATCH 04/11] perf, tools: Add support for parsing uncore json files Andi Kleen
2016-10-18 23:07 ` [PATCH 05/11] perf, tools: Support per pmu json aliases Andi Kleen
2016-10-18 23:07 ` [PATCH 06/11] perf, tools: Support event aliases for non cpu// pmus Andi Kleen
2016-10-18 23:07 ` [PATCH 07/11] perf, tools: Add debug support for outputing alias string Andi Kleen
2016-10-18 23:07 ` [PATCH 08/11] perf, tools: Collapse identically named events in perf stat Andi Kleen
2016-10-18 23:07 ` [PATCH 09/11] perf, tools: Expand PMU events by prefix match Andi Kleen
2016-10-18 23:07 ` [PATCH 10/11] perf, tools: Support DividedBy header in JSON event list Andi Kleen
2016-10-18 23:07 ` [PATCH 11/11] perf, tools, stat: Output generic dividedby metric Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1476832069-364-3-git-send-email-andi@firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome