mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Yunlong Song <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: paulus@samba.org, wangnan0@huawei.com, yunlong.song@huawei.com,
	tglx@linutronix.de, mingo@kernel.org,
	linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl,
	acme@redhat.com, hpa@zytor.com
Subject: [tip:perf/core] perf list: Place the header text in its right position
Date: Wed, 18 Feb 2015 10:42:07 -0800	[thread overview]
Message-ID: <tip-619a303c1b8bd22abc549477d038ef9b5c1fe1bd@git.kernel.org> (raw)
In-Reply-To: <1423833115-11199-8-git-send-email-yunlong.song@huawei.com>

Commit-ID:  619a303c1b8bd22abc549477d038ef9b5c1fe1bd
Gitweb:     http://git.kernel.org/tip/619a303c1b8bd22abc549477d038ef9b5c1fe1bd
Author:     Yunlong Song <yunlong.song@huawei.com>
AuthorDate: Fri, 13 Feb 2015 21:11:55 +0800
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 13 Feb 2015 11:57:50 -0300

perf list: Place the header text in its right position

The hearer text 'List of pre-defined events (to be used in -e):' is
placed in an improper function, which causes an abnormal output, e.g.
'perf list hw' shows no guiding text at all, and 'perf list hw
L1-dcache*' shows the guiding text incorrectly in the middle of the
output.

Example
Before this patch:

 $ perf list hw L1-dcache*

   branch-instructions OR branches                    [Hardware event]
   branch-misses                                      [Hardware event]
   bus-cycles                                         [Hardware event]
   cache-misses                                       [Hardware event]
   cache-references                                   [Hardware event]
   cpu-cycles OR cycles                               [Hardware event]
   instructions                                       [Hardware event]
   stalled-cycles-backend OR idle-cycles-backend      [Hardware event]
   stalled-cycles-frontend OR idle-cycles-frontend    [Hardware event]

 List of pre-defined events (to be used in -e):              <-- incorrect position
   L1-dcache-load-misses                              [Hardware cache event]
   L1-dcache-loads                                    [Hardware cache event]
   L1-dcache-prefetch-misses                          [Hardware cache event]
   L1-dcache-prefetches                               [Hardware cache event]
   L1-dcache-store-misses                             [Hardware cache event]
   L1-dcache-stores                                   [Hardware cache event]

After this patch:

 $ perf list hw L1-dcache*

 List of pre-defined events (to be used in -e):              <-- correct position

   branch-instructions OR branches                    [Hardware event]
   branch-misses                                      [Hardware event]
   bus-cycles                                         [Hardware event]
   cache-misses                                       [Hardware event]
   cache-references                                   [Hardware event]
   cpu-cycles OR cycles                               [Hardware event]
   instructions                                       [Hardware event]
   stalled-cycles-backend OR idle-cycles-backend      [Hardware event]
   stalled-cycles-frontend OR idle-cycles-frontend    [Hardware event]

   L1-dcache-load-misses                              [Hardware cache event]
   L1-dcache-loads                                    [Hardware cache event]
   L1-dcache-prefetch-misses                          [Hardware cache event]
   L1-dcache-prefetches                               [Hardware cache event]
   L1-dcache-store-misses                             [Hardware cache event]
   L1-dcache-stores                                   [Hardware cache event]

Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1423833115-11199-8-git-send-email-yunlong.song@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-list.c      | 3 +++
 tools/perf/util/parse-events.c | 5 -----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
index 198f3c3..ad8018e 100644
--- a/tools/perf/builtin-list.c
+++ b/tools/perf/builtin-list.c
@@ -41,6 +41,9 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
 		return 0;
 	}
 
+	if (!raw_dump)
+		printf("\nList of pre-defined events (to be used in -e):\n\n");
+
 	if (argc == 0) {
 		print_events(NULL, false);
 		return 0;
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index ecf069b..109ba5c 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1319,11 +1319,6 @@ static void print_symbol_events(const char *event_glob, unsigned type,
  */
 void print_events(const char *event_glob, bool name_only)
 {
-	if (!name_only) {
-		printf("\n");
-		printf("List of pre-defined events (to be used in -e):\n");
-	}
-
 	print_symbol_events(event_glob, PERF_TYPE_HARDWARE,
 			    event_symbols_hw, PERF_COUNT_HW_MAX, name_only);
 

      reply	other threads:[~2015-02-18 18:42 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-13 13:11 [PATCH 0/7] perf list: make some improvements and fixes Yunlong Song
2015-02-13 13:11 ` [PATCH 1/7] perf list: clean up the printing functions of hardware/software events Yunlong Song
2015-02-13 13:11 ` [PATCH 2/7] perf list: sort the output of 'perf list' to view more clearly Yunlong Song
2015-02-13 14:45   ` Arnaldo Carvalho de Melo
2015-02-13 14:49     ` Arnaldo Carvalho de Melo
2015-02-15 10:19       ` Yunlong Song
2015-02-15 10:11     ` Yunlong Song
2015-02-13 13:11 ` [PATCH 3/7] perf list: fix some inaccuracy problem when parsing the argument Yunlong Song
2015-02-13 13:11 ` [PATCH 4/7] perf list: fix a bug of segmentation fault Yunlong Song
2015-02-18 18:41   ` [tip:perf/core] perf tools: Fix " tip-bot for Yunlong Song
2015-02-13 13:11 ` [PATCH 5/7] perf list: avoid confusion of perf output and the next command prompt Yunlong Song
2015-02-13 14:52   ` Arnaldo Carvalho de Melo
2015-02-15 10:01     ` Yunlong Song
2015-02-13 13:11 ` [PATCH 6/7] perf list: extend raw-dump to certain kind of events Yunlong Song
2015-02-13 14:55   ` Arnaldo Carvalho de Melo
2015-02-15 10:05     ` Yunlong Song
2015-02-13 13:11 ` [PATCH 7/7] perf list: place the guiding text in its right position Yunlong Song
2015-02-18 18:42   ` tip-bot for Yunlong Song [this message]

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=tip-619a303c1b8bd22abc549477d038ef9b5c1fe1bd@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulus@samba.org \
    --cc=tglx@linutronix.de \
    --cc=wangnan0@huawei.com \
    --cc=yunlong.song@huawei.com \
    /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