From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Michael Neuling To: Peter Zijlstra Subject: Re: powerpc/perf: hw breakpoints return ENOSPC In-reply-to: <1345102812.31459.114.camel@twins> References: <28857.1345091034@neuling.org> <1345102812.31459.114.camel@twins> Date: Thu, 16 Aug 2012 21:17:29 +1000 Message-ID: <20344.1345115849@neuling.org> Cc: Ingo Molnar , Frederic Weisbecker , K Prasad , linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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. Are you saying that we need to keep at least 1 slot free at all times, so that we can use it for ptrace? Is "perf record -e mem:0x10000000 true" ever going to be able to work on POWER7 with only one hw breakpoint resource per CPU? Thanks, Mikey