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

From: Peter Zijlstra
Date: Sat Jul 25 2009 - 12:27:34 EST


On Sat, 2009-07-25 at 11:51 -0400, Mathieu Desnoyers wrote:
> I agree with your idea to split the hardware counter management from
> virtual per-process counters. IMO, this limited resource needs to be
> managed centrally at one location and because system-wide level
> performance counters do not need to flip the performance counters
> depending on the current task.

System wide counters never care about the task state.

Its task counters we sometimes don't re-program counters for on context
switch when both tasks have the same configuration, saving greatly on
context switch costs.

> We can easily think of an embedded system
> where providing system-wide performance counters would be important (for
> tracing for instance), but which would compile-out the per-task
> performance counters to save space.

That doesn't make sense, the per task/global parts of perf counters are
tightly interwoven and don't differ much.

> Note that you will have to deal with some policy here, because you can
> have performance counter reservation asked from both the kernel
> (for either kernel and per-task watchpoints) and from userspace (for
> per-task watchpoints).

cpu counters can be both kernel and user
task counter can be both kernel and user.

Your above use of 'and' doesn't make sense.

--
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/