All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hw-breakpoints: Provide an off-case for counter_arch_bp()
@ 2009-11-13 12:16 Frederic Weisbecker
  2009-11-21 13:38 ` [tip:perf/core] " tip-bot for Frederic Weisbecker
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Frederic Weisbecker @ 2009-11-13 12:16 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: LKML, Frederic Weisbecker, Prasad

If an arch doesn't support the hw breakpoints, counter_arch_bp() has
no off case to cover the missing breakpoint info structure from the
perf event. The result is a build error in non-x86 configs.

Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Prasad <prasad@linux.vnet.ibm.com>
---
 include/linux/hw_breakpoint.h |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h
index 7eba9b9..18710e0 100644
--- a/include/linux/hw_breakpoint.h
+++ b/include/linux/hw_breakpoint.h
@@ -16,11 +16,6 @@ enum {
 	HW_BREAKPOINT_X = 4,
 };
 
-static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp)
-{
-	return &bp->hw.info;
-}
-
 static inline unsigned long hw_breakpoint_addr(struct perf_event *bp)
 {
 	return bp->attr.bp_addr;
@@ -83,6 +78,11 @@ extern void release_bp_slot(struct perf_event *bp);
 
 extern void flush_ptrace_hw_breakpoint(struct task_struct *tsk);
 
+static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp)
+{
+	return &bp->hw.info;
+}
+
 #else /* !CONFIG_HAVE_HW_BREAKPOINT */
 
 static inline struct perf_event *
@@ -126,6 +126,11 @@ static inline void release_bp_slot(struct perf_event *bp) 		{ }
 
 static inline void flush_ptrace_hw_breakpoint(struct task_struct *tsk)	{ }
 
+static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp)
+{
+	return NULL;
+}
+
 #endif /* CONFIG_HAVE_HW_BREAKPOINT */
 
 #endif /* _LINUX_HW_BREAKPOINT_H */
-- 
1.6.2.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-11-21 13:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-13 12:16 [PATCH] hw-breakpoints: Provide an off-case for counter_arch_bp() Frederic Weisbecker
2009-11-21 13:38 ` [tip:perf/core] " tip-bot for Frederic Weisbecker
2009-11-21 13:39 ` [tip:perf/core] hw-breakpoints: Fix build on !perf architectures tip-bot for Ingo Molnar
2009-11-21 13:39 ` [tip:perf/core] hw-breakpoints, x86: Fix modular KVM build tip-bot for Ingo Molnar

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.