[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [GNUnet-developers] Re: Round 1
From: |
Blake Matheny |
Subject: |
Re: [GNUnet-developers] Re: Round 1 |
Date: |
Thu, 14 Mar 2002 09:28:20 -0500 |
User-agent: |
Mutt/1.3.27i |
I had pointed this out to Christian, maybe you know. statuscalls.c seems to be
getting user, system, nice, and idle accounting information from /proc/stat,
but fs/proc/proc_misc (around line 264) defines those values as user, nice,
system and idle. The swap of system and nice there may not matter, I'm not
sure. Also, the way Christian described cpuUsage(), it was just calculating
the load average (like the output from uptime would give you). I could be
confused, but if that's the case why isn't cpuUsage() getting the stats out
of /proc/loadavg? BSD fortunatly has a getloadavg() system call, which I'm
multiplying by 100 and returning the value of. If that is returning the right
value then I think we're ok. Thanks for the help.
-Blake
Whatchu talkin' 'bout, Willis?
> Hi,
>
> I am the one to blame for the cpuUsage() function so here is some info on
> it. It opens the file /proc/stat and reads the first line that stores
> the current cpu usage statistics.
> The numbers in that line indicate the number of
> instructions that the cpu executed.
> (I remember that I had some troubles
> figuring out what those numbers were but the web is probably the best
> source of info and that is where I got the answer)
> So at every call
> the function gets the new current time and number of instructions and
> calculates the usage by considering the old values which are stored
> in the lastcputime and last_cpu_results[] variables.
>
> You must allow some time for the values to adjust that is why the
> function should not be called more often than a second (5 sec is probably
> the best).
>
> The other functions from statusCalls.c use the same technique.
>
> I hope this helps,
> Tzvetan
>
> On Thu, 14 Mar 2002, Blake Matheny wrote:
>
> > Whatchu talkin' 'bout, Willis?
> > >
> > > Fine with me, go ahead. And congratulations on the BSD ports. Should we
> > > list
> > > OpenBSD, FreeBSD and NetBSD or do you want to exclude any of these until
> > > you
> > > could do some more testing? [You can of course update the webpage
> > > yourself if
> > > you want (doc/WWW/index.html; doc/gnu.org/index.html).
> > I just imported my local tree, which compiled and ran fine on both FreeBSD
> > and
> > OpenBSD. The server, and text tools seemed to be ok, and the changes made to
> > src/utils/statuscalls.c seem to be working fine, although I'm a bit confused
> on
> > the cpuUsage() function, so if Tzvetan or Christian could shed some light on
> > it, that would be great. The networkUsage() function is a little slower then
> on
> > Linux, as we're using a pipe but not slow enough that I can notice it. I
> > also
> > added getopt to the utils lib, as most platforms (other than Linux), do not
> > have getopt_long. This has been tested to compile and run on FreeBSD 4.5,
> > OpenBSD 3.0, and Linux (kernel 2.4.18). If people have time and could test
> > it
> > out on any BSD box they have sitting around, I'd appreciate it. If gnunet
> > compiles and runs on OpenBSD, it's a safe bet that it will also do so on
> > NetBSD
> > so I didn't bother testing. Let me know if you run into any problems.
> > Thanks.
> > -Blake
> >
> > --
> > Blake Matheny
> > address@hidden
> > PGP-Key http://www.dbaseiv.net/purdue.key
> >
> > _______________________________________________
> > GNUnet-developers mailing list
> > address@hidden
> > http://mail.gnu.org/mailman/listinfo/gnunet-developers
> >
>
--
Blake Matheny
address@hidden
PGP-Key http://www.dbaseiv.net/purdue.key