]> www.infradead.org Git - users/jedix/linux-maple.git/commit
perf script: Refactor sample_flags_to_name() function
authorLeo Yan <leo.yan@arm.com>
Tue, 4 Mar 2025 11:12:30 +0000 (11:12 +0000)
committerNamhyung Kim <namhyung@kernel.org>
Wed, 5 Mar 2025 17:13:19 +0000 (09:13 -0800)
commit4d5981889745b8f4d2012ec71f04bca68b863764
tree25e2a4dcdd900d352962353e54a0f1e046f2024c
parent2b747a86d84ff6c1c14c50494de74d1dc2aed427
perf script: Refactor sample_flags_to_name() function

When generating a string for sample flags, the sample_flags_to_name()
function lacks the ability to parse the trace start bit or trace end bit.
Therefore, the function is invoked multiple times after clearing its
unsupported bits.

This commit improves the sample_flags_to_name() function to parse sample
flags in one go for three kinds of information:
- The prefix info for trace start, trace end, etc.
- Branch types.
- Extra info for transaction and interrupt related info.

As a result, the code is simplified to call the sample_flags_to_name()
only once.  No expectation for any changes in the perf script output.

Reviewed-by: Ian Rogers <irogers@google.com>
Reviewed-by: James Clark <james.clark@linaro.org>
Signed-off-by: Leo Yan <leo.yan@arm.com>
Link: https://lore.kernel.org/r/20250304111240.3378214-3-leo.yan@arm.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/util/event.h
tools/perf/util/trace-event-scripting.c