[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211101151101.GA375622@leoy-ThinkPad-X240s>
Date: Mon, 1 Nov 2021 23:11:01 +0800
From: Leo Yan <leo.yan@...aro.org>
To: German Gomez <german.gomez@....com>
Cc: Namhyung Kim <namhyung@...nel.org>,
James Clark <james.clark@....com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Jiri Olsa <jolsa@...hat.com>, Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
LKML <linux-kernel@...r.kernel.org>,
Andi Kleen <ak@...ux.intel.com>,
Ian Rogers <irogers@...gle.com>,
Stephane Eranian <eranian@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>
Subject: Re: [RFC] perf arm-spe: Track task context switch for cpu-mode events
Hi German,
On Fri, Oct 29, 2021 at 11:51:16AM +0100, German Gomez wrote:
> Hi Leo,
>
> The current plan is to define a global flag in the `struct arm_spe` to
> select the method of pid tracing (context pkt, or switch events):
>
> struct arm_spe {
> /* ... */
> u8 use_ctx_pkt_for_pid;
> }
>
> The method could be determined by peeking at the top element of the
> `struct auxtrace_heap` at the beginning of the perf-report. If ctx
> packets have been collected, the first one should have a context_id !=
> -1. We could then tweak this part of Namhyung patch slightly:
Have one concern: if cannot find the context packet, will the decoder
drop the SPE packets until it find the first context packet? If this
is the case, I am concern the decoder will run out for all packets
and doesn't generate any samples if the SPE trace data doesn't contain
any context packet.
>
> if (!spe->use_ctx_pkt_for_pid &&
> (event->header.type == PERF_RECORD_SWITCH_CPU_WIDE ||
> event->header.type == PERF_RECORD_SWITCH))
> err = arm_spe_context_switch(spe, event, sample);
>
> Then we could apply patch [1] which wasn't fully merged in the end,
> including similar `if (spe->use_ctx_pkt_for_pid)` to collect the pid/tid
> from the context packets.
>
> What do you think?
Except the above concern, the solution looks good to me.
Thanks,
Leo
Powered by blists - more mailing lists