Commit 8e820f96 authored by Alexey Bayduraev's avatar Alexey Bayduraev Committed by Arnaldo Carvalho de Melo
Browse files

perf report: Output non-zero offset for decompressed records

Print offset of PERF_RECORD_COMPRESSED record instead of zero for
decompressed records in raw trace dump (-D option of perf-report):

  0x17cf08 [0x28]: event: 9

instead of:

  0 [0x28]: event: 9

The fix is not critical, because currently file_pos for compressed
events is used in perf_session__process_event only to show offsets
in the raw dump.

This patch was separated from patchset:

and was already rewieved.
Reviewed-by: default avatarRiccardo Mancini <>
Signed-off-by: default avatarAlexey Bayduraev <>
Tested-by: default avatarRiccardo Mancini <>
Acked-by: default avatarAndi Kleen <>
Acked-by: default avatarJiri Olsa <>
Acked-by: default avatarNamhyung Kim <>
Cc: Adrian Hunter <>
Cc: Alexander Antonov <>
Cc: Alexander Shishkin <>
Cc: Alexei Budankov <>
Cc: Ingo Molnar <>
Cc: Peter Zijlstra <>

Signed-off-by: default avatarArnaldo Carvalho de Melo <>
parent 26d65741
......@@ -2116,7 +2116,7 @@ fetch_decomp_event(u64 head, size_t mmap_size, char *buf, bool needs_swap)
static int __perf_session__process_decomp_events(struct perf_session *session)
s64 skip;
u64 size, file_pos = 0;
u64 size;
struct decomp *decomp = session->decomp_last;
if (!decomp)
......@@ -2132,7 +2132,7 @@ static int __perf_session__process_decomp_events(struct perf_session *session)
size = event->header.size;
if (size < sizeof(struct perf_event_header) ||
(skip = perf_session__process_event(session, event, file_pos)) < 0) {
(skip = perf_session__process_event(session, event, decomp->file_pos)) < 0) {
pr_err("%#" PRIx64 " [%#x]: failed to process type: %d\n",
decomp->file_pos + decomp->head, event->header.size, event->header.type);
return -EINVAL;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment