All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, Namhyung Kim <namhyung.kim@lge.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Paul Mackerras <paulus@samba.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 06/10] perf tools: Prevent condition that all sort keys are elided
Date: Mon, 11 Nov 2013 17:22:29 -0300	[thread overview]
Message-ID: <1384201353-23863-7-git-send-email-acme@infradead.org> (raw)
In-Reply-To: <1384201353-23863-1-git-send-email-acme@infradead.org>

From: Namhyung Kim <namhyung.kim@lge.com>

If given sort keys are all elided there'll be no output except for the
overhead column - actually the TUI shows a noisy output.  In this case
it'd be better to show up the sort keys rather than elide.

Before:

  $ perf report -s comm -c perf
  (...)
  # Overhead
  # ........
  #
     100.00%

After:

  $ perf report -s comm -c perf
  (...)
  # Overhead  Command
  # ........  .......
  #
     100.00%     perf

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1383900822-14609-1-git-send-email-namhyung@kernel.org
[ Us curly braces around multi-line statements, as requested by Ingo Molnar ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/sort.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 3c1b75c8b9a6..8b0bb1f4494a 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -1137,6 +1137,8 @@ static void sort_entry__setup_elide(struct sort_entry *se,
 
 void sort__setup_elide(FILE *output)
 {
+	struct sort_entry *se;
+
 	sort_entry__setup_elide(&sort_dso, symbol_conf.dso_list,
 				"dso", output);
 	sort_entry__setup_elide(&sort_comm, symbol_conf.comm_list,
@@ -1172,4 +1174,15 @@ void sort__setup_elide(FILE *output)
 					"snoop", output);
 	}
 
+	/*
+	 * It makes no sense to elide all of sort entries.
+	 * Just revert them to show up again.
+	 */
+	list_for_each_entry(se, &hist_entry__sort_list, list) {
+		if (!se->elide)
+			return;
+	}
+
+	list_for_each_entry(se, &hist_entry__sort_list, list)
+		se->elide = false;
 }
-- 
1.8.1.4


  parent reply	other threads:[~2013-11-11 20:24 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-11 20:22 [GIT PULL 00/10] perf/core improvements and fixes Arnaldo Carvalho de Melo
2013-11-11 20:22 ` [PATCH 01/10] perf ui tui progress: Don't force a refresh during progress update Arnaldo Carvalho de Melo
2013-11-11 20:22 ` [PATCH 02/10] perf evsel: Remove idx parm from constructor Arnaldo Carvalho de Melo
2013-11-11 20:22 ` [PATCH 03/10] perf record: Synthesize non-exec MMAP records when --data used Arnaldo Carvalho de Melo
2013-11-11 20:38   ` David Ahern
2013-11-11 21:02     ` Vince Weaver
2013-11-11 20:22 ` [PATCH 04/10] perf machine: Introduce synthesize_threads method out of open coded equivalent Arnaldo Carvalho de Melo
2013-11-11 20:40   ` David Ahern
2013-11-11 20:50     ` Ingo Molnar
2013-11-12 11:34       ` Arnaldo Carvalho de Melo
2013-11-12 12:44         ` Ingo Molnar
2013-11-12 21:57         ` [tip:perf/urgent] perf target: Shorten perf_target__ to target__ tip-bot for Arnaldo Carvalho de Melo
2014-01-12 18:33         ` [tip:perf/core] perf tools: Rename 'perf_record_opts' to ' record_opts tip-bot for Arnaldo Carvalho de Melo
2014-01-12 18:35         ` [tip:perf/core] perf report: Rename 'perf_report' to 'report' tip-bot for Arnaldo Carvalho de Melo
2013-11-11 20:22 ` [PATCH 05/10] perf machine: Simplify synthesize_threads method Arnaldo Carvalho de Melo
2013-11-11 20:22 ` Arnaldo Carvalho de Melo [this message]
2013-11-11 20:22 ` [PATCH 07/10] perf record: Use correct return type for write() Arnaldo Carvalho de Melo
2013-11-11 20:22 ` [PATCH 08/10] perf record: Move existing write_output into helper function Arnaldo Carvalho de Melo
2013-11-11 20:22 ` [PATCH 09/10] perf tests: Check return of perf_evlist__open sw clock event period test Arnaldo Carvalho de Melo
2013-11-11 20:22 ` [PATCH 10/10] perf tests: Use lower sample_freq in " Arnaldo Carvalho de Melo
2013-11-11 20:45   ` David Ahern
2013-11-12  7:07   ` Adrian Hunter
2013-11-12  8:40     ` Namhyung Kim
2013-11-12 11:59       ` Arnaldo Carvalho de Melo
2013-11-12 14:41     ` Arnaldo Carvalho de Melo
2013-11-15  6:03       ` Namhyung Kim
2013-11-12 21:56     ` [tip:perf/urgent] perf tests: Compensate lower sample freq with longer test loop tip-bot for Adrian Hunter

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=1384201353-23863-7-git-send-email-acme@infradead.org \
    --to=acme@infradead.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung.kim@lge.com \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.