lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 14 Aug 2014 01:48:54 -0700
From:	tip-bot for Namhyung Kim <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	acme@...hat.com, linux-kernel@...r.kernel.org, paulus@...ba.org,
	hpa@...or.com, mingo@...nel.org, andi@...stfloor.org,
	a.p.zijlstra@...llo.nl, namhyung.kim@....com, namhyung@...nel.org,
	jolsa@...hat.com, fweisbec@...il.com, tglx@...utronix.de
Subject: [tip:perf/core] perf hists browser:
  Fix a small callchain display bug

Commit-ID:  82162b5ae3d152fd7d887b36213f5b6785fe1294
Gitweb:     http://git.kernel.org/tip/82162b5ae3d152fd7d887b36213f5b6785fe1294
Author:     Namhyung Kim <namhyung@...nel.org>
AuthorDate: Wed, 13 Aug 2014 15:02:41 +0900
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Wed, 13 Aug 2014 17:12:56 -0300

perf hists browser: Fix a small callchain display bug

The currently when perf TUI report shows callchain, the first level
chains have bogus '+' sign even though only the last one has children.

Since they are on a single line of the chain, toggling intermediate
entries has no effect.  Fix it to show '+' sign at the last entry only.
Note that non-first level callchain entries don't have this problem.

  Before:
  ---------------------------------------------------------------------------
    Children      Self  Command  Shared Object      Symbols
  -   40.70%     0.00%  swapper  [kernel.kallsyms]  [k] cpuidle_wrap_enter
     + cpuidle_wrap_enter
     + cpuidle_enter_tk
     + cpuidle_idle_call
     + cpu_idle

  After:
  ---------------------------------------------------------------------------
    Children      Self  Command  Shared Object      Symbols
  -   40.70%     0.00%  swapper  [kernel.kallsyms]  [k] cpuidle_wrap_enter
       cpuidle_wrap_enter
       cpuidle_enter_tk
       cpuidle_idle_call
     + cpu_idle

Signed-off-by: Namhyung Kim <namhyung@...nel.org>
Acked-by: Ingo Molnar <mingo@...nel.org>
Cc: Andi Kleen <andi@...stfloor.org>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Ingo Molnar <mingo@...nel.org>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Namhyung Kim <namhyung.kim@....com>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Link: http://lkml.kernel.org/r/1407909761-10822-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/ui/browsers/hists.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 045c1e1..1818d12 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -228,8 +228,10 @@ static void callchain_node__init_have_children(struct callchain_node *node)
 {
 	struct callchain_list *chain;
 
-	list_for_each_entry(chain, &node->val, list)
+	if (!list_empty(&node->val)) {
+		chain = list_entry(node->val.prev, struct callchain_list, list);
 		chain->ms.has_children = !RB_EMPTY_ROOT(&node->rb_root);
+	}
 
 	callchain_node__init_have_children_rb_tree(node);
 }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ