Skip to content

Commit f1c41db

Browse files
Leo-Yangregkh
authored andcommitted
perf session: Fix handling when buffer exceeds 2 GiB
[ Upstream commit c17dda8 ] 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 <[email protected]> Signed-off-by: Leo Yan <[email protected]> Acked-by: Namhyung Kim <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Jiri Olsa <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 3fcbe54 commit f1c41db

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
@@ -1371,7 +1371,7 @@ static s64 perf_session__process_user_event(struct perf_session *session,
13711371
const struct perf_tool *tool = session->tool;
13721372
struct perf_sample sample = { .time = 0, };
13731373
int fd = perf_data__fd(session->data);
1374-
int err;
1374+
s64 err;
13751375

13761376
if (event->header.type != PERF_RECORD_COMPRESSED || perf_tool__compressed_is_stub(tool))
13771377
dump_event(session->evlist, event, file_offset, &sample, file_path);

0 commit comments

Comments
 (0)