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

Re: libgtop2

Marcus Brinkmann wrote:
At Wed, 11 May 2005 01:41:31 +0200,
Manuel Menal <mmenal@hurdfr.org> wrote:

- I can't find a way to get statistics about CPU usage (user/sys/kernel times, etc.),
   i.e. what you get in /proc/stat with Linux.

Check out libps, which is part of the Hurd.

Sure, I've been using libps all through the port. I know it can give a
"CPU usage" info, but libgtop2 wants exactly the user, nice, system,
idle times, but libps does not provide that, AFAICS.

Right, I don't think Mach gives this info.  But if you had a task id,
there is a function to convert task ids into pids in the proc
interface (just FYI).  I don't actually see what you'd want to have
this info for anyway.

As I said in my previous reply to Alfred, I was confused about that
particular requirement. It was the last PID created, as I believed
originally, that libgtop wants to know, which should not be a
problem using libps.

I don't know what IP accounting is.

Well, it's what you get with ifconfig (or /proc/net/dev) in Linux.
Like, the number of received/sent packets/bytes, errors,
collissions, things like that. Drivers keep count of them already
(rx_errors, rx_bytes, tx_packets, etc.). The code is mostly
there in <gnumach/linux/dev/core/dev.c:sprintf_stats>.
Adding an interface that would return a struct to user space,
instead of putting it under /proc, wouldn't be hard, would it?


Manuel Menal

Reply to: