Skip to content

Commit c17dda8

Browse files
Leo-Yanacmel
authored andcommitted
perf session: Fix handling when buffer exceeds 2 GiB
If a user specifies an AUX buffer larger than 2 GiB, the returned size may exceed 0x80000000. Since the err variable is defined as a signed 32-bit integer, such a value overflows and becomes negative. As a result, the perf record command reports an error: 0x146e8 [0x30]: failed to process type: 71 [Unknown error 183711232] Change the type of the err variable to a signed 64-bit integer to accommodate large buffer sizes correctly. Fixes: d5652d8 ("perf session: Add ability to skip 4GiB or more") Reported-by: Tamas Zsoldos <tamas.zsoldos@arm.com> Signed-off-by: Leo Yan <leo.yan@arm.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Jiri Olsa <jolsa@kernel.org> Link: https://lore.kernel.org/r/20250808-perf_fix_big_buffer_size-v1-1-45f45444a9a4@arm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent a8f0992 commit c17dda8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/perf/util/session.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1402,7 +1402,7 @@ static s64 perf_session__process_user_event(struct perf_session *session,
14021402
const struct perf_tool *tool = session->tool;
14031403
struct perf_sample sample;
14041404
int fd = perf_data__fd(session->data);
1405-
int err;
1405+
s64 err;
14061406

14071407
perf_sample__init(&sample, /*all=*/true);
14081408
if ((event->header.type != PERF_RECORD_COMPRESSED &&

0 commit comments

Comments
 (0)