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: <1532086.vKWRnURGfG@agathebauer>
Date:   Sat, 18 Mar 2017 17:41:09 +0100
From:   Milian Wolff <milian.wolff@...b.com>
To:     Jin Yao <yao.jin@...ux.intel.com>
Cc:     acme@...nel.org, jolsa@...nel.org, Linux-kernel@...r.kernel.org,
        ak@...ux.intel.com, kan.liang@...el.com, yao.jin@...el.com
Subject: Re: [PATCH v5 0/5] perf report: Show inline stack

On Donnerstag, 16. März 2017 22:42:22 CET Jin Yao wrote:
> v5: Update according to Milian Wolff's comments. It groups by address
>     (then display file/ line), or by function (then display function name).

Thank you Jin, that is really good. I tested it and it works really well for 
me.

Arnaldo, could you please consider merging this? It's an extremely useful 
feature and direly missing from perf so far.

That said, Jin, here are some observations that could be improved in the 
future (I don't think any of these should hold back merging this feature now):

For the following example code build with "-O2 -g" and recorded with "--call-
graph dwarf" I observe some output combinations that could potentially be 
improved in the future:

~~~~~~~~~~~~~~~~~~~~
#include <complex>
#include <cmath>
#include <random>
#include <iostream>

using namespace std;

int main()
{
    uniform_real_distribution<double> uniform(-1E5, 1E5);
    default_random_engine engine;
    double s = 0;
    for (int i = 0; i < 10000000; ++i) {
        s += norm(complex<double>(uniform(engine), uniform(engine)));
    }
    cout << s << '\n';
    return 0;
}
~~~~~~~~~~~~~~~~

#1 duplicated entries when grouping by function:

~~~~~~~~~~~~~~~~
perf report --inline --stdio
...
             --35.34%--_start
                       __libc_start_main
                       main
                       main (inline)
                       std::uniform_real_distribution<double>::operator()<std::linear_congruential_engine<unsigned 
long, 16807ul, 0ul, 2147483647ul> > (inline)
                       std::uniform_real_distribution<double>::operator()<std::linear_congruential_engine<unsigned 
long, 16807ul, 0ul, 2147483647ul> > (inline)
                       std::__detail::_Adaptor<std::linear_congruential_engine<unsigned 
long, 16807ul, 0ul, 2147483647ul>, double>::operator() (inline)
~~~~~~~~~~~~~~~~

Here, we see main twice, once for the "real" frame, and once for an inlined 
one? Then we see the same function twice as inlined frame, which is also odd.

~~~~~~~~~~~~~~~~
perf report --inline --stdio --no-children
...
    59.81%  cpp-inlining  libm-2.25.so      [.] __hypot_finite
            |
            ---__hypot_finite
               hypot
               main
               std::norm<double> (inline)
               main (inline)
               __libc_start_main
               _start
~~~~~~~~~~~~~~~~

Here we see a confusing output. The first "main" frame below "hypot" is 
actually code form cpp's complex header which got inlined into main. That 
associates the wrong function name to this frame, i.e. "main" instead of 
std::norm". When the inline stack is shown below we actually see what happens, 
i.e. we eventually end up in main again, but of course this output is not the 
best as-is.

But, again: I think these are minor issues, and the feature itself is already 
extremely useful and I hope to see it finally merged.

Thanks again Jin for your good work!

Cheers

-- 
Milian Wolff | milian.wolff@...b.com | Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt Experts
Download attachment "smime.p7s" of type "application/pkcs7-signature" (5903 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ