Loading
perf/core: Save raw sample data conditionally based on sample type
stable inclusion from stable-v6.6.76 commit c0dbecb204cfb91999d0b785048be4a95bbc8c9c category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IBQXZY Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c0dbecb204cfb91999d0b785048be4a95bbc8c9c -------------------------------- [ Upstream commit b9c44b91476b67327a521568a854babecc4070ab ] 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:Yabin Cui <yabinc@google.com> Signed-off-by:
Ingo Molnar <mingo@kernel.org> Reviewed-by:
Ian Rogers <irogers@google.com> Acked-by:
Namhyung Kim <namhyung@kernel.org> Link: https://lore.kernel.org/r/20240515193610.2350456-2-yabinc@google.com Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Luo Gengkun <luogengkun2@huawei.com>