mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 04:18:39 +08:00
perf intel-pt: Fix aux_watermark calculation for 64-bit size
[ Upstream commit36b4cd990a
] aux_watermark is a u32. For a 64-bit size, cap the aux_watermark calculation at UINT_MAX instead of truncating it to 32-bits. Fixes:874fc35cdd
("perf intel-pt: Use aux_watermark") Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Link: https://lore.kernel.org/r/20240625104532.11990-2-adrian.hunter@intel.com Signed-off-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
b7182f73d7
commit
f44c448bfb
@ -758,7 +758,8 @@ static int intel_pt_recording_options(struct auxtrace_record *itr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!opts->auxtrace_snapshot_mode && !opts->auxtrace_sample_mode) {
|
if (!opts->auxtrace_snapshot_mode && !opts->auxtrace_sample_mode) {
|
||||||
u32 aux_watermark = opts->auxtrace_mmap_pages * page_size / 4;
|
size_t aw = opts->auxtrace_mmap_pages * (size_t)page_size / 4;
|
||||||
|
u32 aux_watermark = aw > UINT_MAX ? UINT_MAX : aw;
|
||||||
|
|
||||||
intel_pt_evsel->core.attr.aux_watermark = aux_watermark;
|
intel_pt_evsel->core.attr.aux_watermark = aux_watermark;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user