Re: [RFC][PATCH 5/5] perfcounter: Add support for kernel hardwarebreakpoints

From: Mathieu Desnoyers
Date: Tue Jul 28 2009 - 10:05:16 EST


* Peter Zijlstra (a.p.zijlstra@xxxxxxxxx) wrote:
> On Tue, 2009-07-28 at 03:03 +0200, Frederic Weisbecker wrote:
> > > Thirdly, we can multiplex perf counters beyond their hardware maximum,
> > > something you simply cannot do for a debug interface.
> >
> >
> > Again, I'm stuck in what you mean by multiplexing here :-)
>
> If you'd create say 16 breakpoint counters, we'd RR them over the 4
> available hardware breakpoints (or less when others are taken by someone
> else).
>
> Since its all statistics anyway, we can simply scale the event counts up
> by the time-share they received.
>

Although hw breakpoint and performance counters could be multiplexed to
be used in RR for profiling, I fear using these for tracing does not
necessarily fit well with these statistical artefacts.

Therefore I'd recommend leaving such bp RR as a feature separate from
a low-level breakpoint API, because it seem only useful to profilers.

I think we all have our very precise use-case in mind, and this is what
makes discussion so difficult. So, for my point of view (tracing), I'd
like to be able to set performance counters and breakpoints both
monitoring userspace and kernel. The userspace breakpoints would be
exchanged when a different process is scheduled.

I see 2 complementary ways to collect data into the trace:

- triggering an interrupt each X hardware events, trace this interrupt.
- reading the performance counter value at tracepoints identifying
execution context change (e.g. system call entry/exit, interrupt
entry/exit...)

As you see, none of these 2 ways to gather trace data allow statistical
RR. Therefore, having this feature in the low-level API does not seem to
make sense for tracing.

So if other use-cases could be explained, maybe we can factor out the
common interfaces.

Thanks,

Mathieu

--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/