From: Jacob Shin <jacob.shin@amd.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
"H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>, <x86@kernel.org>,
Stephane Eranian <eranian@google.com>,
Jiri Olsa <jolsa@redhat.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V2 1/4] perf: Add hardware breakpoint address mask
Date: Thu, 25 Apr 2013 11:59:02 -0500 [thread overview]
Message-ID: <20130425165902.GA31751@jshin-Toonie> (raw)
In-Reply-To: <20130425151035.GA26760@redhat.com>
On Thu, Apr 25, 2013 at 05:10:35PM +0200, Oleg Nesterov wrote:
> On 04/25, Frederic Weisbecker wrote:
> >
> > 2013/4/23 Jacob Shin <jacob.shin@amd.com>:
> > > @@ -286,7 +286,10 @@ struct perf_event_attr {
> > > __u64 config1; /* extension of config */
> > > };
> > > union {
> > > - __u64 bp_len;
> > > + struct {
> > > + __u32 bp_len;
> > > + __u32 bp_addr_mask;
> > > + };
> >
> > Do we need len and mask to work at the same time? I can't think of a
> > situation when len and mask mix up together in a useful way to define
> > a range.
Okay, we can make it:
union {
__u64 bp_len;
__u64 bp_addr_mask;
__config2;
};
And in x86, bp_len != HW_BREAKPOINT_LEN_1,2,4,8 will be interpreted as
bp_addr_mask.
>
> And it would be nice (I think) if we could simply turn bp_len into
> bp_mask. It is already the mask actually, bp_addr should be aligned.
>
> But I do not see how we can do this, so I guess we need another field.
>
> Well. Another option is to extend bp_len. Fortunately HW_BREAKPOINT_LEN_*
> match the length, so we can simply allow any 2^n length and amd.c can
> translate it into the mask.
Okay, this is nice because we can just ride on top of what already exits,
but ...
>
> Of course, this doesn't allow to use, say, mask=0xF0. But perhaps this
> is not really useful?
Exactly .. Right I think most of the time we are trying to trap on range
of contiguous addresses, but .. mask of 0xf0 allows us to trap on 16 byte
aligned addresses:
addr of 0x1000 and mask of 0xf0 will count accesses to:
0x1000, 0x1010, 0x1020, .. 0x10e0, 0x10f0
Maybe there is some big blob of data and user wants to see how many times
16 byte aligned addresses get hit. This might be not as common, but it is
plausible no?
next prev parent reply other threads:[~2013-04-25 16:59 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-23 7:57 [PATCH V2 0/4] perf: Add support for hardware breakpoint address masks Jacob Shin
2013-04-23 7:57 ` [PATCH V2 1/4] perf: Add hardware breakpoint address mask Jacob Shin
2013-04-23 9:54 ` Will Deacon
2013-04-23 14:34 ` Jacob Shin
2013-04-23 14:40 ` Jacob Shin
2013-04-23 15:02 ` Will Deacon
2013-04-23 15:18 ` Jacob Shin
2013-04-24 9:48 ` Will Deacon
2013-04-24 16:30 ` Jacob Shin
2013-04-25 17:06 ` Oleg Nesterov
2013-04-25 17:17 ` H. Peter Anvin
2013-04-25 23:19 ` Jacob Shin
2013-04-26 16:20 ` Will Deacon
2013-04-26 16:31 ` Jacob Shin
2013-04-26 16:47 ` Oleg Nesterov
2013-04-23 13:18 ` Oleg Nesterov
2013-04-23 14:25 ` Jacob Shin
2013-04-24 23:08 ` Frederic Weisbecker
2013-04-25 15:10 ` Oleg Nesterov
2013-04-25 15:57 ` Oleg Nesterov
2013-04-25 16:59 ` Jacob Shin [this message]
2013-04-25 17:33 ` Oleg Nesterov
2013-04-23 7:57 ` [PATCH V2 2/4] perf/x86/amd: AMD implementation for " Jacob Shin
2013-04-23 13:22 ` Oleg Nesterov
2013-04-23 7:57 ` [PATCH V2 3/4] perf tools: Add hardware breakpoint address mask event parser Jacob Shin
2013-04-23 7:57 ` [PATCH V2 4/4] perf tools: Add hardware breakpoint address mask test cases Jacob Shin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130425165902.GA31751@jshin-Toonie \
--to=jacob.shin@amd.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=hpa@zytor.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=oleg@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®