* [PATCH 1/2] perf: Pass appropriate frame pointer to dump_trace()
@ 2009-12-31 4:53 Frederic Weisbecker
2009-12-31 4:53 ` [PATCH 2/2] perf: Drop useless check for ignored frame Frederic Weisbecker
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Frederic Weisbecker @ 2009-12-31 4:53 UTC (permalink / raw)
To: Ingo Molnar
Cc: LKML, Frederic Weisbecker, Peter Zijlstra,
Arnaldo Carvalho de Melo, Paul Mackerras
Pass the frame pointer from the regs of the interrupted path
to dump_trace() while processing the stack trace.
Currently, dump_trace() takes the current bp and starts the
callchain from dump_trace() itself. This is wasteful because
we need to walk through the entire NMI/DEBUG stack before
retrieving the interrupted point.
We can fix that by just using the frame pointer from the captured
regs. It points exactly where we want to start.
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>
---
arch/x86/kernel/cpu/perf_event.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index c223b7e..d616c06 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -2347,7 +2347,7 @@ perf_callchain_kernel(struct pt_regs *regs, struct perf_callchain_entry *entry)
callchain_store(entry, PERF_CONTEXT_KERNEL);
callchain_store(entry, regs->ip);
- dump_trace(NULL, regs, NULL, 0, &backtrace_ops, entry);
+ dump_trace(NULL, regs, NULL, regs->bp, &backtrace_ops, entry);
}
/*
--
1.6.2.3
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 2/2] perf: Drop useless check for ignored frame 2009-12-31 4:53 [PATCH 1/2] perf: Pass appropriate frame pointer to dump_trace() Frederic Weisbecker @ 2009-12-31 4:53 ` Frederic Weisbecker 2010-01-13 10:31 ` [tip:perf/core] " tip-bot for Frederic Weisbecker 2009-12-31 6:13 ` [PATCH 1/2] perf: Pass appropriate frame pointer to dump_trace() Frederic Weisbecker 2009-12-31 14:30 ` [tip:perf/urgent] " tip-bot for Frederic Weisbecker 2 siblings, 1 reply; 5+ messages in thread From: Frederic Weisbecker @ 2009-12-31 4:53 UTC (permalink / raw) To: Ingo Molnar Cc: LKML, Frederic Weisbecker, Peter Zijlstra, Arnaldo Carvalho de Melo, Paul Mackerras The check that ignores the debug and nmi stack frames is useless now that we have a frame pointer that makes us start at the right place. We don't anymore have to deal with these. 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> --- arch/x86/include/asm/stacktrace.h | 2 -- arch/x86/kernel/cpu/perf_event.c | 8 -------- arch/x86/kernel/dumpstack_32.c | 5 ----- arch/x86/kernel/dumpstack_64.c | 5 ----- 4 files changed, 0 insertions(+), 20 deletions(-) diff --git a/arch/x86/include/asm/stacktrace.h b/arch/x86/include/asm/stacktrace.h index 35e8912..4dab78e 100644 --- a/arch/x86/include/asm/stacktrace.h +++ b/arch/x86/include/asm/stacktrace.h @@ -3,8 +3,6 @@ extern int kstack_depth_to_print; -int x86_is_stack_id(int id, char *name); - struct thread_info; struct stacktrace_ops; diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index d616c06..b1bb8c5 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c @@ -2297,7 +2297,6 @@ void callchain_store(struct perf_callchain_entry *entry, u64 ip) static DEFINE_PER_CPU(struct perf_callchain_entry, pmc_irq_entry); static DEFINE_PER_CPU(struct perf_callchain_entry, pmc_nmi_entry); -static DEFINE_PER_CPU(int, in_ignored_frame); static void @@ -2313,10 +2312,6 @@ static void backtrace_warning(void *data, char *msg) static int backtrace_stack(void *data, char *name) { - per_cpu(in_ignored_frame, smp_processor_id()) = - x86_is_stack_id(NMI_STACK, name) || - x86_is_stack_id(DEBUG_STACK, name); - return 0; } @@ -2324,9 +2319,6 @@ static void backtrace_address(void *data, unsigned long addr, int reliable) { struct perf_callchain_entry *entry = data; - if (per_cpu(in_ignored_frame, smp_processor_id())) - return; - if (reliable) callchain_store(entry, addr); } diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c index ae775ca..11540a1 100644 --- a/arch/x86/kernel/dumpstack_32.c +++ b/arch/x86/kernel/dumpstack_32.c @@ -18,11 +18,6 @@ #include "dumpstack.h" -/* Just a stub for now */ -int x86_is_stack_id(int id, char *name) -{ - return 0; -} void dump_trace(struct task_struct *task, struct pt_regs *regs, unsigned long *stack, unsigned long bp, diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c index 0ad9597..676bc05 100644 --- a/arch/x86/kernel/dumpstack_64.c +++ b/arch/x86/kernel/dumpstack_64.c @@ -33,11 +33,6 @@ static char x86_stack_ids[][8] = { #endif }; -int x86_is_stack_id(int id, char *name) -{ - return x86_stack_ids[id - 1] == name; -} - static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack, unsigned *usedp, char **idp) { -- 1.6.2.3 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [tip:perf/core] perf: Drop useless check for ignored frame 2009-12-31 4:53 ` [PATCH 2/2] perf: Drop useless check for ignored frame Frederic Weisbecker @ 2010-01-13 10:31 ` tip-bot for Frederic Weisbecker 0 siblings, 0 replies; 5+ messages in thread From: tip-bot for Frederic Weisbecker @ 2010-01-13 10:31 UTC (permalink / raw) To: linux-tip-commits Cc: linux-kernel, paulus, acme, hpa, mingo, peterz, fweisbec, tglx, mingo Commit-ID: 0fb8ee48d9dfff6a0913ceb0be2068d8be203763 Gitweb: http://git.kernel.org/tip/0fb8ee48d9dfff6a0913ceb0be2068d8be203763 Author: Frederic Weisbecker <fweisbec@gmail.com> AuthorDate: Thu, 31 Dec 2009 05:53:03 +0100 Committer: Ingo Molnar <mingo@elte.hu> CommitDate: Wed, 13 Jan 2010 10:09:08 +0100 perf: Drop useless check for ignored frame The check that ignores the debug and nmi stack frames is useless now that we have a frame pointer that makes us start at the right place. We don't anymore have to deal with these. 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> LKML-Reference: <1262235183-5320-2-git-send-regression-fweisbec@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> --- arch/x86/include/asm/stacktrace.h | 2 -- arch/x86/kernel/cpu/perf_event.c | 8 -------- arch/x86/kernel/dumpstack_32.c | 5 ----- arch/x86/kernel/dumpstack_64.c | 5 ----- 4 files changed, 0 insertions(+), 20 deletions(-) diff --git a/arch/x86/include/asm/stacktrace.h b/arch/x86/include/asm/stacktrace.h index 35e8912..4dab78e 100644 --- a/arch/x86/include/asm/stacktrace.h +++ b/arch/x86/include/asm/stacktrace.h @@ -3,8 +3,6 @@ extern int kstack_depth_to_print; -int x86_is_stack_id(int id, char *name); - struct thread_info; struct stacktrace_ops; diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index d616c06..b1bb8c5 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c @@ -2297,7 +2297,6 @@ void callchain_store(struct perf_callchain_entry *entry, u64 ip) static DEFINE_PER_CPU(struct perf_callchain_entry, pmc_irq_entry); static DEFINE_PER_CPU(struct perf_callchain_entry, pmc_nmi_entry); -static DEFINE_PER_CPU(int, in_ignored_frame); static void @@ -2313,10 +2312,6 @@ static void backtrace_warning(void *data, char *msg) static int backtrace_stack(void *data, char *name) { - per_cpu(in_ignored_frame, smp_processor_id()) = - x86_is_stack_id(NMI_STACK, name) || - x86_is_stack_id(DEBUG_STACK, name); - return 0; } @@ -2324,9 +2319,6 @@ static void backtrace_address(void *data, unsigned long addr, int reliable) { struct perf_callchain_entry *entry = data; - if (per_cpu(in_ignored_frame, smp_processor_id())) - return; - if (reliable) callchain_store(entry, addr); } diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c index ae775ca..11540a1 100644 --- a/arch/x86/kernel/dumpstack_32.c +++ b/arch/x86/kernel/dumpstack_32.c @@ -18,11 +18,6 @@ #include "dumpstack.h" -/* Just a stub for now */ -int x86_is_stack_id(int id, char *name) -{ - return 0; -} void dump_trace(struct task_struct *task, struct pt_regs *regs, unsigned long *stack, unsigned long bp, diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c index 0ad9597..676bc05 100644 --- a/arch/x86/kernel/dumpstack_64.c +++ b/arch/x86/kernel/dumpstack_64.c @@ -33,11 +33,6 @@ static char x86_stack_ids[][8] = { #endif }; -int x86_is_stack_id(int id, char *name) -{ - return x86_stack_ids[id - 1] == name; -} - static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack, unsigned *usedp, char **idp) { ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] perf: Pass appropriate frame pointer to dump_trace() 2009-12-31 4:53 [PATCH 1/2] perf: Pass appropriate frame pointer to dump_trace() Frederic Weisbecker 2009-12-31 4:53 ` [PATCH 2/2] perf: Drop useless check for ignored frame Frederic Weisbecker @ 2009-12-31 6:13 ` Frederic Weisbecker 2009-12-31 14:30 ` [tip:perf/urgent] " tip-bot for Frederic Weisbecker 2 siblings, 0 replies; 5+ messages in thread From: Frederic Weisbecker @ 2009-12-31 6:13 UTC (permalink / raw) To: Ingo Molnar Cc: LKML, Peter Zijlstra, Arnaldo Carvalho de Melo, Paul Mackerras On Thu, Dec 31, 2009 at 05:53:02AM +0100, Frederic Weisbecker wrote: > Pass the frame pointer from the regs of the interrupted path > to dump_trace() while processing the stack trace. > > Currently, dump_trace() takes the current bp and starts the > callchain from dump_trace() itself. This is wasteful because > we need to walk through the entire NMI/DEBUG stack before > retrieving the interrupted point. > > We can fix that by just using the frame pointer from the captured > regs. It points exactly where we want to start. BTW, another effect of this patch: we didn't have the nmi/debug stack frame filtering in x86-32. So the callchains were polluted by the perf_callchain path, do_debug and so on... After this patch we don't need this filtering anymore as the nmi/debug frames are zapped. It becomes clean like in x86-64. ^ permalink raw reply [flat|nested] 5+ messages in thread
* [tip:perf/urgent] perf: Pass appropriate frame pointer to dump_trace() 2009-12-31 4:53 [PATCH 1/2] perf: Pass appropriate frame pointer to dump_trace() Frederic Weisbecker 2009-12-31 4:53 ` [PATCH 2/2] perf: Drop useless check for ignored frame Frederic Weisbecker 2009-12-31 6:13 ` [PATCH 1/2] perf: Pass appropriate frame pointer to dump_trace() Frederic Weisbecker @ 2009-12-31 14:30 ` tip-bot for Frederic Weisbecker 2 siblings, 0 replies; 5+ messages in thread From: tip-bot for Frederic Weisbecker @ 2009-12-31 14:30 UTC (permalink / raw) To: linux-tip-commits Cc: linux-kernel, paulus, acme, hpa, mingo, peterz, fweisbec, tglx, mingo Commit-ID: 48b5ba9cc98d676712da29d9931f1c88e5185ff2 Gitweb: http://git.kernel.org/tip/48b5ba9cc98d676712da29d9931f1c88e5185ff2 Author: Frederic Weisbecker <fweisbec@gmail.com> AuthorDate: Thu, 31 Dec 2009 05:53:02 +0100 Committer: Ingo Molnar <mingo@elte.hu> CommitDate: Thu, 31 Dec 2009 13:11:31 +0100 perf: Pass appropriate frame pointer to dump_trace() Pass the frame pointer from the regs of the interrupted path to dump_trace() while processing the stack trace. Currently, dump_trace() takes the current bp and starts the callchain from dump_trace() itself. This is wasteful because we need to walk through the entire NMI/DEBUG stack before retrieving the interrupted point. We can fix that by just using the frame pointer from the captured regs. It points exactly where we want to start. 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> LKML-Reference: <1262235183-5320-1-git-send-regression-fweisbec@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Paul Mackerras <paulus@samba.org> --- arch/x86/kernel/cpu/perf_event.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index c223b7e..d616c06 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c @@ -2347,7 +2347,7 @@ perf_callchain_kernel(struct pt_regs *regs, struct perf_callchain_entry *entry) callchain_store(entry, PERF_CONTEXT_KERNEL); callchain_store(entry, regs->ip); - dump_trace(NULL, regs, NULL, 0, &backtrace_ops, entry); + dump_trace(NULL, regs, NULL, regs->bp, &backtrace_ops, entry); } /* ^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-01-13 10:32 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-12-31 4:53 [PATCH 1/2] perf: Pass appropriate frame pointer to dump_trace() Frederic Weisbecker 2009-12-31 4:53 ` [PATCH 2/2] perf: Drop useless check for ignored frame Frederic Weisbecker 2010-01-13 10:31 ` [tip:perf/core] " tip-bot for Frederic Weisbecker 2009-12-31 6:13 ` [PATCH 1/2] perf: Pass appropriate frame pointer to dump_trace() Frederic Weisbecker 2009-12-31 14:30 ` [tip:perf/urgent] " tip-bot for Frederic Weisbecker
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.