Re: [RFC GIT PULL] hw-breakpoints: Rewrite on top of perf counters

Frederic Weisbecker
2009-09-10T18:24:11Z

On Thu, Sep 10, 2009 at 08:09:56PM +1000, Paul Mackerras wrote:
> Frederic Weisbecker writes:
>
> > This is a rewrite of the hardware breakpoints on top of perf counters.
>
> On powerpc, it doesn't build. I get:
>
> CC kernel/perf_counter.o
> kernel/perf_counter.c:31:31: error: asm/hw_breakpoint.h: No such file or directory
> kernel/perf_counter.c: In function 'bp_perf_counter_init':
> kernel/perf_counter.c:3964: error: implicit declaration of function 'register_perf_hw_breakpoint'
> kernel/perf_counter.c:3966: error: implicit declaration of function '__register_perf_hw_breakpoint'
> kernel/perf_counter.c:3968: error: 'perf_ops_bp' undeclared (first use in this function)
> kernel/perf_counter.c:3968: error: (Each undeclared identifier is reported only once
> kernel/perf_counter.c:3968: error: for each function it appears in.)
> make[2]: *** [kernel/perf_counter.o] Error 1
> make[1]: *** [kernel] Error 2
> make: *** [sub-make] Error 2
>
> Seems like every architecture now needs an asm/hw_breakpoint.h. What
> is the minimum required in that file? Looks like we would require a
> perf_ops_bp, at least.
>
> Could you please either arrange things so that architectures that
> don't have hardware breakpoints hooked up to perf_counters don't need
> an asm/hw_breakpoint.h, or add minimal versions of that file for every
> architecture, so as not to break bisection unnecessarily?
>
> Paul.

I focused so much on the breakpoint <- perf dependency that I've even
forgotten the opposite dependency :)

I'll fix it in the 3rd patch.
We have an <asm-generic/hw-breakpoint.h> so I can just add an
#ifdef HAVE_HW_BREAKPOINT on its top.

Also I'll export the various breakpoints api dependant out of
kernel/perf_counter.c and provide stubs for the off-case.

Thanks.