lkml.org 
[lkml]   [2009]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perfcounters: Make s/w counters in a group only count when group is on
Ingo Molnar writes:

> Agreed. There should really be no difference between software
> and hardware counters as far as the generic perfcounters code
> goes. It's a magic "metric" that gets read out somehow, and
> which generates events somehow.

And my patch didn't create any new difference in the core between
software and hardware counters. It just gave the low-level code a way
to distinguish between sched-out and disable events, and between
sched-in and enable events - for any kind of counter.

That is useful now for making software counters behave correctly, and
will IMO be useful in future for doing lazy PMU switching.

> We can have various grades of hardware versus software counters:
>
> - 'pure hardware counters' where both the count and events come
> from some hw register
>
> - 'pure software counters' where both the count and events are
> generated by software
>
> - 'hybride counters' where for example the count might be from a
> hardware register, but the event is generated by a hrtimer
> (because the hardware is not capable of generating events).
>
> the is_software_counter() assymetry broke this generally relaxed
> model of counters.

There are currently two asymmetries that I can see in the core
relating to software vs. hardware groups:

- we don't bother checking with the CPU-specific low-level code
whether a group with only software counters can go on; we assume it
always can.

- the exclusive group mechanism only applies to hardware counters,
since it is there to let the user do funky things with the PMU.

Do you see any other asymmetry? Note that the patch under discussion
did *not* introduce any additional asymmetry (despite its possibly
ill-chosen title :-).

Paul.


\
 
 \ /
  Last update: 2009-03-14 00:47    [W:0.051 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site