lkml.org 
[lkml]   [2009]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] hw-breakpoints: Perf interface support for breakpoint ranges
On Fri, Dec 04, 2009 at 02:08:53PM +1100, Benjamin Herrenschmidt wrote:
> On Thu, 2009-12-03 at 22:16 +0100, Frederic Weisbecker wrote:
> > Looking a the PowerPc cpu implementations of breakpoints, we have
> > for both data and instruction breakpoints:
> >
> > - 2 Address registers (let's rather talk about a comparison operand)
> > - Control registers that define the comparison nature (equal, greater,
> > lesser than) against the above addresses.
> > - Control registers that define how to handle the 2 address registers.
> > The instruction address or memory access need to either match
> > - Address 1 OR Address 2 (OR = boolean OR, not binary)
> > - Address 1 AND Address 2 ( AND = boolean AND, not binary)
> > And this match is subject to the comparison rules independantly
> > defined for these two addresses by the control registers
>
> Well.. the debug facility is different between different PowerPC CPU
> families... There's range breakpoints on some but not all, there's data
> value compare or even instruction value compare on some, etc...



Sure.
I've picked this example (Freescale G2 PPC) as it looks one the trickiest
implementations.



> > The most obvious practical uses of these facilities are either the
> > definition of two independant traditional breakpoints, or the
> > definition of a breakpoint that matches a range of addresses.
> >
> > Hence we want the generic breakpoint interface to support it.
> > This patch splits up the struct perf_event_attr::bp_addr field
> > into bp_start and bp_end.
>
> Ok, that sounds like a good idea.
>
> > The definition of a simple breakpoint needs bp_start and bp_end to be
> > equal, ie: a simple breakpoint is a range breakpoint which start and
> > end addresses are identical.
>
> Ok. So a 0 sized point. Makes sense.



Now that I think about it.
Why not actually use the bp_len field. It was first meant to determine
the size of the access (1, 2, 4, 8 in x86). But that could be extended
to define ranges if breakpoint ranges imply accesses of random size.

What do you think? If the PowerPc range breakpoints are always for
random size accesses (I'm not sure about it), then that would make
sense.

In this case we should drop this patch as the current interface is already
fine. We just need to turn bp_len into a u64 (u32 may not cover every cases).



> > To define a range breakpoint, you just need to set bp_start and bp_end
> > to the limits of your address range.
>
> Inclusive ?



Yeah, that probably makes more sense as a default.



\
 
 \ /
  Last update: 2009-12-04 22:03    [W:0.142 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site