ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/libstatgrab/network_stats.c
Revision 1.82 - (view) (annotate) - [select for diffs]
Sun Oct 3 18:35:57 2010 UTC (13 years, 6 months ago) by tdb
Branch: MAIN
CVS Tags: HEAD
Changes since 1.81: +426 -13 lines
Diff to previous 1.81
Add support for AIX 5.x - 9.x.

Many thanks to Jens Rehsack <rehsack@googlemail.com> for providing the
patch for this work. Thanks!

Revision 1.81 - (view) (annotate) - [select for diffs]
Wed Jun 9 14:44:28 2010 UTC (13 years, 10 months ago) by tdb
Branch: MAIN
Changes since 1.80: +4 -4 lines
Diff to previous 1.80
Fix link speed on FreeBSD (and others?). Rather than using our own mask
make use of the system macro to do it for us. Test on FreeBSD, but a look
at if_media.h on the other BSDs suggests it'll work there too.

Revision 1.80 - (view) (annotate) - [select for diffs]
Mon Oct 9 17:25:06 2006 UTC (17 years, 6 months ago) by tdb
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_14, LIBSTATGRAB_0_15, LIBSTATGRAB_0_16, LIBSTATGRAB_0_17
Changes since 1.79: +14 -2 lines
Diff to previous 1.79
When checking the interface up status check the link status as well.

Suggested by: "Vassallo, Michelangelo (Michelangelo)" <vassallo@lucent.com>

Revision 1.79 - (view) (annotate) - [select for diffs]
Mon Oct 9 17:23:07 2006 UTC (17 years, 6 months ago) by tdb
Branch: MAIN
Changes since 1.78: +8 -7 lines
Diff to previous 1.78
Move reading the interface name to earlier in the function. This fixes
problems for us on a host with slightly peculiar interfaces.

Revision 1.78 - (view) (annotate) - [select for diffs]
Mon Oct 9 14:09:38 2006 UTC (17 years, 6 months ago) by tdb
Branch: MAIN
Changes since 1.77: +6 -1 lines
Diff to previous 1.77
Make sure we always close kstat.

Spotted by: "Javier Donaire" <jyuyu@fraguel.org> (in load_stats.c)

Revision 1.77 - (view) (annotate) - [select for diffs]
Sun Jan 22 18:10:39 2006 UTC (18 years, 3 months ago) by tdb
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_13
Changes since 1.76: +2 -2 lines
Diff to previous 1.76
Fix bug on Solaris; network interfaces always seem to be up.

Reported by:    joanmoraleda@ono.com

Revision 1.76 - (view) (annotate) - [select for diffs]
Sat Sep 24 13:29:22 2005 UTC (18 years, 7 months ago) by tdb
Branch: MAIN
Changes since 1.75: +175 -5 lines
Diff to previous 1.75
Add WIN32 support via MINGW. We'll need to add stuff to the README file
about what this requires to build.

All the hard work done by: skel

Revision 1.75 - (view) (annotate) - [select for diffs]
Sat Jul 30 13:23:46 2005 UTC (18 years, 9 months ago) by ats
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_12
Changes since 1.74: +4 -11 lines
Diff to previous 1.74
Use <asm/types.h> to define __u32 etc., and always define u32 etc. because
the Debian 2.6.0-test9 headers still use them in ethtool.h.

Revision 1.74 - (view) (annotate) - [select for diffs]
Wed Jul 13 09:31:54 2005 UTC (18 years, 9 months ago) by tdb
Branch: MAIN
Changes since 1.73: +17 -13 lines
Diff to previous 1.73
Change the name of the duplex value from "dup" to "duplex". This will
break the ABI, but we're changing the fs stats anyway. The API change
is minimal, so hopefully won't affect too many people.

Revision 1.73 - (view) (annotate) - [select for diffs]
Mon Apr 25 14:12:05 2005 UTC (19 years ago) by tdb
Branch: MAIN
Changes since 1.72: +9 -1 lines
Diff to previous 1.72
Apply patch from Scott Lampert to make the network ethtool bits compile
on Linux 2.6.

Revision 1.72 - (view) (annotate) - [select for diffs]
Thu Feb 24 18:35:11 2005 UTC (19 years, 2 months ago) by tdb
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_11_1
Changes since 1.71: +3 -3 lines
Diff to previous 1.71
The labels in this case statement were the wrong way round, so the duplex
settings were being reported incorrectly on linux. Use the defines instead
of the values so we can be sure they're right.

Spotted by Pete.

Revision 1.71 - (view) (annotate) - [select for diffs]
Mon Nov 8 08:07:25 2004 UTC (19 years, 5 months ago) by ats
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_11
Changes since 1.70: +10 -1 lines
Diff to previous 1.70
Raise SG_ERROR_UNSUPPORTED for interface stats on Cygwin and HP-UX.

Revision 1.70 - (view) (annotate) - [select for diffs]
Sun Nov 7 12:30:54 2004 UTC (19 years, 5 months ago) by ats
Branch: MAIN
Changes since 1.69: +5 -1 lines
Diff to previous 1.69
HP-UX can't do network stats.

Revision 1.69 - (view) (annotate) - [select for diffs]
Sun Jul 18 21:30:11 2004 UTC (19 years, 9 months ago) by ats
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_10_1, LIBSTATGRAB_0_10_2, LIBSTATGRAB_0_10_3
Changes since 1.68: +7 -7 lines
Diff to previous 1.68
Use sg_set_error_with_errno whenever errno's valid.
Change the one user of SG_ERROR_ENOENT to SG_ERROR_SYSCTL instead (since
that's what it should have been).

Revision 1.68 - (view) (annotate) - [select for diffs]
Thu Apr 8 13:44:44 2004 UTC (20 years ago) by ats
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_10
Changes since 1.67: +15 -1 lines
Diff to previous 1.67
Add comparison functions for names where that's likely to be useful.

Make the network_iface_stats example show how to use bsearch to find an
interface by name.

Revision 1.67 - (view) (annotate) - [select for diffs]
Thu Apr 8 10:56:13 2004 UTC (20 years ago) by tdb
Branch: MAIN
Changes since 1.66: +1 -2 lines
Diff to previous 1.66
Shift a bunch of parsing functions to be linux/cygwin only. Prompted by
a regex related compile error on FreeBSD (we don't use regex's on FreeBSD).

Revision 1.66 - (view) (annotate) - [select for diffs]
Wed Apr 7 21:08:40 2004 UTC (20 years ago) by tdb
Branch: MAIN
Changes since 1.65: +20 -4 lines
Diff to previous 1.65
The rest of the error handling stuff (except the vector code).

I've been extremely unimaginative with the string names in error.c, but
they're all in one place so much easier to tidy up. I'm also beginning to
wonder if we actually needed an SG_ERROR_SYSTEM_CALL to indicate some call
into the system failed - because the majority of our errors are those :-)

Still to do, then:
 - vector code
 - better string names in error.c
 - deal with arg string in some way
 - make use of the error status in statgrab/saidar/examples

Revision 1.65 - (view) (annotate) - [select for diffs]
Wed Apr 7 14:53:40 2004 UTC (20 years ago) by tdb
Branch: MAIN
Changes since 1.64: +55 -55 lines
Diff to previous 1.64
Whitespace tidyup - change spaces to tabs.

Revision 1.64 - (view) (annotate) - [select for diffs]
Tue Apr 6 14:52:58 2004 UTC (20 years ago) by tdb
Branch: MAIN
Changes since 1.63: +2 -2 lines
Diff to previous 1.63
Update name of project at the top of all soure files. These files now exist
in their own right, rather than as part of the "CMS".

Revision 1.63 - (view) (annotate) - [select for diffs]
Mon Apr 5 18:10:11 2004 UTC (20 years ago) by ats
Branch: MAIN
Changes since 1.62: +7 -7 lines
Diff to previous 1.62
Make sg_update_string return an int to indicate success, so that it can
be used to set a string to NULL.

Make Linux process_stats code set proctitle to NULL if it's empty rather
than "".

Revision 1.62 - (view) (annotate) - [select for diffs]
Mon Apr 5 15:40:15 2004 UTC (20 years ago) by ats
Branch: MAIN
Changes since 1.61: +50 -50 lines
Diff to previous 1.61
Rename all the functions, types and enums in the API to be consistent.
Types are now of the form "sg_mem_stats"; functions of the form
"sg_get_mem_stats"; enums of the form "SG_PROCESS_STATE_RUNNING".
(The old get_proc_snapshot follows the usual calling convention now.)

Make internal functions static where possible.

Rename non-static internal functions to have an sg_ prefix so they don't
collide with those from other libraries. In particular, strlcpy and
strlcat are now called sg_strlcpy and sg_strlcat and are always
included.

Fix saidar and statgrab to use the new API.

Revision 1.61 - (view) (annotate) - [select for diffs]
Mon Apr 5 00:17:40 2004 UTC (20 years ago) by tdb
Branch: MAIN
Changes since 1.60: +2 -1 lines
Diff to previous 1.60
Fix a couple of warnings on Solaris.

Revision 1.60 - (view) (annotate) - [select for diffs]
Mon Apr 5 00:16:24 2004 UTC (20 years ago) by ats
Branch: MAIN
Changes since 1.59: +25 -18 lines
Diff to previous 1.59
Use update_string.

Revision 1.59 - (view) (annotate) - [select for diffs]
Sun Apr 4 22:52:16 2004 UTC (20 years ago) by ats
Branch: MAIN
Changes since 1.58: +40 -95 lines
Diff to previous 1.58
Make network_stats use vectors.

Revision 1.58 - (view) (annotate) - [select for diffs]
Sun Apr 4 21:54:48 2004 UTC (20 years ago) by tdb
Branch: MAIN
Changes since 1.57: +2 -1 lines
Diff to previous 1.57
Fix a bunch of warnings.

Revision 1.57 - (view) (annotate) - [select for diffs]
Sun Apr 4 21:38:50 2004 UTC (20 years ago) by ats
Branch: MAIN
Changes since 1.56: +2 -2 lines
Diff to previous 1.56
Silence another (harmless) "may be used uninitialised" error.

Revision 1.56 - (view) (annotate) - [select for diffs]
Tue Mar 9 12:43:41 2004 UTC (20 years, 1 month ago) by ats
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_9
Changes since 1.55: +11 -13 lines
Diff to previous 1.55
Rework transfer_diff so that it doesn't need an inexpressible constant
on 64-bit systems.
Add OpenBSD to the platforms with 32-bit transfer stats.

Revision 1.55 - (view) (annotate) - [select for diffs]
Tue Mar 9 11:29:46 2004 UTC (20 years, 1 month ago) by ats
Branch: MAIN
Changes since 1.54: +3 -1 lines
Diff to previous 1.54
Add a FIXME note on the network interface stats code; some Solaris
interfaces have packet counts but not byte counts, so it would be useful
to return those once we have a way of indicating the byte count is
unknown.

Revision 1.54 - (view) (annotate) - [select for diffs]
Mon Mar 8 13:48:00 2004 UTC (20 years, 1 month ago) by tdb
Branch: MAIN
Changes since 1.53: +3 -3 lines
Diff to previous 1.53
On OpenBSD IFM_1000_TX is defined to be IFM_1000_T. We can't have both in
our case statement, so ignore IFM_1000_TX.

Revision 1.53 - (view) (annotate) - [select for diffs]
Mon Mar 8 12:31:01 2004 UTC (20 years, 1 month ago) by tdb
Branch: MAIN
Changes since 1.52: +50 -7 lines
Diff to previous 1.52
Add support for new network stats on Solaris. Please check this change cos
this is the first time I've coded Solaris stuff :-)

Revision 1.52 - (view) (annotate) - [select for diffs]
Mon Mar 8 11:58:53 2004 UTC (20 years, 1 month ago) by tdb
Branch: MAIN
Changes since 1.51: +3 -3 lines
Diff to previous 1.51
Change MAXVAL to Hex. I've made an assumption that they were +1 too big
before. I might be wrong, though.

Revision 1.51 - (view) (annotate) - [select for diffs]
Sat Mar 6 23:03:24 2004 UTC (20 years, 1 month ago) by ats
Branch: MAIN
Changes since 1.50: +2 -2 lines
Diff to previous 1.50
"And if a 4 turned out to be 9, I don't mind, I don't mind..."
Fix regexec result count.

Revision 1.50 - (view) (annotate) - [select for diffs]
Sat Mar 6 22:30:54 2004 UTC (20 years, 1 month ago) by ats
Branch: MAIN
Changes since 1.49: +2 -2 lines
Diff to previous 1.49
Make the network stats regexp simpler. Since /proc/net/dev is a fixed
format, there's no need to use [[:space:]] and [[:digit:]]; a literal
space and [0-9] will suffice.

Revision 1.49 - (view) (annotate) - [select for diffs]
Sat Mar 6 22:27:10 2004 UTC (20 years, 1 month ago) by ats
Branch: MAIN
Changes since 1.48: +2 -2 lines
Diff to previous 1.48
Make the regexp match array the right size for Linux.

Revision 1.48 - (view) (annotate) - [select for diffs]
Sat Mar 6 21:56:23 2004 UTC (20 years, 1 month ago) by tdb
Branch: MAIN
Changes since 1.47: +8 -3 lines
Diff to previous 1.47
Add support for errors/packets/collisions to Linux.

Revision 1.47 - (view) (annotate) - [select for diffs]
Sat Mar 6 21:49:13 2004 UTC (20 years, 1 month ago) by tdb
Branch: MAIN
Changes since 1.46: +16 -1 lines
Diff to previous 1.46
Make the rest of the code aware of the new values in the struct.

Revision 1.46 - (view) (annotate) - [select for diffs]
Sat Mar 6 19:04:29 2004 UTC (20 years, 1 month ago) by tdb
Branch: MAIN
Changes since 1.45: +7 -2 lines
Diff to previous 1.45
Add getting errors, packets, and collisions for network interfaces on BSD.

Revision 1.45 - (view) (annotate) - [select for diffs]
Mon Feb 16 14:55:32 2004 UTC (20 years, 2 months ago) by tdb
Branch: MAIN
Changes since 1.44: +10 -7 lines
Diff to previous 1.44
Add support for DragonFly BSD 1.0.
Also a minor tweak to the network interface code to make it more portable.

Revision 1.44 - (view) (annotate) - [select for diffs]
Sat Feb 14 16:58:19 2004 UTC (20 years, 2 months ago) by ats
Branch: MAIN
Changes since 1.43: +56 -34 lines
Diff to previous 1.43
Rework iface_stat code for Solaris so that it uses SIOCGIFFLAGS to find out
whether an interface is up or not. This means that we need to link with
-lsocket -lnsl now to get socket().

Also make the comment about when bytes-transferred stats a bit more explicit.
We're now in the slightly odd situation where it's possible for an interface to
show up in either or both of get_network_stats and get_network_iface_stats: for
instance, on raptor at the moment, ce0 is in use so shows up in both, lo0
doesn't have kstats for bytes transferred and thus only shows up in the second,
and ce1 exists but hasn't been plumbed so only shows up in the first. I'd be
mildly inclined to "fix" this by making get_network_stats do a SIOCGIFFLAGS
ioctl so unplumbed interfaces don't show up at all (and add packets
received/transmited to the get_network_stats result so we can at least show
something for lo0).

Revision 1.43 - (view) (annotate) - [select for diffs]
Sat Feb 14 15:48:42 2004 UTC (20 years, 2 months ago) by ats
Branch: MAIN
Changes since 1.42: +3 -3 lines
Diff to previous 1.42
ifaces doesn't need to be static.

Revision 1.42 - (view) (annotate) - [select for diffs]
Sat Feb 14 12:22:45 2004 UTC (20 years, 2 months ago) by ats
Branch: MAIN
Changes since 1.41: +2 -1 lines
Diff to previous 1.41
Define u64 to fix Linux 2.4.21 build.

Revision 1.41 - (view) (annotate) - [select for diffs]
Sat Feb 14 11:33:33 2004 UTC (20 years, 2 months ago) by pajs
Branch: MAIN
Changes since 1.40: +2 -2 lines
Diff to previous 1.40
Fixed compile error. We not sure that link_up gets us what we want tho.

Revision 1.40 - (view) (annotate) - [select for diffs]
Sat Feb 14 00:47:24 2004 UTC (20 years, 2 months ago) by ats
Branch: MAIN
Changes since 1.39: +22 -18 lines
Diff to previous 1.39
Rearrange the BSD network_iface_stat code in the same way as the Linux code;
try SIOCGIFFLAGS first to find out whether the interface is up, then only
fill in the other information if it's available.

Revision 1.39 - (view) (annotate) - [select for diffs]
Sat Feb 14 00:29:29 2004 UTC (20 years, 2 months ago) by ats
Branch: MAIN
Changes since 1.38: +2 -2 lines
Diff to previous 1.38
Make the unknown speed 0 to match the BSD code.

Revision 1.38 - (view) (annotate) - [select for diffs]
Sat Feb 14 00:27:58 2004 UTC (20 years, 2 months ago) by ats
Branch: MAIN
Changes since 1.37: +33 -33 lines
Diff to previous 1.37
Tidy up the Linux iface_stat code.

- fclose(f) once we're done to avoid fd leak
- no need to malloc struct ethtool_cmd since it's of constant size (and
  this avoids some odd-looking casts)
- use switch rather than multiple ifs for duplex codes
- use SIOCGIFFLAGS ioctl first to find out whether the interface is up,
  since this works on all interfaces

The user-visible change here is that ->speed and ->dup now get filled in
with -1, UNKNOWN_DUPLEX for interfaces that don't support SIOCETHTOOL.
Fixing this properly is on the todo list...

Revision 1.37 - (view) (annotate) - [select for diffs]
Sat Feb 14 00:08:51 2004 UTC (20 years, 2 months ago) by ats
Branch: MAIN
Changes since 1.36: +8 -5 lines
Diff to previous 1.36
Rename BSD "int s" to "int sock" to match Linux code and fix compile error.
Make BSD code set the interface name before calling ioctl so it gets the
stats for the right interface.

Revision 1.36 - (view) (annotate) - [select for diffs]
Fri Feb 13 18:54:29 2004 UTC (20 years, 2 months ago) by pajs
Branch: MAIN
Changes since 1.35: +12 -7 lines
Diff to previous 1.35
*bsd didn't do what i wanted. Still needs testing for all platforms.

Revision 1.35 - (view) (annotate) - [select for diffs]
Fri Feb 13 18:45:43 2004 UTC (20 years, 2 months ago) by pajs
Branch: MAIN
Changes since 1.34: +20 -1 lines
Diff to previous 1.34
Added up/down interface detection. Not tested (or even compiled) on any
os. So that really needs to be done :)

Revision 1.34 - (view) (annotate) - [select for diffs]
Fri Feb 13 15:40:13 2004 UTC (20 years, 2 months ago) by tdb
Branch: MAIN
Changes since 1.33: +3 -3 lines
Diff to previous 1.33
Add example for network_iface_stats.
Fix duplex on Solaris.

Revision 1.33 - (view) (annotate) - [select for diffs]
Fri Feb 13 15:29:16 2004 UTC (20 years, 2 months ago) by pajs
Branch: MAIN
Changes since 1.32: +5 -3 lines
Diff to previous 1.32
Solaris bug fix for duplex detection.

Revision 1.32 - (view) (annotate) - [select for diffs]
Fri Feb 13 15:24:16 2004 UTC (20 years, 2 months ago) by ats
Branch: MAIN
Changes since 1.31: +3 -2 lines
Diff to previous 1.31
Fix another DUPEX-for-DUPLEX typo.
Include <unistd.h> to get the definition of close().

Revision 1.31 - (view) (annotate) - [select for diffs]
Fri Feb 13 15:12:26 2004 UTC (20 years, 2 months ago) by ats
Branch: MAIN
Changes since 1.30: +6 -6 lines
Diff to previous 1.30
DUPLEX, not DUPEX.
NetBSD has FreeBSD 5-like speed definitions.

Revision 1.30 - (view) (annotate) - [select for diffs]
Fri Feb 13 14:41:05 2004 UTC (20 years, 2 months ago) by pajs
Branch: MAIN
Changes since 1.29: +3 -2 lines
Diff to previous 1.29
Added a couple of forgotten close's.

Revision 1.29 - (view) (annotate) - [select for diffs]
Fri Feb 13 14:39:34 2004 UTC (20 years, 2 months ago) by pajs
Branch: MAIN
Changes since 1.28: +7 -7 lines
Diff to previous 1.28
Couple of name changes, and a tidy up.

Revision 1.28 - (view) (annotate) - [select for diffs]
Thu Feb 12 23:58:32 2004 UTC (20 years, 2 months ago) by tdb
Branch: MAIN
Changes since 1.27: +6 -1 lines
Diff to previous 1.27
Fix on FreeBSD 5. Also add IFM_1000_FX missed on FreeBSD 4.

Revision 1.27 - (view) (annotate) - [select for diffs]
Thu Feb 12 21:25:02 2004 UTC (20 years, 2 months ago) by pajs
Branch: MAIN
Changes since 1.26: +92 -2 lines
Diff to previous 1.26
Added network interface stats for linux.

Points to remember:
a) This code will need to be run as root. Otherwise, it should
   safely return null.
b) the "speed" may be incorrect if the interface is not actually up
   and talking to anything. However, duplex will be set to NO_DUPLEX
   so as long as they use that test first, there should be no problem.
   (This is safe assumption to work on, even for other platforms)
c) This was a nastyish and hard bit of code. Maybe bugs, would appricate
   a look over by people :)

Revision 1.26 - (view) (annotate) - [select for diffs]
Sun Jan 25 20:13:57 2004 UTC (20 years, 3 months ago) by pajs
Branch: MAIN
Changes since 1.25: +91 -7 lines
Diff to previous 1.25
Added code for freebsd to do the network interface speeds. I've put it
under the label ALLBSD however, as i suspect it will work on all the
BSD's of intrest.

Revision 1.25 - (view) (annotate) - [select for diffs]
Fri Jan 23 23:23:33 2004 UTC (20 years, 3 months ago) by pajs
Branch: MAIN
Changes since 1.24: +94 -1 lines
Diff to previous 1.24
Added the ability to get the interface speed/duplex for solaris.
Not really checked code, but it appears to work.

Revision 1.24 - (view) (annotate) - [select for diffs]
Wed Jan 21 23:46:54 2004 UTC (20 years, 3 months ago) by ats
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_8_2
Changes since 1.23: +50 -53 lines
Diff to previous 1.23
Tidy up get_network_stats_diff and get_diskio_stats_diff.

Revision 1.23 - (view) (annotate) - [select for diffs]
Mon Jan 19 16:49:21 2004 UTC (20 years, 3 months ago) by tdb
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_8_1
Changes since 1.22: +2 -0 lines
Diff to previous 1.22
A whole bunch of minor cosmetic changes.

Revision 1.22 - (view) (annotate) - [select for diffs]
Fri Jan 16 15:54:54 2004 UTC (20 years, 3 months ago) by tdb
Branch: MAIN
Changes since 1.21: +13 -12 lines
Diff to previous 1.21
Alter the licensing of libstatgrab. The library part is now under the
LGPL, whilst the tools/examples are under the GPL. Both licenses are
included in the distribution (and are both now in CVS). Also made a
minor alteration to the webpage where it said everything was licensed
under the GPL.

Revision 1.21 - (view) (annotate) - [select for diffs]
Sat Jan 10 16:25:51 2004 UTC (20 years, 3 months ago) by ats
Branch: MAIN
Changes since 1.20: +3 -0 lines
Diff to previous 1.20
Add a couple of missing checks for NULL return values; this fixes the
crash when libstatgrab runs out of FDs.

Revision 1.20 - (view) (annotate) - [select for diffs]
Wed Nov 12 01:36:19 2003 UTC (20 years, 5 months ago) by ats
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_8
Changes since 1.19: +5 -0 lines
Diff to previous 1.19
Make libstatgrab functions return NULL for stats that can't be fetched
on cygwin.

Revision 1.19 - (view) (annotate) - [select for diffs]
Fri Oct 24 17:03:20 2003 UTC (20 years, 6 months ago) by ats
Branch: MAIN
Changes since 1.18: +2 -2 lines
Diff to previous 1.18
Add the correct type to a couple of long long constants.

Revision 1.18 - (view) (annotate) - [select for diffs]
Sun Oct 19 02:03:02 2003 UTC (20 years, 6 months ago) by ats
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_7
Changes since 1.17: +3 -3 lines
Diff to previous 1.17
Initial support for NetBSD. This adds NetBSD support for everything
except diskio stats (since they're even more disturbingly complex to get
at on NetBSD than the three OSs we already support). Tested against
NetBSD 1.6 on i386.

Revision 1.17 - (view) (annotate) - [select for diffs]
Tue Aug 26 22:34:49 2003 UTC (20 years, 8 months ago) by pajs
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_5_1, LIBSTATGRAB_0_6, LIBSTATGRAB_0_6_1
Changes since 1.16: +1 -1 lines
Diff to previous 1.16
Fix for freebsd network traffic too.. Everything stores it in 32bit
with the exception of SOL8+ hosts.

Its a stupid world ;)

Revision 1.16 - (view) (annotate) - [select for diffs]
Tue Aug 26 22:11:57 2003 UTC (20 years, 8 months ago) by pajs
Branch: MAIN
Changes since 1.15: +1 -1 lines
Diff to previous 1.15
Linux stores it as a 32bit unsigned long, so suffers the same wrap around
bug as sol 7 hosts. This increases the chances it may happen on freebsd too
so some testing maybe needed. If so, we prob should change this to a default
and have a #ifdef 64bit for the odd (good) ones :)

Revision 1.15 - (view) (annotate) - [select for diffs]
Sun Aug 24 20:24:09 2003 UTC (20 years, 8 months ago) by tdb
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_5
Changes since 1.14: +2 -2 lines
Diff to previous 1.14
Tidy up of lots of little things. :)

Revision 1.14 - (view) (annotate) - [select for diffs]
Sun Apr 6 00:27:19 2003 UTC (21 years ago) by pajs
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_4
Changes since 1.13: +37 -0 lines
Diff to previous 1.13
Now works on freebsd. This is the last of parts that needed to be ported
so its now "finished" for testing. Solaris and Linux should also be tested
as minor changes in code may of disturbed them (it shouldn't have, i just
may of made a mistake :) )

Certain things will require setgid kmem permissions (swap and processor
stats)

Revision 1.13 - (view) (annotate) - [select for diffs]
Mon Mar 31 13:24:12 2003 UTC (21 years, 1 month ago) by pajs
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_3_4
Changes since 1.12: +1 -0 lines
Diff to previous 1.12
Fixed memory leak in regex stuff

Revision 1.12 - (view) (annotate) - [select for diffs]
Mon Mar 31 11:30:54 2003 UTC (21 years, 1 month ago) by pajs
Branch: MAIN
Changes since 1.11: +2 -1 lines
Diff to previous 1.11
Fixed some issues with not closing FILE*'s.

Revision 1.11 - (view) (annotate) - [select for diffs]
Sat Mar 29 18:51:13 2003 UTC (21 years, 1 month ago) by tdb
Branch: MAIN
Changes since 1.10: +1 -1 lines
Diff to previous 1.10
Fix another #include.

Revision 1.10 - (view) (annotate) - [select for diffs]
Sat Mar 22 11:42:10 2003 UTC (21 years, 1 month ago) by pajs
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_3_3
Changes since 1.9: +1 -1 lines
Diff to previous 1.9
Another stupid bug in the wrap around code.

Revision 1.9 - (view) (annotate) - [select for diffs]
Wed Mar 12 16:15:48 2003 UTC (21 years, 1 month ago) by pajs
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_3_2
Changes since 1.8: +4 -4 lines
Diff to previous 1.8
Well, i carefully made the function to look after wrap around issues, and
then apparently didn't use it :)

It now uses it :)

Revision 1.8 - (view) (annotate) - [select for diffs]
Tue Mar 11 16:16:20 2003 UTC (21 years, 1 month ago) by pajs
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_3_1
Changes since 1.7: +17 -0 lines
Diff to previous 1.7
Ok, wrap around fixed for 32bit machines, not 64. I really ought to change
all the long long's to ulong long's. I'll ponder if i can be bothered :)

Revision 1.7 - (view) (annotate) - [select for diffs]
Tue Mar 11 14:30:39 2003 UTC (21 years, 1 month ago) by pajs
Branch: MAIN
Changes since 1.6: +14 -4 lines
Diff to previous 1.6
Make network stats work on pre sol8.
BUGS: On pre sol8 systems, it doesn't cope with a wrap around once the
32bit uint becomes too big. So when this happens it will report one set
of dodgy data, then continue. This bug technically is there in the 64bit
version too, but it will need to of sent 9223372036854775808 bytes first.
(8388608 terrabytes, so basically a *big enough* number that will come around
and byte me in 20 years time or something ;) )

Revision 1.6 - (view) (annotate) - [select for diffs]
Fri Mar 7 11:56:44 2003 UTC (21 years, 1 month ago) by pajs
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_3
Changes since 1.5: +62 -6 lines
Diff to previous 1.5
Made network stats work with linux.

Revision 1.5 - (view) (annotate) - [select for diffs]
Sat Mar 1 02:42:27 2003 UTC (21 years, 2 months ago) by pajs
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_2
Changes since 1.4: +1 -0 lines
Diff to previous 1.4
bug fix

Revision 1.4 - (view) (annotate) - [select for diffs]
Fri Feb 28 22:59:35 2003 UTC (21 years, 2 months ago) by tdb
Branch: MAIN
Changes since 1.3: +1 -3 lines
Diff to previous 1.3
Tidy up of configure script, and includes.

Revision 1.3 - (view) (annotate) - [select for diffs]
Wed Feb 19 17:13:24 2003 UTC (21 years, 2 months ago) by pajs
Branch: MAIN
Changes since 1.2: +101 -29 lines
Diff to previous 1.2
network stats now returns a diff() style function, to make it easy to
show the exact average network traffic over a period of time.

Revision 1.2 - (view) (annotate) - [select for diffs]
Tue Feb 18 23:23:36 2003 UTC (21 years, 2 months ago) by pajs
Branch: MAIN
Changes since 1.1: +2 -1 lines
Diff to previous 1.1
Changed the kstat_close to not return NULL in event of a failure. If we
cant close it, well there is nothing i can do about that, so i may as well
at least return something useful since its done all the hardwork by that
point. And anywan, it should never fail to close :)

Revision 1.1 - (view) (annotate) - [select for diffs]
Tue Feb 18 19:28:30 2003 UTC (21 years, 2 months ago) by pajs
Branch: MAIN
The new revesion of libstatgrab, which is a complete rewrite essentially.

Firstly the data is now returned in structures rather than xml strings.
The structures returned are all static, so what ever calls the library doesn't
have to deal with the memory management of it.

Secondly the general efficency of the code is now significantly faster. It no
longer needs to fork a process, connect file descriptors and run ps, and then
parse the output like it used to. Now it walks /proc and reads it into the
correct data structures. This works without needing any special privilages, so
it can still run as a normal mortal without needing any special group. (Freebsd
will be an exception to this, but this commit only works with solaris, and that
requires nothing special)

Thridly it has more functionality than it used to. It not for instance is capable
of showing network traffic stats, (although its not completely finished yet). It
also in the near future be able to disk io stats as well. Several bug fixes have
been aplied over the original version. For example the cpu_stats used to only reply
the stats for the first processor. This now will report the total stats of all of
them. Paging stats will also be fixed, but haven't been done yet.

Convenience Links

Links to HEAD: (view) (annotate)

Compare Revisions

This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, select a symbolic revision name using the selection box, or choose 'Use Text Field' and enter a numeric revision.

  Diffs between and
  Type of Diff should be a