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]
Message-ID: <20190821065844.GA11701@krava>
Date:   Wed, 21 Aug 2019 08:58:44 +0200
From:   Jiri Olsa <jolsa@...hat.com>
To:     Jin Yao <yao.jin@...ux.intel.com>
Cc:     acme@...nel.org, jolsa@...nel.org, peterz@...radead.org,
        mingo@...hat.com, alexander.shishkin@...ux.intel.com,
        Linux-kernel@...r.kernel.org, ak@...ux.intel.com,
        kan.liang@...el.com, yao.jin@...el.com
Subject: Re: [PATCH v6] perf diff: Report noisy for cycles diff

On Tue, Aug 20, 2019 at 08:22:07PM +0800, Jin Yao wrote:
> This patch prints the stddev and hist for the cycles diff of
> program block. It can help us to understand if the cycles
> is noisy or not.
> 
> This patch is inspired by Andi Kleen's patch
> https://lwn.net/Articles/600471/
> 
> We create new option '--cycles-hist'.
> 
> Example:
> 
> perf record -b ./div
> perf record -b ./div
> perf diff -c cycles
> 
>   # Baseline                                       [Program Block Range] Cycles Diff  Shared Object      Symbol
>   # ........  ......................................................................  .................  ............................
>   #
>       46.72%                                             [div.c:40 -> div.c:40]    0  div                [.] main
>       46.72%                                             [div.c:42 -> div.c:44]    0  div                [.] main
>       46.72%                                             [div.c:42 -> div.c:39]    0  div                [.] main
>       20.54%                                 [random_r.c:357 -> random_r.c:394]    1  libc-2.27.so       [.] __random_r
>       20.54%                                 [random_r.c:357 -> random_r.c:380]    0  libc-2.27.so       [.] __random_r
>       20.54%                                 [random_r.c:388 -> random_r.c:388]    0  libc-2.27.so       [.] __random_r
>       20.54%                                 [random_r.c:388 -> random_r.c:391]    0  libc-2.27.so       [.] __random_r
>       17.04%                                     [random.c:288 -> random.c:291]    0  libc-2.27.so       [.] __random
>       17.04%                                     [random.c:291 -> random.c:291]    0  libc-2.27.so       [.] __random
>       17.04%                                     [random.c:293 -> random.c:293]    0  libc-2.27.so       [.] __random
>       17.04%                                     [random.c:295 -> random.c:295]    0  libc-2.27.so       [.] __random
>       17.04%                                     [random.c:295 -> random.c:295]    0  libc-2.27.so       [.] __random
>       17.04%                                     [random.c:298 -> random.c:298]    0  libc-2.27.so       [.] __random
>        8.40%                                             [div.c:22 -> div.c:25]    0  div                [.] compute_flag
>        8.40%                                             [div.c:27 -> div.c:28]    0  div                [.] compute_flag
>        5.14%                                           [rand.c:26 -> rand.c:27]    0  libc-2.27.so       [.] rand
>        5.14%                                           [rand.c:28 -> rand.c:28]    0  libc-2.27.so       [.] rand
>        2.15%                                         [rand@...+0 -> rand@...+0]    0  div                [.] rand@plt
>        0.00%                                                                          [kernel.kallsyms]  [k] __x86_indirect_thunk_rax
>        0.00%                                       [do_mmap+714 -> do_mmap+732]  -10  [kernel.kallsyms]  [k] do_mmap
>        0.00%                                       [do_mmap+737 -> do_mmap+765]    1  [kernel.kallsyms]  [k] do_mmap
>        0.00%                                       [do_mmap+262 -> do_mmap+299]    0  [kernel.kallsyms]  [k] do_mmap
>        0.00%         [__x86_indirect_thunk_r15+0 -> __x86_indirect_thunk_r15+0]    7  [kernel.kallsyms]  [k] __x86_indirect_thunk_r15
>        0.00%                   [native_sched_clock+0 -> native_sched_clock+119]   -1  [kernel.kallsyms]  [k] native_sched_clock
>        0.00%                        [native_write_msr+0 -> native_write_msr+16]  -13  [kernel.kallsyms]  [k] native_write_msr
> 
> When we enable the option '--cycles-hist', the output is
> 
> perf diff -c cycles --cycles-hist
> 
>   # Baseline                                       [Program Block Range] Cycles Diff        stddev/Hist  Shared Object      Symbol
>   # ........  ......................................................................  .................  .................  ............................
>   #
>       46.72%                                             [div.c:40 -> div.c:40]    0  ± 37.8% ▁█▁▁██▁█   div                [.] main
>       46.72%                                             [div.c:42 -> div.c:44]    0  ± 49.4% ▁▁▂█▂▂▂▂   div                [.] main
>       46.72%                                             [div.c:42 -> div.c:39]    0  ± 24.1% ▃█▂▄▁▃▂▁   div                [.] main
>       20.54%                                 [random_r.c:357 -> random_r.c:394]    1  ± 33.5% ▅▂▁█▃▁▂▁   libc-2.27.so       [.] __random_r
>       20.54%                                 [random_r.c:357 -> random_r.c:380]    0  ± 39.4% ▁▁█▁██▅▁   libc-2.27.so       [.] __random_r
>       20.54%                                 [random_r.c:388 -> random_r.c:388]    0                     libc-2.27.so       [.] __random_r
>       20.54%                                 [random_r.c:388 -> random_r.c:391]    0  ± 41.2% ▁▃▁▂█▄▃▁   libc-2.27.so       [.] __random_r
>       17.04%                                     [random.c:288 -> random.c:291]    0  ± 48.8% ▁▁▁▁███▁   libc-2.27.so       [.] __random
>       17.04%                                     [random.c:291 -> random.c:291]    0  ±100.0% ▁█▁▁▁▁▁▁   libc-2.27.so       [.] __random
>       17.04%                                     [random.c:293 -> random.c:293]    0  ±100.0% ▁█▁▁▁▁▁▁   libc-2.27.so       [.] __random
>       17.04%                                     [random.c:295 -> random.c:295]    0  ±100.0% ▁█▁▁▁▁▁▁   libc-2.27.so       [.] __random
>       17.04%                                     [random.c:295 -> random.c:295]    0                     libc-2.27.so       [.] __random
>       17.04%                                     [random.c:298 -> random.c:298]    0  ± 75.6% ▃█▁▁▁▁▁▁   libc-2.27.so       [.] __random
>        8.40%                                             [div.c:22 -> div.c:25]    0  ± 42.1% ▁▃▁▁███▁   div                [.] compute_flag
>        8.40%                                             [div.c:27 -> div.c:28]    0  ± 41.8% ██▁▁▄▁▁▄   div                [.] compute_flag
>        5.14%                                           [rand.c:26 -> rand.c:27]    0  ± 37.8% ▁▁▁████▁   libc-2.27.so       [.] rand
>        5.14%                                           [rand.c:28 -> rand.c:28]    0                     libc-2.27.so       [.] rand
>        2.15%                                         [rand@...+0 -> rand@...+0]    0                     div                [.] rand@plt
>        0.00%                                                                                             [kernel.kallsyms]  [k] __x86_indirect_thunk_rax
>        0.00%                                       [do_mmap+714 -> do_mmap+732]  -10                     [kernel.kallsyms]  [k] do_mmap
>        0.00%                                       [do_mmap+737 -> do_mmap+765]    1                     [kernel.kallsyms]  [k] do_mmap
>        0.00%                                       [do_mmap+262 -> do_mmap+299]    0                     [kernel.kallsyms]  [k] do_mmap
>        0.00%         [__x86_indirect_thunk_r15+0 -> __x86_indirect_thunk_r15+0]    7                     [kernel.kallsyms]  [k] __x86_indirect_thunk_r15
>        0.00%                   [native_sched_clock+0 -> native_sched_clock+119]   -1  ± 38.5% ▄█▁        [kernel.kallsyms]  [k] native_sched_clock
>        0.00%                        [native_write_msr+0 -> native_write_msr+16]  -13  ± 47.1% ▁█▇▃▁▁     [kernel.kallsyms]  [k] native_write_msr
> 
>  v6:
>  ---
>  1. Jiri provides better code for using data__hpp_register() in ui_init().
>     Use this code in v6.

Reviewed-by: Jiri Olsa <jolsa@...nel.org>

thanks,
jirka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ