* [PATCH] hw-breakpoint: Fix hardware breakpoints -> perf events dependency
@ 2009-12-17 0:26 Frederic Weisbecker
2009-12-17 0:33 ` [PATCH v2] " Frederic Weisbecker
0 siblings, 1 reply; 4+ messages in thread
From: Frederic Weisbecker @ 2009-12-17 0:26 UTC (permalink / raw)
To: Ingo Molnar
Cc: LKML, Frederic Weisbecker, Peter Zijlstra,
Arnaldo Carvalho de Melo, Paul Mackerras, Cyrill Gorcunov,
Michal Marek, Andrew Randrianasulu, Randy Dunlap, K.Prasad
The kbuild's select command doesn't propagate through the config
dependencies.
Hence the current rules of hardware breakpoint's config can't
ensure perf can never be disabled under us.
We have:
config X86
selects HAVE_HW_BREAKPOINTS
config HAVE_HW_BREAKPOINTS
select PERF_EVENTS
config PERF_EVENTS
[...]
x86 will select the breakpoints but that won't propagate to perf
events. The user can still disable the latter, but it is necessary
for the breakpoints.
What we need is:
- x86 selects HAVE_HW_BREAKPOINTS and PERF_EVENTS
- HAVE_HW_BREAKPOINTS depends on PERF_EVENTS
so that we ensure PERF_EVENTS is enabled and frozen for x86.
This fixes the following kind of build errors:
In file included from arch/x86/kernel/hw_breakpoint.c:31:
include/linux/hw_breakpoint.h: In function 'hw_breakpoint_addr':
include/linux/hw_breakpoint.h:39: error: 'struct perf_event' has no member named 'attr'
include/linux/hw_breakpoint.h: In function 'hw_breakpoint_type':
include/linux/hw_breakpoint.h:44: error: 'struct perf_event' has no member named 'attr'
include/linux/hw_breakpoint.h: In function 'hw_breakpoint_len':
include/linux/hw_breakpoint.h:49: error: 'struct perf_event' has no member named 'attr'
include/linux/hw_breakpoint.h: In function 'counter_arch_bp':
include/linux/hw_breakpoint.h:85: error: 'struct perf_event' has no member named 'hw'
Reported-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reported-by: Michal Marek <mmarek@suse.cz>
Reported-by: Andrew Randrianasulu <randrik_a@yahoo.com>
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>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Cc: "K.Prasad" <prasad@linux.vnet.ibm.com>
---
arch/Kconfig | 4 +---
arch/x86/Kconfig | 1 +
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/Kconfig b/arch/Kconfig
index 28146cd..32e8b68 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -138,9 +138,7 @@ config HAVE_USER_RETURN_NOTIFIER
config HAVE_HW_BREAKPOINT
bool
- depends on HAVE_PERF_EVENTS
- select ANON_INODES
- select PERF_EVENTS
+ depends on PERF_EVENTS
source "kernel/gcov/Kconfig"
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 098f0d3..ffbefd9 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -50,6 +50,7 @@ config X86
select HAVE_KERNEL_BZIP2
select HAVE_KERNEL_LZMA
select HAVE_HW_BREAKPOINT
+ select PERF_EVENTS
select HAVE_ARCH_KMEMCHECK
select HAVE_USER_RETURN_NOTIFIER
--
1.6.2.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2] hw-breakpoint: Fix hardware breakpoints -> perf events dependency
2009-12-17 0:26 [PATCH] hw-breakpoint: Fix hardware breakpoints -> perf events dependency Frederic Weisbecker
@ 2009-12-17 0:33 ` Frederic Weisbecker
2009-12-17 15:11 ` Cyrill Gorcunov
2009-12-18 13:03 ` [tip:perf/urgent] hw-breakpoints: " tip-bot for Frederic Weisbecker
0 siblings, 2 replies; 4+ messages in thread
From: Frederic Weisbecker @ 2009-12-17 0:33 UTC (permalink / raw)
To: Ingo Molnar
Cc: LKML, Frederic Weisbecker, Peter Zijlstra,
Arnaldo Carvalho de Melo, Paul Mackerras, Cyrill Gorcunov,
Michal Marek, Andrew Randrianasulu, Randy Dunlap, K.Prasad
The kbuild's select command doesn't propagate through the config
dependencies.
Hence the current rules of hardware breakpoint's config can't
ensure perf can never be disabled under us.
We have:
config X86
selects HAVE_HW_BREAKPOINTS
config HAVE_HW_BREAKPOINTS
select PERF_EVENTS
config PERF_EVENTS
[...]
x86 will select the breakpoints but that won't propagate to perf
events. The user can still disable the latter, but it is necessary
for the breakpoints.
What we need is:
- x86 selects HAVE_HW_BREAKPOINTS and PERF_EVENTS
- HAVE_HW_BREAKPOINTS depends on PERF_EVENTS
so that we ensure PERF_EVENTS is enabled and frozen for x86.
This fixes the following kind of build errors:
In file included from arch/x86/kernel/hw_breakpoint.c:31:
include/linux/hw_breakpoint.h: In function 'hw_breakpoint_addr':
include/linux/hw_breakpoint.h:39: error: 'struct perf_event' has no member named 'attr'
include/linux/hw_breakpoint.h: In function 'hw_breakpoint_type':
include/linux/hw_breakpoint.h:44: error: 'struct perf_event' has no member named 'attr'
include/linux/hw_breakpoint.h: In function 'hw_breakpoint_len':
include/linux/hw_breakpoint.h:49: error: 'struct perf_event' has no member named 'attr'
include/linux/hw_breakpoint.h: In function 'counter_arch_bp':
include/linux/hw_breakpoint.h:85: error: 'struct perf_event' has no member named 'hw'
v2: Select also ANON_INODES from x86, required for perf
Reported-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reported-by: Michal Marek <mmarek@suse.cz>
Reported-by: Andrew Randrianasulu <randrik_a@yahoo.com>
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>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Cc: "K.Prasad" <prasad@linux.vnet.ibm.com>
---
arch/Kconfig | 4 +---
arch/x86/Kconfig | 2 ++
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/Kconfig b/arch/Kconfig
index 28146cd..32e8b68 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -138,9 +138,7 @@ config HAVE_USER_RETURN_NOTIFIER
config HAVE_HW_BREAKPOINT
bool
- depends on HAVE_PERF_EVENTS
- select ANON_INODES
- select PERF_EVENTS
+ depends on PERF_EVENTS
source "kernel/gcov/Kconfig"
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 098f0d3..cbc1b98 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -50,6 +50,8 @@ config X86
select HAVE_KERNEL_BZIP2
select HAVE_KERNEL_LZMA
select HAVE_HW_BREAKPOINT
+ select PERF_EVENTS
+ select ANON_INODES
select HAVE_ARCH_KMEMCHECK
select HAVE_USER_RETURN_NOTIFIER
--
1.6.2.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] hw-breakpoint: Fix hardware breakpoints -> perf events dependency
2009-12-17 0:33 ` [PATCH v2] " Frederic Weisbecker
@ 2009-12-17 15:11 ` Cyrill Gorcunov
2009-12-18 13:03 ` [tip:perf/urgent] hw-breakpoints: " tip-bot for Frederic Weisbecker
1 sibling, 0 replies; 4+ messages in thread
From: Cyrill Gorcunov @ 2009-12-17 15:11 UTC (permalink / raw)
To: Frederic Weisbecker
Cc: Ingo Molnar, LKML, Peter Zijlstra, Arnaldo Carvalho de Melo,
Paul Mackerras, Michal Marek, Andrew Randrianasulu, Randy Dunlap,
K.Prasad
On Thu, Dec 17, 2009 at 01:33:54AM +0100, Frederic Weisbecker wrote:
...
>
> This fixes the following kind of build errors:
>
> In file included from arch/x86/kernel/hw_breakpoint.c:31:
> include/linux/hw_breakpoint.h: In function 'hw_breakpoint_addr':
> include/linux/hw_breakpoint.h:39: error: 'struct perf_event' has no member named 'attr'
> include/linux/hw_breakpoint.h: In function 'hw_breakpoint_type':
> include/linux/hw_breakpoint.h:44: error: 'struct perf_event' has no member named 'attr'
> include/linux/hw_breakpoint.h: In function 'hw_breakpoint_len':
> include/linux/hw_breakpoint.h:49: error: 'struct perf_event' has no member named 'attr'
> include/linux/hw_breakpoint.h: In function 'counter_arch_bp':
> include/linux/hw_breakpoint.h:85: error: 'struct perf_event' has no member named 'hw'
>
> v2: Select also ANON_INODES from x86, required for perf
>
...
Thanks Frederic! It did trick for me.
-- Cyrill
^ permalink raw reply [flat|nested] 4+ messages in thread
* [tip:perf/urgent] hw-breakpoints: Fix hardware breakpoints -> perf events dependency
2009-12-17 0:33 ` [PATCH v2] " Frederic Weisbecker
2009-12-17 15:11 ` Cyrill Gorcunov
@ 2009-12-18 13:03 ` tip-bot for Frederic Weisbecker
1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Frederic Weisbecker @ 2009-12-18 13:03 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, paulus, acme, hpa, mingo, randrik_a, peterz, mmarek,
randy.dunlap, gorcunov, fweisbec, tglx, mingo, prasad
Commit-ID: 99e8c5a3b875a34d894a711c9a3669858d6adf45
Gitweb: http://git.kernel.org/tip/99e8c5a3b875a34d894a711c9a3669858d6adf45
Author: Frederic Weisbecker <fweisbec@gmail.com>
AuthorDate: Thu, 17 Dec 2009 01:33:54 +0100
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 18 Dec 2009 13:11:51 +0100
hw-breakpoints: Fix hardware breakpoints -> perf events dependency
The kbuild's select command doesn't propagate through the config
dependencies.
Hence the current rules of hardware breakpoint's config can't
ensure perf can never be disabled under us.
We have:
config X86
selects HAVE_HW_BREAKPOINTS
config HAVE_HW_BREAKPOINTS
select PERF_EVENTS
config PERF_EVENTS
[...]
x86 will select the breakpoints but that won't propagate to perf
events. The user can still disable the latter, but it is
necessary for the breakpoints.
What we need is:
- x86 selects HAVE_HW_BREAKPOINTS and PERF_EVENTS
- HAVE_HW_BREAKPOINTS depends on PERF_EVENTS
so that we ensure PERF_EVENTS is enabled and frozen for x86.
This fixes the following kind of build errors:
In file included from arch/x86/kernel/hw_breakpoint.c:31:
include/linux/hw_breakpoint.h: In function 'hw_breakpoint_addr':
include/linux/hw_breakpoint.h:39: error: 'struct perf_event' has no member named 'attr'
v2: Select also ANON_INODES from x86, required for perf
Reported-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reported-by: Michal Marek <mmarek@suse.cz>
Reported-by: Andrew Randrianasulu <randrik_a@yahoo.com>
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>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Cc: K.Prasad <prasad@linux.vnet.ibm.com>
LKML-Reference: <1261010034-7786-1-git-send-regression-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/Kconfig | 4 +---
arch/x86/Kconfig | 2 ++
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/Kconfig b/arch/Kconfig
index d828758..9d055b4 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -135,9 +135,7 @@ config HAVE_DEFAULT_NO_SPIN_MUTEXES
config HAVE_HW_BREAKPOINT
bool
- depends on HAVE_PERF_EVENTS
- select ANON_INODES
- select PERF_EVENTS
+ depends on PERF_EVENTS
config HAVE_USER_RETURN_NOTIFIER
bool
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 3b2a5ac..55298e8 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -50,6 +50,8 @@ config X86
select HAVE_KERNEL_BZIP2
select HAVE_KERNEL_LZMA
select HAVE_HW_BREAKPOINT
+ select PERF_EVENTS
+ select ANON_INODES
select HAVE_ARCH_KMEMCHECK
select HAVE_USER_RETURN_NOTIFIER
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-12-18 13:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-17 0:26 [PATCH] hw-breakpoint: Fix hardware breakpoints -> perf events dependency Frederic Weisbecker
2009-12-17 0:33 ` [PATCH v2] " Frederic Weisbecker
2009-12-17 15:11 ` Cyrill Gorcunov
2009-12-18 13:03 ` [tip:perf/urgent] hw-breakpoints: " tip-bot for Frederic Weisbecker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox