[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20191001091430.xaibgeen7zwhr6gh@willie-the-truck>
Date: Tue, 1 Oct 2019 10:14:30 +0100
From: Will Deacon <will@...nel.org>
To: wangxu <wangxu72@...wei.com>
Cc: peterz@...radead.org, mingo@...hat.com, acme@...nel.org,
mark.rutland@....com, alexander.shishkin@...ux.intel.com,
namhyung@...nel.org, gregkh@...uxfoundation.org,
tglx@...utronix.de, rfontana@...hat.com, allison@...utok.net,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sample/hw_breakpoint: avoid sample hw_breakpoint
recursion for arm/arm64
On Mon, Sep 23, 2019 at 04:09:35PM +0800, wangxu wrote:
> From: Wang Xu <wangxu72@...wei.com>
>
> For x86/ppc, hw_breakpoint is triggered after the instruction is
> executed.
>
> For arm/arm64, which is triggered before the instruction executed.
> Arm/arm64 skips the instruction by using single step. But it only
> supports default overflow_handler.
>
> This patch provides a chance to avoid sample hw_breakpoint recursion
> for arm/arm64 by adding 'struct perf_event_attr.bp_step'.
Issues like this come up every so often [1], [2], [3] but I'm still of the
opinion that we should rip out the perf interface to hw_breakpoint on arm64
and implement something better directly for ptrace, which is what GDB cares
about. The current "let's convert to perf and back again" is a wreck, mainly
because we've not been able to abstract the debug trap behaviour across
different architectures. GDB just wants to poke registers, and this all
gets in the way of that.
Will
[1] https://lkml.org/lkml/2018/11/15/205
[2] https://lore.kernel.org/lkml/20160323181348.GA2149@arm.com/
[3] https://lkml.org/lkml/2016/3/21/504
Powered by blists - more mailing lists