ANNOUNCE - libgtop working draft alpha 0.01 released



-----BEGIN PGP SIGNED MESSAGE-----

Hi all,

I just uploaded the first working draft alpha version 0.01 to my website:

  http://www.home-of-linux.org/gnome/libgtop/

Libgtop is a library that fetches information about the running system such as cpu and
memory usage, active processes etc. On Linux systems, these information are taken directly
from the /proc filesystem. For other systems such as Solaris, where such programs need to be
suid root (or only setgid kmem/mem on some systems), it provides a suid/setgid server that
fetches those information and a client-side library that talks to this server. Main idea
was to have the same interface for all operating systems, thus all system dependent details
are hidden in the implementation of that server.

Currently, it only works for Linux, documentation on how to port it to other systems is on
the way. I'm planning to keep this site an up-to-date mirror of my local machine (which is
connected to the internet over some expensive dialup connection, so I'll upload it about
once every day I made significant changes) so that you can always find the latest version
of the software here.

I've written a simple guile interface for the library to show which information it can
already fetch. See examples/third for details.

===========================================================================================

#include <glibtop.h>
#include <glibtop/open.h>
#include <glibtop/close.h>

#include <glibtop/cpu.h>

int
main (int argc, char *argv [])
{
        glibtop server;
        glibtop_cpu cpu;
        unsigned i, *ptr;

        setlocale (LC_ALL, "");
        bindtextdomain (PACKAGE, GTOPLOCALEDIR);
        textdomain (PACKAGE);

        glibtop_open (&server, argv [0]);

        glibtop_get_cpu (&server, &cpu);

        fprintf (stderr, "CPU: %lu, %lu, %lu, %lu, %lu\n",
                 cpu.total, cpu.user, cpu.nice, cpu.sys, cpu.idle);

        glibtop_close (&server);

        exit (0);
}

===========================================================================================

The following scheme code is used in examples/third to show all information that is
currently available:

        (display (get-cpu)) (newline)
        (display (get-mem)) (newline)
        (display (get-swap)) (newline)
        (display (get-uptime)) (newline)
        (display (get-loadavg)) (newline)
        (display (get-shm_limits)) (newline)
        (display (get-msg_limits)) (newline)
        (display (get-sem_limits)) (newline)
        (display (get-sysdeps)) (newline)
        (display (get-proclist)) (newline)

On my system, this yields:

(3796245 348706 66 89999 3357474)
(31715328 31354880 360448 13385728 401408 7237632 17567744)
(133885952 42160128 91725824)
(37962.49 33574.74)
(0.01 0.02 0.0)
(33554432 1 128 128 4194304)
(2048 16384 4056 16384 128 16 16384)
(4096 128 4096 4096 32 32 32 20 32767 16383)
(31 127 7 3 1 31 127 1023 3)
(71 4 284 1 2 3 246 247 210 8 48 81 83 153 157 167 170 171 172 173 174 175 178 181 195 191 200 203 207 248 215 216 217 220 222 227 245 249 250 251 253 254 315 267 331 373 338 334 335 345 337 372 374 342 343 344 375 14445 13119 6438 14555 13118 13801 6439 
17362 18411 18455 6521 6522 6523 23979 23980 7905 7906)

===========================================================================================

Better documentation is on the way! There's still a little bit under the URL above.

Enjoy it!

Martin <martin@home-of-linux.org>

- ----------------------------------------------------------------
   Martin Baulig - Angewandte Mathematik - Universitaet Trier

   baulig@castor.uni-trier.de, http://www.home-of-linux.org/
   Key: 1024-bit key with ID C8178435 created 1997/01/24 
   ID:  67 C1 84 A0 47 F5 11 C5  5F 68 4C 84 99 05 C3 92
   Finger me for public key or fetch finger.txt from the url above
- ------------------------------------------------------------------


-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv

iQCVAwUBNSv9HIA8K7jIF4Q1AQE2HwP+MiVdUPKOhXKziMhiRzNb+wHwOB454oyp
VYFc/9GzmiV7LVC0nqWhfOjFNBlpfdXKpfOY4F/64OpO6WlmZOFOenpRiLZ9LvIi
OyMWrOphdFmpx0C2tKh6DJ2ssiz3Kb00vnigCxK+mN3sIEg4CyplvKdjK/uaJdH1
W0EPgBlzpH4=
=rZ/5
-----END PGP SIGNATURE-----



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