Re: [PATCH 4/6] hw-breakpoints: Rewrite the hw-breakpoints layer on top of perf events

Jan Kiszka
2009-10-24T16:21:11Z

[-- Attachment #1: Type: text/plain, Size: 1913 bytes --]

Frederic Weisbecker wrote:
> This patch rebase the implementation of the breakpoints API on top of
> perf events instances.
>
> Each breakpoints are now perf events that handle the
> register scheduling, thread/cpu attachment, etc..
>
> The new layering is now made as follows:
>
> ptrace kgdb ftrace perf syscall
> \ | / /
> \ | / /
> /
> Core breakpoint API /
> /
> | /
> | /
>
> Breakpoints perf events
>
> |
> |
>
> Breakpoints PMU ---- Debug Register constraints handling
> (Part of core breakpoint API)
> |
> |
>
> Hardware debug registers
>
> Reasons of this rewrite:
>
> - Use the centralized/optimized pmu registers scheduling,
> implying an easier arch integration
> - More powerful register handling: perf attributes (pinned/flexible
> events, exclusive/non-exclusive, tunable period, etc...)
>
> Impact:
>
> - New perf ABI: the hardware breakpoints counters
> - Ptrace breakpoints setting remains tricky and still needs some per
> thread breakpoints references.

- Broken CONFIG_KVM

>
> Todo (in the order):
>

- Unbreak CONFIG_KVM :)

> - Support breakpoints perf counter events for perf tools (ie: implement
> perf_bpcounter_event())
> - Support from perf tools

Since commit 3d53c27d05, KVM uses current->thread.debugregs for
restoring the host state in case the guest played with breakpoints. We
need an equivalent interface to restore ptrace breakpoints and all
others currently in use.

Jan

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]