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

* [tip:perf/core] hw-breakpoints: Provide an off-case for counter_arch_bp()
  2009-11-13 12:16 [PATCH] hw-breakpoints: Provide an off-case for counter_arch_bp() Frederic Weisbecker
@ 2009-11-21 13:38 ` 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
  2 siblings, 0 replies; 4+ messages in thread
From: tip-bot for Frederic Weisbecker @ 2009-11-21 13:38 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, fweisbec, tglx, prasad, mingo

Commit-ID:  687b16fb617bd446439425a368ad7c7bbd202c73
Gitweb:     http://git.kernel.org/tip/687b16fb617bd446439425a368ad7c7bbd202c73
Author:     Frederic Weisbecker <fweisbec@gmail.com>
AuthorDate: Fri, 13 Nov 2009 13:16:15 +0100
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Sat, 14 Nov 2009 00:27:38 +0100

hw-breakpoints: Provide an off-case for counter_arch_bp()

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>
LKML-Reference: <1258114575-32655-1-git-send-email-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
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 */

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

* [tip:perf/core] hw-breakpoints: Fix build on !perf architectures
  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-bot for Ingo Molnar
  2009-11-21 13:39 ` [tip:perf/core] hw-breakpoints, x86: Fix modular KVM build tip-bot for Ingo Molnar
  2 siblings, 0 replies; 4+ messages in thread
From: tip-bot for Ingo Molnar @ 2009-11-21 13:39 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, fweisbec, tglx, prasad, mingo

Commit-ID:  688bcaff291cf2fe2734e43f2793d4d05b850518
Gitweb:     http://git.kernel.org/tip/688bcaff291cf2fe2734e43f2793d4d05b850518
Author:     Ingo Molnar <mingo@elte.hu>
AuthorDate: Sat, 14 Nov 2009 01:12:47 +0100
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Sat, 14 Nov 2009 01:29:17 +0100

hw-breakpoints: Fix build on !perf architectures

the arch/alpha build fails with:

 In file included from tip/kernel/exit.c:52:
 tip/include/linux/hw_breakpoint.h: In function 'hw_breakpoint_addr':
 tip/include/linux/hw_breakpoint.h:21: error: 'struct perf_event' has no member named 'attr'
 [...]

Move these helper inlines inside the CONFIG_HAVE_HW_BREAKPOINT ifdef.

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Prasad <prasad@linux.vnet.ibm.com>
LKML-Reference: <1258114575-32655-1-git-send-email-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 include/linux/hw_breakpoint.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h
index 18710e0..0b98cbf 100644
--- a/include/linux/hw_breakpoint.h
+++ b/include/linux/hw_breakpoint.h
@@ -16,6 +16,8 @@ enum {
 	HW_BREAKPOINT_X = 4,
 };
 
+#ifdef CONFIG_HAVE_HW_BREAKPOINT
+
 static inline unsigned long hw_breakpoint_addr(struct perf_event *bp)
 {
 	return bp->attr.bp_addr;
@@ -31,7 +33,6 @@ static inline int hw_breakpoint_len(struct perf_event *bp)
 	return bp->attr.bp_len;
 }
 
-#ifdef CONFIG_HAVE_HW_BREAKPOINT
 extern struct perf_event *
 register_user_hw_breakpoint(unsigned long addr,
 			    int len,

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

* [tip:perf/core] hw-breakpoints, x86: Fix modular KVM build
  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-bot for Ingo Molnar
  2 siblings, 0 replies; 4+ messages in thread
From: tip-bot for Ingo Molnar @ 2009-11-21 13:39 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, fweisbec, tglx, prasad, mingo

Commit-ID:  68efa37df779b3e04280598e8b5b3a1919b65fee
Gitweb:     http://git.kernel.org/tip/68efa37df779b3e04280598e8b5b3a1919b65fee
Author:     Ingo Molnar <mingo@elte.hu>
AuthorDate: Sat, 14 Nov 2009 01:35:29 +0100
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Sat, 14 Nov 2009 15:32:53 +0100

hw-breakpoints, x86: Fix modular KVM build

This build error:

arch/x86/kvm/x86.c:3655: error: implicit declaration of function 'hw_breakpoint_restore'

Happens because in the CONFIG_KVM=m case there's no 'CONFIG_KVM' define
in the kernel - it's CONFIG_KVM_MODULE in that case.

Make the prototype available unconditionally.

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Prasad <prasad@linux.vnet.ibm.com>
LKML-Reference: <1258114575-32655-1-git-send-email-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/include/asm/debugreg.h |    2 --
 arch/x86/kernel/hw_breakpoint.c |    4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/x86/include/asm/debugreg.h b/arch/x86/include/asm/debugreg.h
index 0f6e92a..fdabd84 100644
--- a/arch/x86/include/asm/debugreg.h
+++ b/arch/x86/include/asm/debugreg.h
@@ -96,9 +96,7 @@ static inline int hw_breakpoint_active(void)
 
 extern void aout_dump_debugregs(struct user *dump);
 
-#ifdef CONFIG_KVM
 extern void hw_breakpoint_restore(void);
-#endif
 
 #endif	/* __KERNEL__ */
 
diff --git a/arch/x86/kernel/hw_breakpoint.c b/arch/x86/kernel/hw_breakpoint.c
index 57dcee5..752daeb 100644
--- a/arch/x86/kernel/hw_breakpoint.c
+++ b/arch/x86/kernel/hw_breakpoint.c
@@ -43,6 +43,7 @@
 
 /* Per cpu debug control register value */
 DEFINE_PER_CPU(unsigned long, dr7);
+EXPORT_PER_CPU_SYMBOL(dr7);
 
 /* Per cpu debug address registers values */
 static DEFINE_PER_CPU(unsigned long, cpu_debugreg[HBP_NUM]);
@@ -409,6 +410,7 @@ void aout_dump_debugregs(struct user *dump)
 
 	dump->u_debugreg[7] = dr7;
 }
+EXPORT_SYMBOL_GPL(aout_dump_debugregs);
 
 /*
  * Release the user breakpoints used by ptrace
@@ -424,7 +426,6 @@ void flush_ptrace_hw_breakpoint(struct task_struct *tsk)
 	}
 }
 
-#ifdef CONFIG_KVM
 void hw_breakpoint_restore(void)
 {
 	set_debugreg(__get_cpu_var(cpu_debugreg[0]), 0);
@@ -435,7 +436,6 @@ void hw_breakpoint_restore(void)
 	set_debugreg(__get_cpu_var(dr7), 7);
 }
 EXPORT_SYMBOL_GPL(hw_breakpoint_restore);
-#endif
 
 /*
  * Handle debug exception notifications.

^ 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.