aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/event_analyzing_sample.py
diff options
context:
space:
mode:
authorShyam Sundar S K <[email protected]>2023-10-10 20:20:02 +0530
committerIlpo Järvinen <[email protected]>2023-10-12 16:55:31 +0300
commitb136225746a9793bdff9c78b215eac4f64bf21f2 (patch)
tree39958d52fbbe113db07d097179e7984751b5c5c6 /tools/perf/scripts/python/event_analyzing_sample.py
parentd9f421da6b9287000f8253628d54cf89b0c14da5 (diff)
platform/x86/amd/pmc: Handle overflow cases where the num_samples range is higher
In amd_pmc_stb_debugfs_open_v2(), the stb buffer is created based on the num_samples and the read/write pointer offset. This holds good when the num_samples reported by PMFW is less than S2D_TELEMETRY_BYTES_MAX; where the stb buffer gets filled from 0th position until S2D_TELEMETRY_BYTES_MAX - 1 based on the read/write pointer offset. But when the num_samples exceeds the S2D_TELEMETRY_BYTES_MAX, the current code does not handle it well as it does not account for the cases where the stb buffer has to filled up as a circular buffer. Handle this scenario into two cases, where first memcpy will have the samples from location: (num_samples % S2D_TELEMETRY_BYTES_MAX) - (S2D_TELEMETRY_BYTES_MAX - 1) and next memcpy will have the newest ones i.e. 0 - (num_samples % S2D_TELEMETRY_BYTES_MAX - 1) Suggested-by: Hans de Goede <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Sanket Goswami <[email protected]> Signed-off-by: Shyam Sundar S K <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ij: renamed flex_arr -> stb_data_arr] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/event_analyzing_sample.py')
0 files changed, 0 insertions, 0 deletions