aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util
diff options
context:
space:
mode:
authorLeo Yan <leo.yan@arm.com>2025-03-04 11:12:29 +0000
committerNamhyung Kim <namhyung@kernel.org>2025-03-05 09:13:19 -0800
commit2b747a86d84ff6c1c14c50494de74d1dc2aed427 (patch)
tree63453a43f12fcc7b8d3c38903df0a5279e7e0aca /tools/perf/util
parentperf stat: Fix non-uniquified hybrid legacy events (diff)
downloadlinux-2b747a86d84ff6c1c14c50494de74d1dc2aed427.tar.gz
linux-2b747a86d84ff6c1c14c50494de74d1dc2aed427.zip
perf script: Make printing flags reliable
Add a check for the generated string of flags. Print out the raw number if the string generation fails. Use the SAMPLE_FLAGS_STR_ALIGNED_SIZE macro to replace the value '21'. Reviewed-by: Ian Rogers <irogers@google.com> Reviewed-by: James Clark <james.clark@linaro.org> Signed-off-by: Leo Yan <leo.yan@arm.com> Reviewed-by: Adrian Hunter <adrian.hunter@intel.com> Link: https://lore.kernel.org/r/20250304111240.3378214-2-leo.yan@arm.com Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/util')
-rw-r--r--tools/perf/util/trace-event.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h
index ac9fde2f980c..71e680bc3d4b 100644
--- a/tools/perf/util/trace-event.h
+++ b/tools/perf/util/trace-event.h
@@ -145,6 +145,8 @@ int common_flags(struct scripting_context *context);
int common_lock_depth(struct scripting_context *context);
#define SAMPLE_FLAGS_BUF_SIZE 64
+#define SAMPLE_FLAGS_STR_ALIGNED_SIZE 21
+
int perf_sample__sprintf_flags(u32 flags, char *str, size_t sz);
#if defined(LIBTRACEEVENT_VERSION) && LIBTRACEEVENT_VERSION >= MAKE_LIBTRACEEVENT_VERSION(1, 5, 0)