aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2010-05-27 15:34:58 -0400
committerIngo Molnar <mingo@elte.hu>2010-05-31 02:46:10 -0400
commit74048f895fa8cbf8119b4999f1f44881a825f954 (patch)
tree16c38467e68c730d459dd64cee7f749f1745c782
parent90151c35b19633e0cab5a6c80f1ba4a51e7c913b (diff)
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 next_prio=0 Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Paul Mackerras <paulus@samba.org> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <1274988898-5639-1-git-send-regression-fweisbec@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--kernel/perf_event.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 42a0e9191af5..858f56fa2432 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -3064,6 +3064,7 @@ __always_inline void perf_output_copy(struct perf_output_handle *handle,
3064 3064
3065 len -= size; 3065 len -= size;
3066 handle->addr += size; 3066 handle->addr += size;
3067 buf += size;
3067 handle->size -= size; 3068 handle->size -= size;
3068 if (!handle->size) { 3069 if (!handle->size) {
3069 struct perf_mmap_data *data = handle->data; 3070 struct perf_mmap_data *data = handle->data;