tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: per-cpu statistics (Re: CVS commit: src)

"Steven M. Bellovin" wrote:

> On Fri, 11 Apr 2008 15:36:32 +1000
> Simon Burge <> wrote:
> > I'm happy with keeping the API too.  Is the longer term plan to make
> > _all_ evcnts (kstats/counters/whatever) per-CPU?  At collate at user
> > access time?
> > 
> I would be unhappy with that, because it makes shell scripts much
> messier.  (I went through that recently writing a hotkey script to
> display battery levels.)

When I said "collate at user access time" I meant that the kernel would
collate and present a single number for each evcnt.  Thinking more, it'd
also be useful to have a non-collated mode where the actual per-cpu
stats are returned, but I think the collated mode would be default/most
common.  Also thinking more, the collation doesn't have to be in the
kernel either...

As an example, I can imagine something like:

  % vmstat -e
  event                                         total     rate type
  uvmmap ubackmerge                            200000       20 misc

which is as it is now, but (assuming a two CPU SMP machine):

  % vmstat -eV
  cpu  event                                    total     rate type
  cpu0 uvmmap ubackmerge                       100000       10 misc
  cpu1 uvmmap ubackmerge                       100000       10 misc

The "-V" is arbitary, "-v" is already used to show zero evcnts.


Home | Main Index | Thread Index | Old Index