Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Nov 2007 12:48:37 -0800
From:      Peter Wemm <peter@wemm.org>
To:        Joe Marcus Clarke <marcus@freebsd.org>
Cc:        cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org, Peter Wemm <peter@freebsd.org>
Subject:   Re: cvs commit: src/sys/compat/linprocfs linprocfs.c src/sys/kern kern_clock.c src/sys/sys pcpu.h resource.h
Message-ID:  <200711301248.37322.peter@wemm.org>
In-Reply-To: <474EF1D5.7070103@FreeBSD.org>
References:  <200711290634.lAT6YUpr004269@repoman.freebsd.org> <474EF1D5.7070103@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 29 November 2007, Joe Marcus Clarke wrote:
> Peter Wemm wrote:
> > peter       2007-11-29 06:34:30 UTC
> >
> >   FreeBSD src repository
> >
> >   Modified files:
> >     sys/compat/linprocfs linprocfs.c
> >     sys/kern             kern_clock.c
> >     sys/sys              pcpu.h resource.h
> >   Log:
> >   Move the shared cp_time array (counts %sys, %user, %idle etc) to
> > the per-cpu area.  cp_time[] goes away and a new function creates a
> > merged cp_time-like array for things like linprocfs, sysctl etc. 
> > The atomic ops for updating cp_time[] in statclock go away, and the
> > scope of the thread lock is reduced.
> >
> >   sysctl kern.cp_time returns a backwards compatible cp_time[]
> > array. A new kern.cp_times sysctl returns the individual per-cpu
> > stats.
> >
> >   I have pending changes to make top and vmstat optionally show
> > per-cpu stats.
> >
> >   I'm very aware that there are something like 5 or 6 other
> > versions "out there" for doing this - but none were handy when I
> > needed them.
> >
> >   I did merge my changes with John Baldwin's, and ended up
> > replacing a few chunks of my stuff with his, and stealing some
> > other code.
>
> libgtop uses the cp_time interface.  Can __FreeBSD_version be bumped
> for this?  And thanks for doing this work.
>
> Joe

If it uses sysctl kern.cp_time, then there is no change required...

If you want to get the new per-cpu stats, then just test for the 
existence of kern.cp_times at runtime.  There's no compile-time visible 
changes.

-- 
Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com
"All of this is for nothing if we don't go to the stars" - JMS/B5



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200711301248.37322.peter>