Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1344961

[tip:perf/core] perf hists: Fix dynamic entry display in hierarchy

From tip-bot for Namhyung Kim <tipbot@zytor.com>
Newsgroups linux.kernel
Subject [tip:perf/core] perf hists: Fix dynamic entry display in hierarchy
Date 2016-02-27 10:50 +0100
Message-ID <r6JFE-XE-11@gated-at.bofh.it> (permalink)
References <r6vMm-7w1-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Commit-ID:  e049d4a3fa194c8aa0d3ca29a9b11b32387ca6e3
Gitweb:     http://git.kernel.org/tip/e049d4a3fa194c8aa0d3ca29a9b11b32387ca6e3
Author:     Namhyung Kim <namhyung@kernel.org>
AuthorDate: Sat, 27 Feb 2016 03:52:46 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 26 Feb 2016 19:37:38 -0300

perf hists: Fix dynamic entry display in hierarchy

When dynamic sort key is used it might not show pretty printed output.
This is because the trace output was not set only for the first dynamic
sort key.  During hierarchy_insert_entry() it missed to pass the
trace_output to dynamic entries.  Also even if it did, only first entry
will have it.  Subsequent entries might set it during collapsing stage
but it's not guaranteed.

Before:

  $ perf report --hierarchy --stdio -s ptr,bytes_req,gfp_flags -g none
  #
  #       Overhead  ptr / bytes_req / gfp_flags
  # ..............  ..........................................
  #
      37.50%        0xffff8803f7669400
         37.50%        448
            37.50%        66080
      10.42%        0xffff8803f766be00
          8.33%        96
             8.33%        66080
          2.08%        512
             2.08%        67280

After:

  #
  #       Overhead  ptr / bytes_req / gfp_flags
  # ..............  ..........................................
  #
      37.50%        0xffff8803f7669400
         37.50%        448
            37.50%        GFP_ATOMIC|GFP_NOWARN|GFP_NOMEMALLOC
      10.42%        0xffff8803f766be00
          8.33%        96
             8.33%        GFP_ATOMIC|GFP_NOWARN|GFP_NOMEMALLOC
          2.08%        512
             2.08%        GFP_KERNEL|GFP_NOWARN|GFP_REPEAT|GFP

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1456512767-1164-4-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/hist.c | 2 +-
 tools/perf/util/sort.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index cc849d3..9b3f582 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -1125,7 +1125,7 @@ static struct hist_entry *hierarchy_insert_entry(struct hists *hists,
 	new->fmt = fmt;
 
 	/* some fields are now passed to 'new' */
-	if (perf_hpp__is_trace_entry(fmt))
+	if (perf_hpp__is_trace_entry(fmt) || perf_hpp__is_dynamic_entry(fmt))
 		he->trace_output = NULL;
 	else
 		new->trace_output = NULL;
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 2beb7a6..d26c6b9 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -1764,6 +1764,9 @@ static int __sort__hde_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,
 	if (hde->raw_trace)
 		goto raw_field;
 
+	if (!he->trace_output)
+		he->trace_output = get_trace_output(he);
+
 	field = hde->field;
 	namelen = strlen(field->name);
 	str = he->trace_output;

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH 4/5] perf report: Fix dynamic entry display in hierarchy Namhyung Kim <namhyung@kernel.org> - 2016-02-26 20:00 +0100
  Re: [PATCH 4/5] perf report: Fix dynamic entry display in hierarchy Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-26 22:50 +0100
    Re: [PATCH 4/5] perf report: Fix dynamic entry display in hierarchy Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-26 22:50 +0100
      Re: [PATCH 4/5] perf report: Fix dynamic entry display in hierarchy Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-26 23:10 +0100
        Re: [PATCH 4/5] perf report: Fix dynamic entry display in hierarchy Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-26 23:30 +0100
        Re: [PATCH 4/5] perf report: Fix dynamic entry display in hierarchy Steven Rostedt <rostedt@goodmis.org> - 2016-02-26 23:30 +0100
          Re: [PATCH 4/5] perf report: Fix dynamic entry display in hierarchy Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-26 23:40 +0100
            Re: [PATCH 4/5] perf report: Fix dynamic entry display in hierarchy Jiri Olsa <jolsa@redhat.com> - 2016-02-27 00:20 +0100
              Re: [PATCH 4/5] perf report: Fix dynamic entry display in hierarchy Jiri Olsa <jolsa@redhat.com> - 2016-02-27 00:20 +0100
        [PATCH] tools lib traceevent: Add '~' operation within  arg_num_eval() Steven Rostedt <rostedt@goodmis.org> - 2016-02-27 00:20 +0100
          Re: [PATCH] tools lib traceevent: Add '~' operation within  arg_num_eval() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-27 00:40 +0100
          Re: [PATCH] tools lib traceevent: Add '~' operation within  arg_num_eval() David Ahern <dsahern@gmail.com> - 2016-02-27 00:50 +0100
  [tip:perf/core] perf hists: Fix dynamic entry display in hierarchy tip-bot for Namhyung Kim <tipbot@zytor.com> - 2016-02-27 10:50 +0100

csiph-web