public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf tools: Prevent condition that all sort keys are elided
@ 2013-11-08  8:53 Namhyung Kim
  2013-11-11 11:20 ` Ingo Molnar
  2013-11-12 21:55 ` [tip:perf/urgent] " tip-bot for Namhyung Kim
  0 siblings, 2 replies; 4+ messages in thread
From: Namhyung Kim @ 2013-11-08  8:53 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, Namhyung Kim, LKML

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>
---
 tools/perf/util/sort.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 3c1b75c8b9a6..fb7d556ad721 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,14 @@ 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.7.11.7


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf tools: Prevent condition that all sort keys are elided
  2013-11-08  8:53 [PATCH] perf tools: Prevent condition that all sort keys are elided Namhyung Kim
@ 2013-11-11 11:20 ` Ingo Molnar
  2013-11-12  7:14   ` Namhyung Kim
  2013-11-12 21:55 ` [tip:perf/urgent] " tip-bot for Namhyung Kim
  1 sibling, 1 reply; 4+ messages in thread
From: Ingo Molnar @ 2013-11-11 11:20 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Arnaldo Carvalho de Melo, Peter Zijlstra, Paul Mackerras,
	Namhyung Kim, LKML


* Namhyung Kim <namhyung@kernel.org> wrote:

> 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>
> ---
>  tools/perf/util/sort.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
> index 3c1b75c8b9a6..fb7d556ad721 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,14 @@ 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;

(Nit: please use curly braces around multi-line statements.)

> +
> +	list_for_each_entry(se, &hist_entry__sort_list, list)
> +		se->elide = false;

Looks good otherwise - this is the first step in the sort/key behavior 
improvements that we talked about a few days ago, right?

Acked-by: Ingo Molnar <mingo@kernel.org>

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf tools: Prevent condition that all sort keys are elided
  2013-11-11 11:20 ` Ingo Molnar
@ 2013-11-12  7:14   ` Namhyung Kim
  0 siblings, 0 replies; 4+ messages in thread
From: Namhyung Kim @ 2013-11-12  7:14 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Arnaldo Carvalho de Melo, Peter Zijlstra, Paul Mackerras,
	Namhyung Kim, LKML

Hi Ingo,

On Mon, 11 Nov 2013 12:20:13 +0100, Ingo Molnar wrote:
> * Namhyung Kim <namhyung@kernel.org> wrote:
>> +	/*
>> +	 * 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;
>
> (Nit: please use curly braces around multi-line statements.)

Ah, okay.

>
>> +
>> +	list_for_each_entry(se, &hist_entry__sort_list, list)
>> +		se->elide = false;
>
> Looks good otherwise - this is the first step in the sort/key behavior 
> improvements that we talked about a few days ago, right?

Right.  And I'd like to wait bit more to hear other's opinion on this.

>
> Acked-by: Ingo Molnar <mingo@kernel.org>

Thanks,
Namhyung

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [tip:perf/urgent] perf tools: Prevent condition that all sort keys are elided
  2013-11-08  8:53 [PATCH] perf tools: Prevent condition that all sort keys are elided Namhyung Kim
  2013-11-11 11:20 ` Ingo Molnar
@ 2013-11-12 21:55 ` tip-bot for Namhyung Kim
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Namhyung Kim @ 2013-11-12 21:55 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, paulus, hpa, mingo, a.p.zijlstra,
	namhyung.kim, namhyung, tglx

Commit-ID:  7524f63b997cc02a80aa073558728ae3ee242cf8
Gitweb:     http://git.kernel.org/tip/7524f63b997cc02a80aa073558728ae3ee242cf8
Author:     Namhyung Kim <namhyung.kim@lge.com>
AuthorDate: Fri, 8 Nov 2013 17:53:42 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 11 Nov 2013 15:56:40 -0300

perf tools: Prevent condition that all sort keys are elided

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 3c1b75c..8b0bb1f 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;
 }

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-11-12 21:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-08  8:53 [PATCH] perf tools: Prevent condition that all sort keys are elided Namhyung Kim
2013-11-11 11:20 ` Ingo Molnar
2013-11-12  7:14   ` Namhyung Kim
2013-11-12 21:55 ` [tip:perf/urgent] " tip-bot for Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox