Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Jul 2004 12:49:01 -0500
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Giorgos Keramidas <keramida@ceid.upatras.gr>
Cc:        current@freebsd.org
Subject:   Re: RFC: Sorting in top -m io
Message-ID:  <20040708174901.GK57155@dan.emsphone.com>
In-Reply-To: <20040708172725.GA7132@orion.daedalusnetworks.priv>
References:  <20040707124751.GA66588@orion.daedalusnetworks.priv> <20040708163751.GN95729@elvis.mu.org> <20040708170731.GI57155@dan.emsphone.com> <20040708172725.GA7132@orion.daedalusnetworks.priv>

next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Jul 08), Giorgos Keramidas said:
> On 2004-07-08 12:07, Dan Nelson <dnelson@allantgroup.com> wrote:
> > In the last episode (Jul 08), Alfred Perlstein said:
> > > * Giorgos Keramidas <keramida@freebsd.org> [040708 05:45] wrote:
> > > >
> > > > The new -m io option of top is cool, but sorting ...
> > >
> > > I think it's awesome.  Go for it.
> >
> > docs are still missing: manpage, top Usage string, and "?" help all
> > need to describe the -m flag and 'm' key.
> 
> Err, yeah.  I should have waited.  I have a few changes to the manpage
> at home.  In a couple of hours they should be ready and into shape for
> commiting.
> 
> > Since there's room, context-switch info would also be neat to display.
> 
> I'm not sure I can tackle this.  I have close to nil experience with
> the stuff top uses to extract the useful information from the kernel.
> Copy-pasting and tinkering a bit with a few OO-like sort methods
> wasn't very hard but for anything else I'll have to read a lot of
> stuff :-)

It's just extracting stuff out of the rusage struct for each process. 
Take a look around line 661 of machine.c; you can see it's getting the
deltas between two rusage structs for certain members.  Just add lines
for ru.ru_nvcsw and ru_nivcsw, and fix up the printf on line 674 and
the definitions of io_header and io_Proc_format around line 96 to
display the fields.

-- 
	Dan Nelson
	dnelson@allantgroup.com



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