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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170906135501.306-9-milian.wolff@kdab.com>
Date:   Wed,  6 Sep 2017 15:54:56 +0200
From:   Milian Wolff <milian.wolff@...b.com>
To:     acme@...nel.org, jolsa@...nel.org,
        Jin Yao <yao.jin@...ux.intel.com>
Cc:     Linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
        Milian Wolff <milian.wolff@...b.com>,
        Arnaldo Carvalho de Melo <acme@...hat.com>,
        David Ahern <dsahern@...il.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: [PATCH v3 08/13] perf report: compare symbol name for inlined frames when sorting

Similar to the callstack frame matching, we also have to compare
the symbol name when sorting hist entries. The reason is twofold:
On one hand, multiple inlined functions will use the same symbol
start/end values of the parent, non-inlined symbol. As such, all
of these symbols often end up missing from top-level report, as
they get merged with the non-inlined frame. On the other hand,
multiple different functions may end up inlining the same function,
and we need to aggregate these values properly.

Before:

~~~~~
perf report --stdio --inline -g none
# Children      Self  Command       Shared Object     Symbol
# ........  ........  ............  ................  ...................................
#
   100.00%    39.69%  cpp-inlining  cpp-inlining      [.] main
   100.00%     0.00%  cpp-inlining  cpp-inlining      [.] _start
   100.00%     0.00%  cpp-inlining  libc-2.25.so      [.] __libc_start_main
    97.03%     0.00%  cpp-inlining  cpp-inlining      [.] std::norm<double> (inlined)
    59.53%     4.26%  cpp-inlining  libm-2.25.so      [.] hypot
    55.21%    55.08%  cpp-inlining  libm-2.25.so      [.] __hypot_finite
     0.52%     0.52%  cpp-inlining  libm-2.25.so      [.] cabs
~~~~~

After:

~~~~~
perf report --stdio --inline -g none
# Children      Self  Command       Shared Object     Symbol
# ........  ........  ............  ................  ...................................................................................................................................
#
   100.00%    39.69%  cpp-inlining  cpp-inlining      [.] main
   100.00%     0.00%  cpp-inlining  cpp-inlining      [.] _start
   100.00%     0.00%  cpp-inlining  libc-2.25.so      [.] __libc_start_main
    62.57%     0.00%  cpp-inlining  cpp-inlining      [.] std::_Norm_helper<true>::_S_do_it<double> (inlined)
    62.57%     0.00%  cpp-inlining  cpp-inlining      [.] std::__complex_abs (inlined)
    62.57%     0.00%  cpp-inlining  cpp-inlining      [.] std::abs<double> (inlined)
    62.57%     0.00%  cpp-inlining  cpp-inlining      [.] std::norm<double> (inlined)
    59.53%     4.26%  cpp-inlining  libm-2.25.so      [.] hypot
    55.21%    55.08%  cpp-inlining  libm-2.25.so      [.] __hypot_finite
    34.46%     0.00%  cpp-inlining  cpp-inlining      [.] std::uniform_real_distribution<double>::operator()<std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul> > (inlined)
    32.39%     0.00%  cpp-inlining  cpp-inlining      [.] std::__detail::_Adaptor<std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>, double>::operator() (inlined)
    32.39%     0.00%  cpp-inlining  cpp-inlining      [.] std::generate_canonical<double, 53ul, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul> > (inlined)
    12.29%     0.00%  cpp-inlining  cpp-inlining      [.] std::__detail::_Mod<unsigned long, 2147483647ul, 16807ul, 0ul, true, true>::__calc (inlined)
    12.29%     0.00%  cpp-inlining  cpp-inlining      [.] std::__detail::__mod<unsigned long, 2147483647ul, 16807ul, 0ul> (inlined)
    12.29%     0.00%  cpp-inlining  cpp-inlining      [.] std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>::operator() (inlined)
     0.52%     0.52%  cpp-inlining  libm-2.25.so      [.] cabs
~~~~~

Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Yao Jin <yao.jin@...ux.intel.com>
Signed-off-by: Milian Wolff <milian.wolff@...b.com>
---
 tools/perf/util/sort.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index acb9210fd18a..006d10a0dc96 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -225,6 +225,9 @@ static int64_t _sort__sym_cmp(struct symbol *sym_l, struct symbol *sym_r)
 	if (sym_l == sym_r)
 		return 0;
 
+	if (sym_l->inlined || sym_r->inlined)
+		return strcmp(sym_l->name, sym_r->name);
+
 	if (sym_l->start != sym_r->start)
 		return (int64_t)(sym_r->start - sym_l->start);
 
-- 
2.14.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ