diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2010-06-30 20:31:21 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2010-08-18 19:32:11 -0400 |
commit | f72c1a931e311bb7780fee19e41a89ac42cab50e (patch) | |
tree | 470aa111c535af47d8444a249c83b5d360806e69 /kernel/perf_event.c | |
parent | 56962b4449af34070bb1994621ef4f0265eed4d8 (diff) |
perf: Factorize callchain context handling
Store the kernel and user contexts from the generic layer instead
of archs, this gathers some repetitive code.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Paul Mackerras <paulus@samba.org>
Tested-by: Will Deacon <will.deacon@arm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: David Miller <davem@davemloft.net>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Borislav Petkov <bp@amd64.org>
Diffstat (limited to 'kernel/perf_event.c')
-rw-r--r-- | kernel/perf_event.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c index 02efde6c8798..615d024894cf 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c | |||
@@ -2969,6 +2969,7 @@ static struct perf_callchain_entry *perf_callchain(struct pt_regs *regs) | |||
2969 | entry->nr = 0; | 2969 | entry->nr = 0; |
2970 | 2970 | ||
2971 | if (!user_mode(regs)) { | 2971 | if (!user_mode(regs)) { |
2972 | perf_callchain_store(entry, PERF_CONTEXT_KERNEL); | ||
2972 | perf_callchain_kernel(entry, regs); | 2973 | perf_callchain_kernel(entry, regs); |
2973 | if (current->mm) | 2974 | if (current->mm) |
2974 | regs = task_pt_regs(current); | 2975 | regs = task_pt_regs(current); |
@@ -2976,8 +2977,10 @@ static struct perf_callchain_entry *perf_callchain(struct pt_regs *regs) | |||
2976 | regs = NULL; | 2977 | regs = NULL; |
2977 | } | 2978 | } |
2978 | 2979 | ||
2979 | if (regs) | 2980 | if (regs) { |
2981 | perf_callchain_store(entry, PERF_CONTEXT_USER); | ||
2980 | perf_callchain_user(entry, regs); | 2982 | perf_callchain_user(entry, regs); |
2983 | } | ||
2981 | 2984 | ||
2982 | return entry; | 2985 | return entry; |
2983 | } | 2986 | } |