[perfmon] Re: perfmon2 TODO list (4/4)
William Cohen
wcohen@redhat.com
Mon Apr 17 13:57:00 GMT 2006
Stephane Eranian wrote:
> Frank,
>
> On Thu, Apr 13, 2006 at 06:22:51PM -0400, Frank Ch. Eigler wrote:
>
>>>I have another question related maybe more to kprobes and how the
>>>intercept is done: breakpoints, code rewriting. If you use
>>>breakpoints, then I wonder how this works in SMP machines. Do you
>>>intervene on each CPU?
>>
>>That's right: as each CPU trips across a breakpoint, they are made to
>>run our handler, then single-step across the original instruction,
>>then resume. It's a multi-step process described in kprobes
>>documentation. From systemtap's point of view, it's a black box.
>>
>
> So you are saying that kprobes takes care of programming the debug
> registers on all CPUs if necessary.
>
Kprobe uses breakpoint instructions, so the breakpoint registers on the
processor are not currently being used. Thus, a breakpoint instruction
is placed at the location where the probe is desired and the processor's
debugging registers are not touch by kprobes.
There has been some discussion for SystemTap producing probes that use
the processors debug hardware to watch for accesses to specific memory
locations.
-Will
More information about the Systemtap
mailing list