Commit c0dbecb2 authored by Yabin Cui's avatar Yabin Cui Committed by Greg Kroah-Hartman
Browse files

perf/core: Save raw sample data conditionally based on sample type



[ Upstream commit b9c44b91 ]

Currently, space for raw sample data is always allocated within sample
records for both BPF output and tracepoint events. This leads to unused
space in sample records when raw sample data is not requested.

This patch enforces checking sample type of an event in
perf_sample_save_raw_data(). So raw sample data will only be saved if
explicitly requested, reducing overhead when it is not needed.

Fixes: 0a9081cf ("perf/core: Add perf_sample_save_raw_data() helper")
Signed-off-by: default avatarYabin Cui <yabinc@google.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Reviewed-by: default avatarIan Rogers <irogers@google.com>
Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240515193610.2350456-2-yabinc@google.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent c89b19e9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment