From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Michael Neuling <mikey@neuling.org>
Cc: Ingo Molnar <mingo@kernel.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
K Prasad <prasad@linux.vnet.ibm.com>,
linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org
Subject: Re: powerpc/perf: hw breakpoints return ENOSPC
Date: Thu, 16 Aug 2012 13:44:58 +0200 [thread overview]
Message-ID: <1345117498.29668.23.camel@twins> (raw)
In-Reply-To: <20344.1345115849@neuling.org>
On Thu, 2012-08-16 at 21:17 +1000, Michael Neuling wrote:
> Peter,
>=20
> > > On this second syscall, fetch_bp_busy_slots() sets slots.pinned to be=
1,
> > > despite there being no breakpoint on this CPU. This is because the c=
all
> > > the task_bp_pinned, checks all CPUs, rather than just the current CPU=
.
> > > POWER7 only has one hardware breakpoint per CPU (ie. HBP_NUM=3D1), so=
we
> > > return ENOSPC.
> >=20
> > I think this comes from the ptrace legacy, we register a breakpoint on
> > all cpus because when we migrate a task it cannot fail to migrate the
> > breakpoint.
> >=20
> > Its one of the things I hate most about the hwbp stuff as it relates to
> > perf.
> >=20
> > Frederic knows more...
>=20
> Maybe I should wait for Frederic to respond but I'm not sure I
> understand what you're saying.
>=20
> I can see how using ptrace hw breakpoints and perf hw breakpoints at the
> same time could be a problem, but I'm not sure how this would stop it.
ptrace uses perf for hwbp support so we're stuck with all kinds of
stupid ptrace constraints.. or somesuch.
> Are you saying that we need to keep at least 1 slot free at all times,
> so that we can use it for ptrace?
No, I'm saying perf-hwbp is weird because of ptrace, maybe the ptrace
weirdness shouldn't live in perf-hwpb but in the ptrace-perf glue
however..
> Is "perf record -e mem:0x10000000 true" ever going to be able to work on
> POWER7 with only one hw breakpoint resource per CPU? =20
I think it should work... but I'm fairly sure it currently doesn't
because of how things are done. 'perf record -ie mem:0x100... true'
might just work.
I always forget all the ptrace details but I am forever annoyed at the
mess that is perf-hwbp.. Frederic is there really nothing we can do
about this?
The fact that ptrace hwbp semantics are different per architecture
doesn't help of course.
WARNING: multiple messages have this Message-ID (diff)
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Michael Neuling <mikey@neuling.org>
Cc: K Prasad <prasad@linux.vnet.ibm.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org,
Ingo Molnar <mingo@kernel.org>
Subject: Re: powerpc/perf: hw breakpoints return ENOSPC
Date: Thu, 16 Aug 2012 13:44:58 +0200 [thread overview]
Message-ID: <1345117498.29668.23.camel@twins> (raw)
In-Reply-To: <20344.1345115849@neuling.org>
On Thu, 2012-08-16 at 21:17 +1000, Michael Neuling wrote:
> Peter,
>
> > > On this second syscall, fetch_bp_busy_slots() sets slots.pinned to be 1,
> > > despite there being no breakpoint on this CPU. This is because the call
> > > the task_bp_pinned, checks all CPUs, rather than just the current CPU.
> > > POWER7 only has one hardware breakpoint per CPU (ie. HBP_NUM=1), so we
> > > return ENOSPC.
> >
> > I think this comes from the ptrace legacy, we register a breakpoint on
> > all cpus because when we migrate a task it cannot fail to migrate the
> > breakpoint.
> >
> > Its one of the things I hate most about the hwbp stuff as it relates to
> > perf.
> >
> > Frederic knows more...
>
> Maybe I should wait for Frederic to respond but I'm not sure I
> understand what you're saying.
>
> I can see how using ptrace hw breakpoints and perf hw breakpoints at the
> same time could be a problem, but I'm not sure how this would stop it.
ptrace uses perf for hwbp support so we're stuck with all kinds of
stupid ptrace constraints.. or somesuch.
> Are you saying that we need to keep at least 1 slot free at all times,
> so that we can use it for ptrace?
No, I'm saying perf-hwbp is weird because of ptrace, maybe the ptrace
weirdness shouldn't live in perf-hwpb but in the ptrace-perf glue
however..
> Is "perf record -e mem:0x10000000 true" ever going to be able to work on
> POWER7 with only one hw breakpoint resource per CPU?
I think it should work... but I'm fairly sure it currently doesn't
because of how things are done. 'perf record -ie mem:0x100... true'
might just work.
I always forget all the ptrace details but I am forever annoyed at the
mess that is perf-hwbp.. Frederic is there really nothing we can do
about this?
The fact that ptrace hwbp semantics are different per architecture
doesn't help of course.
next prev parent reply other threads:[~2012-08-16 11:45 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-16 4:23 powerpc/perf: hw breakpoints return ENOSPC Michael Neuling
2012-08-16 4:23 ` Michael Neuling
2012-08-16 7:40 ` Peter Zijlstra
2012-08-16 7:40 ` Peter Zijlstra
2012-08-16 11:17 ` Michael Neuling
2012-08-16 11:17 ` Michael Neuling
2012-08-16 11:44 ` Peter Zijlstra [this message]
2012-08-16 11:44 ` Peter Zijlstra
2012-08-16 14:02 ` Michael Ellerman
2012-08-16 14:02 ` Michael Ellerman
2012-08-16 14:15 ` Peter Zijlstra
2012-08-16 14:15 ` Peter Zijlstra
2012-08-17 1:20 ` Michael Ellerman
2012-08-17 1:20 ` Michael Ellerman
2012-08-16 23:34 ` Michael Neuling
2012-08-16 23:34 ` Michael Neuling
2012-08-17 16:15 ` Frederic Weisbecker
2012-08-17 16:15 ` Frederic Weisbecker
2012-08-17 21:58 ` Michael Neuling
2012-08-17 21:58 ` Michael Neuling
2012-09-25 7:10 ` Michael Neuling
2012-09-25 7:10 ` Michael Neuling
2012-09-27 15:23 ` Frederic Weisbecker
2012-09-27 15:23 ` Frederic Weisbecker
2012-09-27 1:02 ` Jovi Zhang
2012-09-27 1:02 ` Jovi Zhang
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=1345117498.29668.23.camel@twins \
--to=a.p.zijlstra@chello.nl \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=mikey@neuling.org \
--cc=mingo@kernel.org \
--cc=prasad@linux.vnet.ibm.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.