hw-breakpoints: Improve in-kernel event creation error granularity
authorFrederic Weisbecker <fweisbec@gmail.com>
Thu, 26 Nov 2009 04:35:41 +0000 (05:35 +0100)
committerIngo Molnar <mingo@elte.hu>
Thu, 26 Nov 2009 08:29:21 +0000 (09:29 +0100)
commitc6567f642e20bcc79abed030f44be5b0d6da2ded
treeeff0dee5075d220b46019019f8e0d8e8a7bd30f3
parentd99be40aff88722ab03ee295e4f6c13a4cca9a3d
hw-breakpoints: Improve in-kernel event creation error granularity

In fail case, perf_event_create_kernel_counter() returns NULL
instead of an error, which doesn't help us to inform the user
about the origin of the problem from the outer most callers.
Often we can just return -EINVAL, which doesn't help anyone when
it's eventually about a memory allocation failure.

Then, this patch makes perf_event_create_kernel_counter() always
return a detailed error code.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Prasad <prasad@linux.vnet.ibm.com>
LKML-Reference: <1259210142-5714-2-git-send-regression-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/perf_event.c