summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/perf_counter.c
diff options
context:
space:
mode:
authorPeter Zijlstra2009-04-02 11:12:03 +0200
committerIngo Molnar2009-04-06 09:30:46 +0200
commit5872bdb88a35fae7d224bd6b21e5f377e854ccfc (patch)
tree915ff65a7bcdaa05d0a76c007d1068b25d476cc4 /arch/x86/kernel/cpu/perf_counter.c
parentperf_counter: kerneltop: update to new ABI (diff)
downloadkernel-qcow2-linux-5872bdb88a35fae7d224bd6b21e5f377e854ccfc.tar.gz
kernel-qcow2-linux-5872bdb88a35fae7d224bd6b21e5f377e854ccfc.tar.xz
kernel-qcow2-linux-5872bdb88a35fae7d224bd6b21e5f377e854ccfc.zip
perf_counter: add more context information
Put in counts to tell which ips belong to what context. ----- | | hv | -- nr | | kernel | -- | | user ----- Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Orig-LKML-Reference: <20090402091319.493101305@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/cpu/perf_counter.c')
-rw-r--r--arch/x86/kernel/cpu/perf_counter.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/perf_counter.c b/arch/x86/kernel/cpu/perf_counter.c
index 2a946a160cac..c74e20d593a7 100644
--- a/arch/x86/kernel/cpu/perf_counter.c
+++ b/arch/x86/kernel/cpu/perf_counter.c
@@ -1088,6 +1088,7 @@ perf_callchain_kernel(struct pt_regs *regs, struct perf_callchain_entry *entry)
{
unsigned long bp;
char *stack;
+ int nr = entry->nr;
callchain_store(entry, instruction_pointer(regs));
@@ -1099,6 +1100,8 @@ perf_callchain_kernel(struct pt_regs *regs, struct perf_callchain_entry *entry)
#endif
dump_trace(NULL, regs, (void *)stack, bp, &backtrace_ops, entry);
+
+ entry->kernel = entry->nr - nr;
}
@@ -1128,6 +1131,7 @@ perf_callchain_user(struct pt_regs *regs, struct perf_callchain_entry *entry)
{
struct stack_frame frame;
const void __user *fp;
+ int nr = entry->nr;
regs = (struct pt_regs *)current->thread.sp0 - 1;
fp = (void __user *)regs->bp;
@@ -1147,6 +1151,8 @@ perf_callchain_user(struct pt_regs *regs, struct perf_callchain_entry *entry)
callchain_store(entry, frame.return_address);
fp = frame.next_fp;
}
+
+ entry->user = entry->nr - nr;
}
static void
@@ -1182,6 +1188,9 @@ struct perf_callchain_entry *perf_callchain(struct pt_regs *regs)
entry = &__get_cpu_var(irq_entry);
entry->nr = 0;
+ entry->hv = 0;
+ entry->kernel = 0;
+ entry->user = 0;
perf_do_callchain(regs, entry);