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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201215135849.GD252952@kernel.org>
Date:   Tue, 15 Dec 2020 10:58:49 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Andi Kleen <ak@...ux.intel.com>
Cc:     Alexander Antonov <alexander.antonov@...ux.intel.com>,
        linux-kernel@...r.kernel.org, jolsa@...hat.com,
        alexander.shishkin@...ux.intel.com, mark.rutland@....com,
        namhyung@...nel.org, mingo@...hat.com, peterz@...radead.org,
        Ian Rogers <irogers@...gle.com>
Subject: Re: [PATCH 0/5] perf stat: Introduce --iiostat mode to provide I/O
 performance metrics

Em Mon, Dec 14, 2020 at 07:04:30PM -0800, Andi Kleen escreveu:
> > My first thought was: Why not have a 'perf iiostat' subcommand?
 
> Same would apply to a lot of options in perf stat.
 
> I guess you could add some aliases to "perf" that give shortcuts
> for common perf stat command lines.

Yeah, and we have a mechanism for that, that was exercised only in the
'perf archive' case:

~/libexec/perf-core/perf-archive

I tried this and it works:

[root@...e ~]# ls -la ~/bin/perf
lrwxrwxrwx. 1 root root 19 Feb 18  2020 /root/bin/perf -> /home/acme/bin/perf
[root@...e ~]# vim ~acme/libexec/perf-core/perf-cgtop
[root@...e ~]# chmod +x ~acme/libexec/perf-core/perf-cgtop
[root@...e ~]# cat ~acme/libexec/perf-core/perf-cgtop
perf top --hierarchy --all-cgroups -s cgroup,dso,sym $*
[root@...e ~]# perf cgtop
[root@...e ~]#

use 'e' to expand collapse the current level (+ -> -), 'E'/'C' to
expand/collapse all levels.

'perf help' doesn't show it, which is a shame, I'll add support for it
to traverse ~/libexec/perf-core/perf-* and get the first non interpreter
comment line as a description for the command, so to add a new one is
just a matter of dropping a shell + man page, no need to change the perf
binary.


To test that '$*' at the end:

[root@...e ~]# perf cgtop -U

I.e.:

[acme@...e perf]$ perf top -h -U

 Usage: perf top [<options>]

    -U, --hide_user_symbols
                          hide user symbols

[acme@...e perf]$

And it works, just kernel level samples grouped in an hierarchy, first
cgroup, then dso, then the symbol.

Also, using this with the 'P' hotkey:

[root@...e ~]# perf cgtop --percent-limit 1

Shows how it looks like:

[root@...e ~]# cat perf.hist.0 
-  86.77%        /user.slice/user-1000.slice/session-2.scope
   -  36.18%        [kernel]
          2.24%        [k] unmap_page_range
          1.15%        [k] clear_page_rep
          1.10%        [k] add_mm_counter_fast
          1.03%        [k] alloc_set_pte
          1.03%        [k] handle_mm_fault
   -  17.65%        libc-2.32.so
          2.04%        [.] _int_malloc
          1.82%        [.] __memmove_avx_unaligned_erms
          1.48%        [.] __strlen_avx2
          1.13%        [.] _int_free
          1.12%        [.] malloc
   -   8.09%        make
          1.65%        [.] jhash_string
          1.05%        [.] hash_find_slot
   -   6.90%        ld-2.32.so
          2.03%        [.] do_lookup_x
          1.49%        [.] _dl_lookup_symbol_x
   -   4.78%        cc1
   -   4.60%        libperl.so.5.32.0
   -   2.86%        bash
   -   1.98%        libselinux.so.1
   -   1.61%        libpython2.7.so.1.0
   -   1.06%        libpcre2-8.so.0.10.0
-   9.17%        /user.slice/user-1000.slice/session-4.scope
   -   4.66%        perf
   -   2.40%        libc-2.32.so
   -   1.82%        [kernel]
-   4.04%        /
   -   4.02%        [kernel]
[root@...e ~]#

So 'perf iiostat' would become:

[root@...e ~]# cat ~acme/libexec/perf-core/perf-iiostat
perf stat --iiostat $*
[root@...e ~]#

There are parameters to that '--iiostat' in the current patchset that
may complicates this tho, with some changes I guess we get what we want.

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ