perf: Fix arch_perf_out_copy_user default 91/160791/5
authorPeter Zijlstra <peterz@infradead.org>
Wed, 30 Oct 2013 20:16:22 +0000 (21:16 +0100)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 20 Nov 2017 10:37:07 +0000 (19:37 +0900)
commit8a83209d2f13e1c846bb8a6149f6eea3cceb3eab
treeaf7581102e543793720a9d4989663b2c97092a70
parent458583f32ee6252ae0cf90c06adc114076392835
perf: Fix arch_perf_out_copy_user default

The arch_perf_output_copy_user() default of
__copy_from_user_inatomic() returns bytes not copied, while all other
argument functions given DEFINE_OUTPUT_COPY() return bytes copied.

Since copy_from_user_nmi() is the odd duck out by returning bytes
copied where all other *copy_{to,from}* functions return bytes not
copied, change it over and ammend DEFINE_OUTPUT_COPY() to expect bytes
not copied.

Oddly enough DEFINE_OUTPUT_COPY() already returned bytes not copied
while expecting its worker functions to return bytes copied.

Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: will.deacon@arm.com
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/r/20131030201622.GR16117@laptop.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
[inki.dae: backport mainline commit 0a196848ca36 to show proper perf result graph]
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Change-Id: Icde4bc44cb0dc6c3ddd88398a33163e5689ed82a
arch/x86/kernel/cpu/perf_event.c
arch/x86/kernel/cpu/perf_event_intel_ds.c
arch/x86/kernel/cpu/perf_event_intel_lbr.c
arch/x86/lib/usercopy.c
arch/x86/oprofile/backtrace.c
kernel/events/internal.h