Commit 74048f89 authored by Frederic Weisbecker's avatar Frederic Weisbecker Committed by Ingo Molnar

perf_events: Fix unincremented buffer base on partial copy

If a sample size crosses to the next page boundary, the copy
will be made in more than one step. However we forget to advance
the source offset for the next copy, leading to unexpected double
copies that completely mess up the traces.

This fixes various kinds of bad traces that have irrelevant
data inside, as an example:

	geany-4979  [001]  5758.077775: sched_switch: prev_comm=! prev_pid=121
		prev_prio=0 prev_state=S|D|Z|X|x ==> next_comm= next_pid=7497072
Signed-off-by: default avatarFrederic Weisbecker <>
Cc: Arnaldo Carvalho de Melo <>
Cc: Paul Mackerras <>
Signed-off-by: default avatarPeter Zijlstra <>
LKML-Reference: <>
Signed-off-by: default avatarIngo Molnar <>
parent 90151c35
......@@ -3064,6 +3064,7 @@ __always_inline void perf_output_copy(struct perf_output_handle *handle,
len -= size;
handle->addr += size;
buf += size;
handle->size -= size;
if (!handle->size) {
struct perf_mmap_data *data = handle->data;
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