Re: [PATCH] perf evsel: fix buffer offset when building the EPERM error string
From: Namhyung Kim
Date: Mon Nov 09 2026 - 21:58:25 EST
On Wed, 04 Nov 2026 18:36:05 +0800, Gu Bin wrote:
> When building the EPERM error string, the scnprintf() that emits "No
> permission to enable %s event" uses (msg, size) instead of (msg +
> printed, size - printed) like every other line in this case, overwriting
> the "Access to performance monitoring..." preamble and truncating the
> following hint. The message shown to the user for a failed open with
> EPERM is therefore garbled: the preamble is lost and stale bytes from
> the overwritten content remain in the buffer.
>
> [...]
Applied to perf-tools-next, thanks!
Best regards,
Namhyung