[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAP-5=fVwkXcKopw--chdtjsX1D0MnXOXYjqgi-xx0_Zxk6bC=A@mail.gmail.com>
Date: Fri, 1 Jul 2022 16:06:24 -0700
From: Ian Rogers <irogers@...gle.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Jiri Olsa <jolsa@...nel.org>, Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
LKML <linux-kernel@...r.kernel.org>,
linux-perf-users@...r.kernel.org
Subject: Re: [PATCH 2/2] perf tools: Ignore dead threads during event synthesis
On Fri, Jul 1, 2022 at 1:55 PM Namhyung Kim <namhyung@...nel.org> wrote:
>
> When it synthesize various task events, it scans the list of task
> first and then accesses later. There's a window threads can die
> between the two and proc entries may not be available.
>
> Instead of bailing out, we can ignore that thread and move on.
>
> Signed-off-by: Namhyung Kim <namhyung@...nel.org>
Acked-by: Ian Rogers <irogers@...gle.com>
Thanks,
Ian
> ---
> tools/perf/util/synthetic-events.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/util/synthetic-events.c b/tools/perf/util/synthetic-events.c
> index a068f42833c3..84d17bd4efae 100644
> --- a/tools/perf/util/synthetic-events.c
> +++ b/tools/perf/util/synthetic-events.c
> @@ -767,11 +767,12 @@ static int __event__synthesize_thread(union perf_event *comm_event,
> if (*end)
> continue;
>
> - rc = -1;
> + /* some threads may exit just after scan, ignore it */
> if (perf_event__prepare_comm(comm_event, pid, _pid, machine,
> &tgid, &ppid, &kernel_thread) != 0)
> - break;
> + continue;
>
> + rc = -1;
> if (perf_event__synthesize_fork(tool, fork_event, _pid, tgid,
> ppid, process, machine) < 0)
> break;
> --
> 2.37.0.rc0.161.g10f37bed90-goog
>
Powered by blists - more mailing lists