From: Veronika Molnarova <vmolnaro@redhat.com>
To: Michael Petlan <mpetlan@redhat.com>,
linux-perf-users@vger.kernel.org, irogers@google.com
Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
namhyung@kernel.org, mark.rutland@arm.com,
alexander.shishkin@linux.intel.com, jolsa@kernel.org,
adrian.hunter@intel.com, kan.liang@linux.intel.com
Subject: Re: [PATCH] perf trace: Keep exited threads for summary
Date: Mon, 30 Sep 2024 11:07:45 +0200 [thread overview]
Message-ID: <2ac467a9-065f-4da2-858c-04e72ce70b55@redhat.com> (raw)
In-Reply-To: <20240927151926.399474-1-mpetlan@redhat.com>
On 9/27/24 17:19, Michael Petlan wrote:
> Since 9ffa6c7512ca ("perf machine thread: Remove exited threads by
> default") perf cleans exited threads up, but as said, sometimes they
> are necessary to be kept. The mentioned commit does not cover all the
> cases, we also need the information to construct the summary table in
> perf-trace.
>
> Before:
> # perf trace -s true
>
> Summary of events:
>
> After:
> # perf trace -s -- true
>
> Summary of events:
>
> true (383382), 64 events, 91.4%
>
> syscall calls errors total min avg max stddev
> (msec) (msec) (msec) (msec) (%)
> --------------- -------- ------ -------- --------- --------- --------- ------
> mmap 8 0 0.150 0.013 0.019 0.031 11.90%
> mprotect 3 0 0.045 0.014 0.015 0.017 6.47%
> openat 2 0 0.014 0.006 0.007 0.007 9.73%
> munmap 1 0 0.009 0.009 0.009 0.009 0.00%
> access 1 1 0.009 0.009 0.009 0.009 0.00%
> pread64 4 0 0.006 0.001 0.001 0.002 4.53%
> fstat 2 0 0.005 0.001 0.002 0.003 37.59%
> arch_prctl 2 1 0.003 0.001 0.002 0.002 25.91%
> read 1 0 0.003 0.003 0.003 0.003 0.00%
> close 2 0 0.003 0.001 0.001 0.001 3.86%
> brk 1 0 0.002 0.002 0.002 0.002 0.00%
> rseq 1 0 0.001 0.001 0.001 0.001 0.00%
> prlimit64 1 0 0.001 0.001 0.001 0.001 0.00%
> set_robust_list 1 0 0.001 0.001 0.001 0.001 0.00%
> set_tid_address 1 0 0.001 0.001 0.001 0.001 0.00%
> execve 1 0 0.000 0.000 0.000 0.000 0.00%
>
> Fixes: 9ffa6c7512ca ("perf machine thread: Remove exited threads by default")
>
> Reported-by: Veronika Molnarova <vmolnaro@redhat.com>
> Signed-off-by: Michael Petlan <mpetlan@redhat.com>
The -S and -s option works after this patch, but --errno-summary ends with
segfault for some reason.
Before:
# perf trace --errno-summary -- true
Summary of events:
After:
# perf trace --errno-summary -- true
Summary of events:
true (11386), 60 events, 90.9%
syscall calls errors total min avg max stddev
(msec) (msec) (msec) (msec) (%)
--------------- -------- ------ -------- --------- --------- --------- ------
mmap 8 0 0.044 0.003 0.006 0.010 15.17%
mprotect 3 0 0.014 0.004 0.005 0.005 4.56%
openat 2 0 0.009 0.004 0.004 0.005 5.14%
munmap 1 0 0.007 0.007 0.007 0.007 0.00%
access 1 1 0.004 0.004 0.004 0.004 0.00%
perf: Segmentation fault
Obtained 12 stack frames.
./perf() [0x5ae123]
./perf() [0x5ae1cb]
/lib64/libc.so.6(+0x3dbb0) [0x7f633845fbb0]
./perf() [0x56e2fb]
./perf() [0x4850b3]
./perf() [0x48ee89]
./perf() [0x493042]
./perf() [0x49334b]
./perf() [0x40ee8c]
/lib64/libc.so.6(+0x27b8a) [0x7f6338449b8a]
/lib64/libc.so.6(__libc_start_main+0x8b) [0x7f6338449c4b]
./perf() [0x40f4b5]
Segmentation fault
Will try to check what is causing this issue.
Thanks,
Veronika
> ---
> tools/perf/builtin-trace.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
> index f6e847529073..1a12ed71c809 100644
> --- a/tools/perf/builtin-trace.c
> +++ b/tools/perf/builtin-trace.c
> @@ -5449,6 +5449,10 @@ int cmd_trace(int argc, const char **argv)
> if (trace.summary_only)
> trace.summary = trace.summary_only;
>
> + /* Keep exited threads, otherwise information might be lost for summary */
> + if (trace.summary || trace.summary_only)
> + symbol_conf.keep_exited_threads = true;
> +
> if (output_name != NULL) {
> err = trace__open_output(&trace, output_name);
> if (err < 0) {
next prev parent reply other threads:[~2024-09-30 9:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-27 15:19 [PATCH] perf trace: Keep exited threads for summary Michael Petlan
2024-09-30 6:55 ` Namhyung Kim
2024-09-30 9:07 ` Veronika Molnarova [this message]
2024-10-02 22:27 ` Namhyung Kim
2024-10-03 10:36 ` Michael Petlan
2024-10-04 19:29 ` Namhyung Kim
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=2ac467a9-065f-4da2-858c-04e72ce70b55@redhat.com \
--to=vmolnaro@redhat.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=mpetlan@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;
as well as URLs for NNTP newsgroup(s).