perf: Move task_pt_regs sampling into arch code
authorAndy Lutomirski <luto@amacapital.net>
Sun, 4 Jan 2015 18:36:19 +0000 (10:36 -0800)
committerIngo Molnar <mingo@kernel.org>
Fri, 9 Jan 2015 10:12:28 +0000 (11:12 +0100)
commit88a7c26af8dab2f2d69f5a6067eb670694ec38c0
treee8a9d6c7512f7644a2a5a583b16f6fe4b29b16af
parent0f363b250b15af0f218bb2876d101fe5cd413f8b
perf: Move task_pt_regs sampling into arch code

On x86_64, at least, task_pt_regs may be only partially initialized
in many contexts, so x86_64 should not use it without extra care
from interrupt context, let alone NMI context.

This will allow x86_64 to override the logic and will supply some
scratch space to use to make a cleaner copy of user regs.

Tested-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: chenggang.qcg@taobao.com
Cc: Wu Fengguang <fengguang.wu@intel.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Jean Pihet <jean.pihet@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mark Salter <msalter@redhat.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/e431cd4c18c2e1c44c774f10758527fb2d1025c4.1420396372.git.luto@amacapital.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/arm/kernel/perf_regs.c
arch/arm64/kernel/perf_regs.c
arch/x86/kernel/perf_regs.c
include/linux/perf_event.h
include/linux/perf_regs.h
kernel/events/core.c