From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Andi Kleen <ak@linux.intel.com>
Cc: Alexander Antonov <alexander.antonov@linux.intel.com>,
linux-kernel@vger.kernel.org, jolsa@redhat.com,
alexander.shishkin@linux.intel.com, mark.rutland@arm.com,
namhyung@kernel.org, mingo@redhat.com, peterz@infradead.org,
Ian Rogers <irogers@google.com>
Subject: Re: [PATCH 0/5] perf stat: Introduce --iiostat mode to provide I/O performance metrics
Date: Tue, 15 Dec 2020 10:58:49 -0300 [thread overview]
Message-ID: <20201215135849.GD252952@kernel.org> (raw)
In-Reply-To: <20201215030430.GA1538637@tassilo.jf.intel.com>
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@five ~]# ls -la ~/bin/perf
lrwxrwxrwx. 1 root root 19 Feb 18 2020 /root/bin/perf -> /home/acme/bin/perf
[root@five ~]# vim ~acme/libexec/perf-core/perf-cgtop
[root@five ~]# chmod +x ~acme/libexec/perf-core/perf-cgtop
[root@five ~]# cat ~acme/libexec/perf-core/perf-cgtop
perf top --hierarchy --all-cgroups -s cgroup,dso,sym $*
[root@five ~]# perf cgtop
[root@five ~]#
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@five ~]# perf cgtop -U
I.e.:
[acme@five perf]$ perf top -h -U
Usage: perf top [<options>]
-U, --hide_user_symbols
hide user symbols
[acme@five 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@five ~]# perf cgtop --percent-limit 1
Shows how it looks like:
[root@five ~]# 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@five ~]#
So 'perf iiostat' would become:
[root@five ~]# cat ~acme/libexec/perf-core/perf-iiostat
perf stat --iiostat $*
[root@five ~]#
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
next prev parent reply other threads:[~2020-12-15 13:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-10 9:03 [PATCH 0/5] perf stat: Introduce --iiostat mode to provide I/O performance metrics Alexander Antonov
2020-12-10 9:03 ` [PATCH 1/5] perf stat: Add AGGR_IIO_STACK mode Alexander Antonov
2020-12-10 9:03 ` [PATCH 2/5] perf evsel: Introduce an observed performance device Alexander Antonov
2020-12-10 9:03 ` [PATCH 3/5] perf stat: Basic support for iiostat in perf stat Alexander Antonov
2020-12-10 9:03 ` [PATCH 4/5] perf stat: Helper functions for IIO stacks list in iiostat mode Alexander Antonov
2020-12-10 9:03 ` [PATCH 5/5] perf stat: Enable --iiostat mode for x86 platforms Alexander Antonov
2020-12-14 13:28 ` [PATCH 0/5] perf stat: Introduce --iiostat mode to provide I/O performance metrics Arnaldo Carvalho de Melo
2020-12-15 3:04 ` Andi Kleen
2020-12-15 13:58 ` Arnaldo Carvalho de Melo [this message]
2020-12-20 17:23 ` Alexander Antonov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201215135849.GD252952@kernel.org \
--to=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=alexander.antonov@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=irogers@google.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox