From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Gang Li <ligang.bdlg@bytedance.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RESEND PATCH v1] perf stat: Enable ignore_missing_thread for stat
Date: Thu, 23 Jun 2022 11:49:42 -0300 [thread overview]
Message-ID: <YrR9hljHVltIe0aW@kernel.org> (raw)
In-Reply-To: <20220622030037.15005-1-ligang.bdlg@bytedance.com>
Em Wed, Jun 22, 2022 at 11:00:37AM +0800, Gang Li escreveu:
> perf already support ignore_missing_thread for -p, but not yet
> applied to `perf stat -p <pid>`. This patch enables ignore_missing_thread
> for `perf stat -p <pid>`.
Thanks, will add it and stick the original explanation about
ignore_missing_thread so that reviewers of this patch can get a
refresher:
From ca8000684ec4e66f965e1f9547a3c6cb834154ca
----------
While monitoring a multithread process with pid option, perf sometimes
may return sys_perf_event_open failure with 3(No such process) if any of
the process's threads die before we open the event. However, we want
perf continue monitoring the remaining threads and do not exit with
error.
----------
Thanks,
- Arnaldo
> Signed-off-by: Gang Li <ligang.bdlg@bytedance.com>
> ---
> tools/perf/builtin-stat.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
> index 4ce87a8eb7d7..d2ecd4d29624 100644
> --- a/tools/perf/builtin-stat.c
> +++ b/tools/perf/builtin-stat.c
> @@ -2586,6 +2586,8 @@ int cmd_stat(int argc, const char **argv)
> if (evlist__initialize_ctlfd(evsel_list, stat_config.ctl_fd, stat_config.ctl_fd_ack))
> goto out;
>
> + /* Enable ignoring missing threads when -p option is defined. */
> + evlist__first(evsel_list)->ignore_missing_thread = target.pid;
> status = 0;
> for (run_idx = 0; forever || run_idx < stat_config.run_count; run_idx++) {
> if (stat_config.run_count != 1 && verbose > 0)
> --
> 2.20.1
--
- Arnaldo
prev parent reply other threads:[~2022-06-23 14:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-22 3:00 [RESEND PATCH v1] perf stat: Enable ignore_missing_thread for stat Gang Li
2022-06-23 14:49 ` Arnaldo Carvalho de Melo [this message]
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=YrR9hljHVltIe0aW@kernel.org \
--to=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=jolsa@kernel.org \
--cc=ligang.bdlg@bytedance.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@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;
as well as URLs for NNTP newsgroup(s).