[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130423151846.GA22052@jshin-Toonie>
Date: Tue, 23 Apr 2013 10:18:46 -0500
From: Jacob Shin <jacob.shin@....com>
To: Will Deacon <will.deacon@....com>
CC: Ingo Molnar <mingo@...hat.com>, Oleg Nesterov <oleg@...hat.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
"H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>,
"x86@...nel.org" <x86@...nel.org>,
Stephane Eranian <eranian@...gle.com>,
Jiri Olsa <jolsa@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH V2 1/4] perf: Add hardware breakpoint address mask
On Tue, Apr 23, 2013 at 04:02:40PM +0100, Will Deacon wrote:
> On Tue, Apr 23, 2013 at 03:40:57PM +0100, Jacob Shin wrote:
> > On Tue, Apr 23, 2013 at 09:34:23AM -0500, Jacob Shin wrote:
> > > On Tue, Apr 23, 2013 at 10:54:37AM +0100, Will Deacon wrote:
> > > > Can you see a problem if I simply invert the mask?
> > >
> > > That's great! No, I don't see a problem at all.
>
> Great! The GDB folks have been asking for this, so I can finally make them
> go away now :)
>
> > > I guess now it can be debated if the mask coming in from userland should
> > > be include or exclude mask. But I think exclude makes syntax easier:
> > >
> > > To count writes to [0x1000 ~ 0x1010)
> > >
> > > Include mask (my current patchset):
> > ^^^^^^^
> > Exclude (I mean ..)
> > >
> > > perf stat -e mem:0x1000/0xf:w a.out
>
> Are you saying that this command would count any write to:
>
> 0x1000
> 0x1001
> ...
> 0x100e
> 0x100f
>
> ?
>
> If so, that differs from the ARM debug architecture in that the mask is called
> `byte-address-select', so a mask of 0b1001 would count accesses at +0 bytes
> and +3 bytes from the base address. Is that possible to describe with your
> masking scheme and a single watchpoint?
>
> A mask of 0xf, would count +0, +1, +2 and +3 (essentially bp_len == 4).
>
> Unfortunately, that means I can't just invert the mask like I originally
> thought.
Ah, .. that is different .
Our hardware matches on the breakpoint if:
(physical_address & ~bp_addr_mask) == (bp_addr & ~bp_addr_mask)
In other words, the mask says which of the bp_addr bits hardware should
ignore when matching.
.. it would be great if we can come up with userland interface that works
for both archs. I'm coming up empty at the moment ..
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists