Compare commits

...

38 Commits

Author SHA1 Message Date
Martin Baulig
d8871029eb Merged everything since May 31 from HEAD and released LibGTop 1.0.3.
1999-09-16  Martin Baulig  <martin@home-of-linux.org>

	Merged everything since May 31 from HEAD and released
 	LibGTop 1.0.3.
1999-09-16 21:49:18 +00:00
Martin Baulig
6799ce187b **** Merged from HEAD **** 1999-09-16 21:38:03 +00:00
Tomas Ogren
2b6b2578be Synced
1999-09-16  Tomas Ogren  <stric@ing.umu.se>

* sv.po: Synced
1999-09-16 21:37:45 +00:00
Martin Baulig
1b0a9fd291 Should be ok now. 1999-09-16 21:37:20 +00:00
Martin Baulig
43e070dd8b make update-po. 1999-09-16 21:33:27 +00:00
Martin Baulig
b0d18119ff **** Merged from HEAD **** 1999-09-16 21:31:36 +00:00
Kjartan Maraas
be05f8163a Updated translation.
1999-07-11  Kjartan Maraas  <kmaraas@online.no>

		* no.po: Updated translation.
1999-07-11 12:27:13 +00:00
Tomas Ogren
d6cdf95d83 New file
1999-07-11  Tomas Ogren  <stric@ing.umu.se>

* sv.po: New file
1999-07-11 01:41:44 +00:00
Tomas Ögren
2256a9127f darn typo 1999-07-11 01:41:01 +00:00
Tomas Ögren
e6507a80be 1999-07-11 Tomas Ogren <stric@ing.umu.se>e
* configure.in: Added sv to ALL_LINGUAS
1999-07-11 01:40:47 +00:00
Tomas Ogren
8411e566b4 Fixed a tyop
1999-07-11  Tomas Ogren  <stric@ing.umu.se>

* sysdeps/names/procmem.c: Fixed a tyop
1999-07-11 01:35:40 +00:00
Martin Baulig
40854f4179 Set version number to 1.0.3 binary age 2, interface age 2.
1999-05-31  Martin Baulig  <martin@home-of-linux.org>

	* LIBGTOP-VERSION: Set version number to 1.0.3 binary age 2,
	interface age 2.
1999-05-31 14:11:07 +00:00
Martin Baulig
41062d0262 Released LibGTop 1.0.2. 1999-05-31 13:34:18 +00:00
Martin Baulig
58c882a860 Enable Timur's BSDI port by default. 1999-05-28 00:43:40 +00:00
Martin Baulig
789d156972 1.0.2. 1999-05-28 00:26:38 +00:00
Martin Baulig
19c24da036 **** Merged from HEAD ****
1999-05-07  Martin Baulig  <martin@home-of-linux.org>

	* server.c (main): There's some problem with uname () - some systems
	like Solaris or Digital Unix return a nonnegative value on success,
	some others like Linux return 0. Since all known systems seem to return
	a negative value on failure, we simply check whether the return value is
	not negative here.
1999-05-27 23:30:48 +00:00
Martin Baulig
929a025f53 **** Merged from HEAD ****
Use `(1L << feature)' instead of `(1 << feature)' to avoid problems
with integer overflows when we add more fields.
1999-05-27 23:30:11 +00:00
Martin Baulig
6a7c289305 *** empty log message *** 1999-05-27 23:26:43 +00:00
Martin Baulig
b65a4a7dcb **** Merged from HEAD **** 1999-05-27 23:23:30 +00:00
Martin Baulig
39b2fffe83 **** Merged from HEAD ****
1999-05-07  Martin Baulig  <martin@home-of-linux.org>

	* timings.c (timersub): Renamed this to `libgtop_timersub' and define
	it on all systems.
1999-05-27 23:19:38 +00:00
Martin Baulig
efb913acff **** Merged from HEAD ****
1999-05-28  Martin Baulig  <martin@home-of-linux.org>

	* first.c, second.c, sysdeps.c: Use LibGTop version conditionals
 	so we can more easily merge the code into LIBGTOP_STABLE_1_0.
1999-05-27 22:34:24 +00:00
Martin Baulig
79e756a2f7 **** Merged from HEAD ****
1999-03-17  Martin Baulig  <martin@home-of-linux.org>

	* first.c, second.c: Fixed a bug that caused a core dump when
	the sysdeps code does not return all data.
1999-05-27 21:42:13 +00:00
Martin Baulig
b08968e644 **** Merged from HEAD **** 1999-05-27 21:23:18 +00:00
Martin Baulig
dff497d2fa **** Merged from HEAD ****
Use `(1L << feature)' instead of `(1 << feature)' to avoid problems
with integer overflows when we add more fields.
1999-05-27 19:30:30 +00:00
Martin Baulig
38de742ca4 **** Merged from HEAD ****
Merged everything from HEAD for the upcoming release.
1999-05-27 18:56:53 +00:00
Martin Baulig
e0d3401bc4 Only #include <sys/param.h> when inside LibGTop. 1999-05-27 18:41:50 +00:00
Martin Baulig
aae2b5a94d *** empty log message *** 1999-05-27 18:39:32 +00:00
Martin Baulig
a5bd38fc19 **** Merged from HEAD ****
Use `(1L << feature)' instead of `(1 << feature)' to avoid problems
with integer overflows when we add more fields.
1999-05-27 14:04:16 +00:00
Martin Baulig
931b8f065e Merged from HEAD. 1999-05-26 15:31:35 +00:00
Martin Baulig
f7885e488f Merged this from HEAD.
1999-05-26  Martin Baulig  <martin@home-of-linux.org>

	* configure.in (INCLUDES): Define `LIBGTOP_VERSION_CODE' here so we
	can use version conditionals in the sysdeps code.
1999-05-26 13:19:03 +00:00
Martin Baulig
8122db69ee Merged I4B fixes for NetBSD from the HEAD. 1999-05-25 17:32:08 +00:00
Martin Baulig
ab13d4919d Make that "dc" think a bit more clean. 1999-05-21 08:19:58 +00:00
Martin Baulig
1d955fbf1f *** empty log message *** 1999-05-20 10:10:32 +00:00
Martin Baulig
8af25a2003 Merged the LibGTop Manual from the HEAD.
1999-05-16  Martin Baulig  <martin@home-of-linux.org>

	* doc: Merged the LibGTop Manual from the HEAD.
1999-05-16 13:48:14 +00:00
Martin Baulig
12eb6a25ec Applied a patch from David Kaelbling:
some compilers (like the SGI IRIX 6.x native one) enfore the
  "casts are not lvalues" maxim.
1999-05-06 22:09:26 +00:00
Martin Baulig
77ced087a1 This is the `LIBGTOP_STABLE_1_0' branch in CVS; please do only commit bug
1999-05-03  Martin Baulig  <martin@home-of-linux.org>

	This is the `LIBGTOP_STABLE_1_0' branch in CVS; please do only
	commit bug fixes here.

	* LIBGTOP-VERSION: Set version number to 1.0.2 binary age 1,
	interface age 0.
1999-05-03 20:31:51 +00:00
Martin Baulig
983475d0c1 Minor Alpha fixes. 1999-05-03 20:27:25 +00:00
Martin Baulig
70b65c05e5 Merged a few bug fixes from the HEAD. 1999-05-03 20:06:40 +00:00
152 changed files with 9097 additions and 871 deletions

View File

@@ -1,2 +1,2 @@
Martin Baulig (martin@home-of-linux.org) Martin Baulig (martin@home-of-linux.org)
Josh Sled <jsled@scam.XCF.Berkeley.EDU> Drazen Kacar (dave@srce.hr)

View File

@@ -1,3 +1,38 @@
1999-09-16 Martin Baulig <martin@home-of-linux.org>
Merged everything since May 31 from HEAD and released
LibGTop 1.0.3.
1999-07-11 Tomas Ogren <stric@ing.umu.se>
* configure.in: Added sv to ALL_LINGUAS
1999-07-11 Tomas Ogren <stric@ing.umu.se>
* sysdeps/names/procmem.c: Fixed a tyop
1999-05-31 Martin Baulig <martin@home-of-linux.org>
* LIBGTOP-VERSION: Set version number to 1.0.3 binary age 2,
interface age 2.
1999-05-31 Martin Baulig <martin@home-of-linux.org>
Released LibGTop 1.0.2.
1999-05-26 Martin Baulig <martin@home-of-linux.org>
* configure.in (INCLUDES): Define `LIBGTOP_VERSION_CODE' here so we
can use version conditionals in the sysdeps code.
1999-05-25 Martin Baulig <martin@home-of-linux.org>
* libgtop-sysdeps.m4: Make the I4B check work for NetBSD.
1999-05-16 Martin Baulig <martin@home-of-linux.org>
* doc: Merged the LibGTop Manual from the HEAD.
1999-03-01 Martin Baulig <martin@home-of-linux.org> 1999-03-01 Martin Baulig <martin@home-of-linux.org>
Released LibGTop 1.0.1. Released LibGTop 1.0.1.

View File

@@ -8,10 +8,10 @@
# #
LIBGTOP_MAJOR_VERSION=1 LIBGTOP_MAJOR_VERSION=1
LIBGTOP_MINOR_VERSION=0 LIBGTOP_MINOR_VERSION=0
LIBGTOP_MICRO_VERSION=1 LIBGTOP_MICRO_VERSION=3
LIBGTOP_INTERFACE_AGE=0 LIBGTOP_INTERFACE_AGE=2
LIBGTOP_BINARY_AGE=0 LIBGTOP_BINARY_AGE=2
# Increase each time you change the client/server protocol. # Increase each time you change the client/server protocol.
LIBGTOP_SERVER_VERSION=5 LIBGTOP_SERVER_VERSION=5

View File

@@ -11,7 +11,7 @@ support = support
endif endif
SUBDIRS = po intl $(support) macros misc include sysdeps lib src \ SUBDIRS = po intl $(support) macros misc include sysdeps lib src \
$(examples_SUBDIRS) $(examples_SUBDIRS) doc
include_HEADERS = glibtop.h include_HEADERS = glibtop.h
@@ -31,6 +31,8 @@ confexecdir = $(libdir)
confexec_DATA = $(top_builddir)/libgtopConf.sh \ confexec_DATA = $(top_builddir)/libgtopConf.sh \
$(top_builddir)/libgtop-features.def $(top_builddir)/libgtop-features.def
CLEANFILES=libgtopConf.sh
bin_SCRIPTS = $(top_builddir)/libgtop-config bin_SCRIPTS = $(top_builddir)/libgtop-config
## to automatically rebuild aclocal.m4 if any of the macros in ## to automatically rebuild aclocal.m4 if any of the macros in

View File

@@ -13,6 +13,12 @@ AC_MSG_ERROR([
*** The "dc" utility was not found on your system. *** The "dc" utility was not found on your system.
*** ***
*** When using RedHat Linux, you need to install the "bc" package. *** When using RedHat Linux, you need to install the "bc" package.
***
*** It is now part of the "bc" package, so you should look at
*** ftp://ftp.gnu.org/pub/gnu/bc/ if you want to compile it yourself.
***
*** Other systems and distributions may also have it in their "bc" package,
*** so if there's no "dc" one, please look for "bc".
***]) ***])
fi fi
@@ -147,11 +153,14 @@ else
fi fi
if test "x$enable_static" != xno; then if test "x$enable_static" != xno; then
static_targets="first_static second_static mountlist_static procmap_static netload_static sysdeps_static $guile_static_examples $smp_static_examples" static_targets="first_static second_static mountlist_static procmap_static netload_static sysdeps_static timings_static $guile_static_examples $smp_static_examples"
else else
static_targets="" static_targets=""
fi fi
AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = xyes)
AM_CONDITIONAL(ENABLE_SHARED, test x$enable_static = xyes)
AC_SUBST(static_targets) AC_SUBST(static_targets)
AC_SUBST(smp_examples) AC_SUBST(smp_examples)
AC_SUBST(guile_examples) AC_SUBST(guile_examples)
@@ -220,7 +229,7 @@ AC_FUNC_STRFTIME
AC_CHECK_FUNCS(getcwd gettimeofday getwd putenv strdup strtoul uname) AC_CHECK_FUNCS(getcwd gettimeofday getwd putenv strdup strtoul uname)
dnl ## all 'es_??' are only needed for format numbers different of 'es' dnl ## all 'es_??' are only needed for format numbers different of 'es'
ALL_LINGUAS="de es es_DO es_GT es_HN es_MX es_PA es_PE es_SV fr ko no ja" ALL_LINGUAS="de es es_DO es_GT es_HN es_MX es_PA es_PE es_SV fr ko no ja sv"
AM_GNOME_GETTEXT AM_GNOME_GETTEXT
AC_PATH_XTRA AC_PATH_XTRA
@@ -354,7 +363,7 @@ else
guile_def="" guile_def=""
fi fi
INCLUDES="-D_IN_LIBGTOP -D_GNU_SOURCE -DGLIBTOP_NAMES -I\$(top_builddir) -I\$(top_srcdir) -I\$(top_srcdir)/sysdeps/$sysdeps_dir -I\$(top_srcdir)/include -I\$(top_srcdir)/intl $SUPPORTINCS $GLIB_CFLAGS $CFLAGS $X_CFLAGS $guile_def "'-DGTOPLOCALEDIR=\"$(datadir)/locale\" -DLIBGTOP_VERSION=\"'"$LIBGTOP_VERSION"'\" -DLIBGTOP_SERVER_VERSION=\"'"$LIBGTOP_SERVER_VERSION"'\" -DLIBGTOP_SERVER=\"'"$LIBGTOP_SERVER"'\"' INCLUDES="-D_IN_LIBGTOP -D_GNU_SOURCE -DGLIBTOP_NAMES -I\$(top_builddir) -I\$(top_srcdir) -I\$(top_srcdir)/sysdeps/$sysdeps_dir -I\$(top_srcdir)/include -I\$(top_srcdir)/intl $SUPPORTINCS $GLIB_CFLAGS $CFLAGS $X_CFLAGS $guile_def "'-DGTOPLOCALEDIR=\"$(datadir)/locale\" -DLIBGTOP_VERSION=\"'"$LIBGTOP_VERSION"'\" -DLIBGTOP_SERVER_VERSION=\"'"$LIBGTOP_SERVER_VERSION"'\" -DLIBGTOP_VERSION_CODE='$LIBGTOP_VERSION_CODE' -DLIBGTOP_SERVER=\"'"$LIBGTOP_SERVER"'\"'
AC_SUBST(INCLUDES) AC_SUBST(INCLUDES)
@@ -406,5 +415,6 @@ src/daemon/Makefile
src/inodedb/Makefile src/inodedb/Makefile
lib/Makefile lib/Makefile
examples/Makefile examples/Makefile
doc/Makefile
support/Makefile support/Makefile
macros/Makefile]) macros/Makefile])

View File

@@ -11,4 +11,6 @@ third_linux
third_static third_static
second_static second_static
second_linux second_linux
smp_static sysdeps_static netload_static procmap_static mountlist_static
smp sysdeps netload procmap mountlist smp sysdeps netload procmap mountlist
timings timings_static

View File

@@ -1,3 +1,27 @@
1999-05-28 Martin Baulig <martin@home-of-linux.org>
* first.c, second.c, sysdeps.c: Use LibGTop version conditionals
so we can more easily merge the code into LIBGTOP_STABLE_1_0.
1999-05-07 Martin Baulig <martin@home-of-linux.org>
* timings.c (timersub): Renamed this to `libgtop_timersub' and define
it on all systems.
Fri Apr 9 00:14:52 1999 Timur Bakeyev <timur@gnu.org>
* timings.c: Added timersub defenition, to make code compilable on
BSDI.
1999-03-24 Martin Baulig <martin@home-of-linux.org>
* timings.c: New example.
1999-03-17 Martin Baulig <martin@home-of-linux.org>
* first.c, second.c: Fixed a bug that caused a core dump when
the sysdeps code does not return all data.
1998-11-22 Martin Baulig <baulig@taurus.uni-trier.de> 1998-11-22 Martin Baulig <baulig@taurus.uni-trier.de>
* netload.c: Call inet_ntoa () to get address and subnet * netload.c: Call inet_ntoa () to get address and subnet

View File

@@ -12,13 +12,14 @@ DEFS = @DEFS@
libgtopdir = $(libexecdir)/libgtop libgtopdir = $(libexecdir)/libgtop
libgtop_PROGRAMS = first second\ libgtop_PROGRAMS = first second\
mountlist procmap netload sysdeps\ mountlist procmap netload sysdeps timings \
@static_targets@ @guile_examples@ @smp_examples@ @static_targets@ @guile_examples@ @smp_examples@
EXTRA_PROGRAMS = first_static second_static \ EXTRA_PROGRAMS = first_static second_static \
mountlist_static procmap_static \ mountlist_static procmap_static \
third third_static smp smp_static \ third third_static smp smp_static \
netload_static sysdeps_static netload_static sysdeps_static \
timings_static
first_SOURCES = first.c first_SOURCES = first.c
first_LDADD = $(top_builddir)/lib/libgtop.la \ first_LDADD = $(top_builddir)/lib/libgtop.la \
@@ -108,3 +109,13 @@ smp_static_SOURCES = $(smp_SOURCES)
smp_static_LDADD = $(smp_LDADD) smp_static_LDADD = $(smp_LDADD)
smp_static_LDFLAGS = -static smp_static_LDFLAGS = -static
timings_SOURCES = timings.c
timings_LDADD = $(top_builddir)/lib/libgtop.la \
$(top_builddir)/sysdeps/common/libgtop_common.la \
$(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \
@LIBSUPPORT@ @INTLLIBS@
timings_static_SOURCES = $(timings_SOURCES)
timings_static_LDADD = $(timings_LDADD)
timings_static_LDFLAGS = -static

View File

@@ -116,9 +116,16 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++) for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_uptime (&data.uptime); glibtop_get_uptime (&data.uptime);
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Uptime (0x%08lx): %f, %f, %lu\n",
(unsigned long) data.uptime.flags,
data.uptime.uptime, data.uptime.idletime,
(unsigned long) data.uptime.boot_time);
#else
printf ("Uptime (0x%08lx): %f, %f\n", printf ("Uptime (0x%08lx): %f, %f\n",
(unsigned long) data.uptime.flags, (unsigned long) data.uptime.flags,
data.uptime.uptime, data.uptime.idletime); data.uptime.uptime, data.uptime.idletime);
#endif
for (c = 0; c < PROFILE_COUNT; c++) for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_loadavg (&data.loadavg); glibtop_get_loadavg (&data.loadavg);
@@ -242,15 +249,52 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++) for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_state (&data.proc_state, pid); glibtop_get_proc_state (&data.proc_state, pid);
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_State PID %5d (0x%08lx): '%s', %u - "
"%u, %u, %u, %u - %u, %u, %u\n", (int) pid,
(unsigned long) data.proc_state.flags,
data.proc_state.cmd, data.proc_state.state,
data.proc_state.uid, data.proc_state.gid,
data.proc_state.ruid, data.proc_state.rgid,
data.proc_state.has_cpu, data.proc_state.processor,
data.proc_state.last_processor);
#else
printf ("Proc_State PID %5d (0x%08lx): '%s', %c, %lu, %lu\n", printf ("Proc_State PID %5d (0x%08lx): '%s', %c, %lu, %lu\n",
(int) pid, (unsigned long) data.proc_state.flags, (int) pid, (unsigned long) data.proc_state.flags,
data.proc_state.cmd, data.proc_state.state, data.proc_state.cmd, data.proc_state.state,
(unsigned long) data.proc_state.uid, (unsigned long) data.proc_state.uid,
(unsigned long) data.proc_state.gid); (unsigned long) data.proc_state.gid);
#endif
for (c = 0; c < PROFILE_COUNT; c++) for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_uid (&data.proc_uid, pid); glibtop_get_proc_uid (&data.proc_uid, pid);
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_Uid PID %5d (0x%08lx): "
"%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d - %d",
(int) pid, (unsigned long) data.proc_uid.flags,
data.proc_uid.uid, data.proc_uid.euid,
data.proc_uid.gid, data.proc_uid.egid,
data.proc_uid.suid, data.proc_uid.sgid,
data.proc_uid.fsuid, data.proc_uid.fsgid,
data.proc_uid.pid, data.proc_uid.ppid,
data.proc_uid.pgrp, data.proc_uid.session,
data.proc_uid.tty, data.proc_uid.tpgid,
data.proc_uid.priority, data.proc_uid.nice,
data.proc_uid.ngroups);
if (data.proc_uid.ngroups) {
for (i = 0; i < data.proc_uid.ngroups; i++) {
if (i)
printf (" %d", data.proc_uid.groups [i]);
else
printf (" (%d", data.proc_uid.groups [i]);
}
printf (")");
}
printf ("\n");
#else
printf ("Proc_Uid PID %5d (0x%08lx): " printf ("Proc_Uid PID %5d (0x%08lx): "
"%d %d %d %d %d %d %d %d %d %d %d %d\n", (int) pid, "%d %d %d %d %d %d %d %d %d %d %d %d\n", (int) pid,
(unsigned long) data.proc_uid.flags, (unsigned long) data.proc_uid.flags,
@@ -260,6 +304,7 @@ main (int argc, char *argv [])
data.proc_uid.pgrp, data.proc_uid.session, data.proc_uid.pgrp, data.proc_uid.session,
data.proc_uid.tty, data.proc_uid.tpgid, data.proc_uid.tty, data.proc_uid.tpgid,
data.proc_uid.priority, data.proc_uid.nice); data.proc_uid.priority, data.proc_uid.nice);
#endif
for (c = 0; c < PROFILE_COUNT; c++) for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_mem (&data.proc_mem, pid); glibtop_get_proc_mem (&data.proc_mem, pid);
@@ -277,6 +322,30 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++) for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_segment (&data.proc_segment, pid); glibtop_get_proc_segment (&data.proc_segment, pid);
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_Segment PID %5d (0x%08lx): "
"%lu %lu %lu %lu %lu 0x%lx 0x%lx 0x%lx "
"0x%lx 0x%lx 0x%lx 0x%lx 0x%lx "
"0x%lx 0x%lx 0x%lx 0x%lx\n", (int) pid,
(unsigned long) data.proc_segment.flags,
(unsigned long) data.proc_segment.text_rss,
(unsigned long) data.proc_segment.shlib_rss,
(unsigned long) data.proc_segment.data_rss,
(unsigned long) data.proc_segment.stack_rss,
(unsigned long) data.proc_segment.dirty_size,
(unsigned long) data.proc_segment.start_code,
(unsigned long) data.proc_segment.end_code,
(unsigned long) data.proc_segment.start_data,
(unsigned long) data.proc_segment.end_data,
(unsigned long) data.proc_segment.start_brk,
(unsigned long) data.proc_segment.end_brk,
(unsigned long) data.proc_segment.start_stack,
(unsigned long) data.proc_segment.start_mmap,
(unsigned long) data.proc_segment.arg_start,
(unsigned long) data.proc_segment.arg_end,
(unsigned long) data.proc_segment.env_start,
(unsigned long) data.proc_segment.env_end);
#else
printf ("Proc_Segment PID %5d (0x%08lx): " printf ("Proc_Segment PID %5d (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu\n", (int) pid, "%lu %lu %lu %lu %lu %lu %lu %lu\n", (int) pid,
(unsigned long) data.proc_segment.flags, (unsigned long) data.proc_segment.flags,
@@ -288,6 +357,7 @@ main (int argc, char *argv [])
(unsigned long) data.proc_segment.start_code, (unsigned long) data.proc_segment.start_code,
(unsigned long) data.proc_segment.end_code, (unsigned long) data.proc_segment.end_code,
(unsigned long) data.proc_segment.start_stack); (unsigned long) data.proc_segment.start_stack);
#endif
for (c = 0; c < PROFILE_COUNT; c++) for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_time (&data.proc_time, pid); glibtop_get_proc_time (&data.proc_time, pid);
@@ -308,6 +378,19 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++) for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_signal (&data.proc_signal, pid); glibtop_get_proc_signal (&data.proc_signal, pid);
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_Signal PID %5d (0x%08lx): "
"%lx %lx %lx %lx %lx %lx %lx %lx\n", (int) pid,
(unsigned long) data.proc_signal.flags,
(unsigned long) data.proc_signal.signal [0],
(unsigned long) data.proc_signal.signal [1],
(unsigned long) data.proc_signal.blocked [0],
(unsigned long) data.proc_signal.blocked [1],
(unsigned long) data.proc_signal.sigignore [0],
(unsigned long) data.proc_signal.sigignore [1],
(unsigned long) data.proc_signal.sigcatch [0],
(unsigned long) data.proc_signal.sigcatch [1]);
#else
printf ("Proc_Signal PID %5d (0x%08lx): " printf ("Proc_Signal PID %5d (0x%08lx): "
"%lu %lu %lu %lu\n", (int) pid, "%lu %lu %lu %lu\n", (int) pid,
(unsigned long) data.proc_signal.flags, (unsigned long) data.proc_signal.flags,
@@ -315,12 +398,13 @@ main (int argc, char *argv [])
(unsigned long) data.proc_signal.blocked, (unsigned long) data.proc_signal.blocked,
(unsigned long) data.proc_signal.sigignore, (unsigned long) data.proc_signal.sigignore,
(unsigned long) data.proc_signal.sigcatch); (unsigned long) data.proc_signal.sigcatch);
#endif
for (c = 0; c < PROFILE_COUNT; c++) for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_kernel (&data.proc_kernel, pid); glibtop_get_proc_kernel (&data.proc_kernel, pid);
printf ("Proc_Kernel PID %5d (0x%08lx): " printf ("Proc_Kernel PID %5d (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu (%s)\n", (int) pid, "%lu %lu %lu %lu %lu 0x%lx 0x%lx 0x%lx (%s)\n", (int) pid,
(unsigned long) data.proc_kernel.flags, (unsigned long) data.proc_kernel.flags,
(unsigned long) data.proc_kernel.k_flags, (unsigned long) data.proc_kernel.k_flags,
(unsigned long) data.proc_kernel.min_flt, (unsigned long) data.proc_kernel.min_flt,
@@ -344,7 +428,7 @@ main (int argc, char *argv [])
printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", (int) pid, printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", (int) pid,
(unsigned long) data.proc_args.flags, (unsigned long) data.proc_args.flags,
(unsigned long) data.proc_args.size, (unsigned long) data.proc_args.size,
args); args ? args : "");
glibtop_free (args); glibtop_free (args);
@@ -353,15 +437,52 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++) for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_state (&data.proc_state, ppid); glibtop_get_proc_state (&data.proc_state, ppid);
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_State PPID %5d (0x%08lx): '%s', %u - "
"%u, %u, %u, %u - %u, %u, %u\n", (int) ppid,
(unsigned long) data.proc_state.flags,
data.proc_state.cmd, data.proc_state.state,
data.proc_state.uid, data.proc_state.gid,
data.proc_state.ruid, data.proc_state.rgid,
data.proc_state.has_cpu, data.proc_state.processor,
data.proc_state.last_processor);
#else
printf ("Proc_State PPID %5d (0x%08lx): '%s', %c, %lu, %lu\n", printf ("Proc_State PPID %5d (0x%08lx): '%s', %c, %lu, %lu\n",
(int) ppid, (unsigned long) data.proc_state.flags, (int) ppid, (unsigned long) data.proc_state.flags,
data.proc_state.cmd, data.proc_state.state, data.proc_state.cmd, data.proc_state.state,
(unsigned long) data.proc_state.uid, (unsigned long) data.proc_state.uid,
(unsigned long) data.proc_state.gid); (unsigned long) data.proc_state.gid);
#endif
for (c = 0; c < PROFILE_COUNT; c++) for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_uid (&data.proc_uid, ppid); glibtop_get_proc_uid (&data.proc_uid, ppid);
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_Uid PPID %5d (0x%08lx): "
"%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d - %d",
(int) ppid, (unsigned long) data.proc_uid.flags,
data.proc_uid.uid, data.proc_uid.euid,
data.proc_uid.gid, data.proc_uid.egid,
data.proc_uid.suid, data.proc_uid.sgid,
data.proc_uid.fsuid, data.proc_uid.fsgid,
data.proc_uid.pid, data.proc_uid.ppid,
data.proc_uid.pgrp, data.proc_uid.session,
data.proc_uid.tty, data.proc_uid.tpgid,
data.proc_uid.priority, data.proc_uid.nice,
data.proc_uid.ngroups);
if (data.proc_uid.ngroups) {
for (i = 0; i < data.proc_uid.ngroups; i++) {
if (i)
printf (" %d", data.proc_uid.groups [i]);
else
printf (" (%d", data.proc_uid.groups [i]);
}
printf (")");
}
printf ("\n");
#else
printf ("Proc_Uid PPID %5d (0x%08lx): " printf ("Proc_Uid PPID %5d (0x%08lx): "
"%d %d %d %d %d %d %d %d %d %d %d %d\n", (int) ppid, "%d %d %d %d %d %d %d %d %d %d %d %d\n", (int) ppid,
(unsigned long) data.proc_uid.flags, (unsigned long) data.proc_uid.flags,
@@ -371,6 +492,7 @@ main (int argc, char *argv [])
data.proc_uid.pgrp, data.proc_uid.session, data.proc_uid.pgrp, data.proc_uid.session,
data.proc_uid.tty, data.proc_uid.tpgid, data.proc_uid.tty, data.proc_uid.tpgid,
data.proc_uid.priority, data.proc_uid.nice); data.proc_uid.priority, data.proc_uid.nice);
#endif
for (c = 0; c < PROFILE_COUNT; c++) for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_mem (&data.proc_mem, ppid); glibtop_get_proc_mem (&data.proc_mem, ppid);
@@ -388,6 +510,30 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++) for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_segment (&data.proc_segment, ppid); glibtop_get_proc_segment (&data.proc_segment, ppid);
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_Segment PPID %5d (0x%08lx): "
"%lu %lu %lu %lu %lu 0x%lx 0x%lx 0x%lx "
"0x%lx 0x%lx 0x%lx 0x%lx 0x%lx "
"0x%lx 0x%lx 0x%lx 0x%lx\n", (int) ppid,
(unsigned long) data.proc_segment.flags,
(unsigned long) data.proc_segment.text_rss,
(unsigned long) data.proc_segment.shlib_rss,
(unsigned long) data.proc_segment.data_rss,
(unsigned long) data.proc_segment.stack_rss,
(unsigned long) data.proc_segment.dirty_size,
(unsigned long) data.proc_segment.start_code,
(unsigned long) data.proc_segment.end_code,
(unsigned long) data.proc_segment.start_data,
(unsigned long) data.proc_segment.end_data,
(unsigned long) data.proc_segment.start_brk,
(unsigned long) data.proc_segment.end_brk,
(unsigned long) data.proc_segment.start_stack,
(unsigned long) data.proc_segment.start_mmap,
(unsigned long) data.proc_segment.arg_start,
(unsigned long) data.proc_segment.arg_end,
(unsigned long) data.proc_segment.env_start,
(unsigned long) data.proc_segment.env_end);
#else
printf ("Proc_Segment PPID %5d (0x%08lx): " printf ("Proc_Segment PPID %5d (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu\n", (int) ppid, "%lu %lu %lu %lu %lu %lu %lu %lu\n", (int) ppid,
(unsigned long) data.proc_segment.flags, (unsigned long) data.proc_segment.flags,
@@ -399,6 +545,7 @@ main (int argc, char *argv [])
(unsigned long) data.proc_segment.start_code, (unsigned long) data.proc_segment.start_code,
(unsigned long) data.proc_segment.end_code, (unsigned long) data.proc_segment.end_code,
(unsigned long) data.proc_segment.start_stack); (unsigned long) data.proc_segment.start_stack);
#endif
for (c = 0; c < PROFILE_COUNT; c++) for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_time (&data.proc_time, ppid); glibtop_get_proc_time (&data.proc_time, ppid);
@@ -419,18 +566,32 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++) for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_signal (&data.proc_signal, ppid); glibtop_get_proc_signal (&data.proc_signal, ppid);
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_Signal PPID %5d (0x%08lx): "
"%lx %lx %lx %lx %lx %lx %lx %lx\n",
(int) ppid, (unsigned long) data.proc_signal.flags,
(unsigned long) data.proc_signal.signal [0],
(unsigned long) data.proc_signal.signal [1],
(unsigned long) data.proc_signal.blocked [0],
(unsigned long) data.proc_signal.blocked [1],
(unsigned long) data.proc_signal.sigignore [0],
(unsigned long) data.proc_signal.sigignore [1],
(unsigned long) data.proc_signal.sigcatch [0],
(unsigned long) data.proc_signal.sigcatch [1]);
#else
printf ("Proc_Signal PPID %5d (0x%08lx): %lu %lu %lu %lu\n", printf ("Proc_Signal PPID %5d (0x%08lx): %lu %lu %lu %lu\n",
(int) ppid, (unsigned long) data.proc_signal.flags, (int) ppid, (unsigned long) data.proc_signal.flags,
(unsigned long) data.proc_signal.signal, (unsigned long) data.proc_signal.signal,
(unsigned long) data.proc_signal.blocked, (unsigned long) data.proc_signal.blocked,
(unsigned long) data.proc_signal.sigignore, (unsigned long) data.proc_signal.sigignore,
(unsigned long) data.proc_signal.sigcatch); (unsigned long) data.proc_signal.sigcatch);
#endif
for (c = 0; c < PROFILE_COUNT; c++) for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_kernel (&data.proc_kernel, ppid); glibtop_get_proc_kernel (&data.proc_kernel, ppid);
printf ("Proc_Kernel PPID %5d (0x%08lx): " printf ("Proc_Kernel PPID %5d (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu (%s)\n", (int) ppid, "%lu %lu %lu %lu %lu 0x%lx 0x%lx 0x%lx (%s)\n", (int) ppid,
(unsigned long) data.proc_kernel.flags, (unsigned long) data.proc_kernel.flags,
(unsigned long) data.proc_kernel.k_flags, (unsigned long) data.proc_kernel.k_flags,
(unsigned long) data.proc_kernel.min_flt, (unsigned long) data.proc_kernel.min_flt,
@@ -454,7 +615,7 @@ main (int argc, char *argv [])
printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", (int) ppid, printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", (int) ppid,
(unsigned long) data.proc_args.flags, (unsigned long) data.proc_args.flags,
(unsigned long) data.proc_args.size, (unsigned long) data.proc_args.size,
args); args ? args : "");
glibtop_free (args); glibtop_free (args);
@@ -463,15 +624,52 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++) for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_state (&data.proc_state, 1); glibtop_get_proc_state (&data.proc_state, 1);
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_State INIT %5d (0x%08lx): '%s', %u - "
"%u, %u, %u, %u - %u, %u, %u\n", 1,
(unsigned long) data.proc_state.flags,
data.proc_state.cmd, data.proc_state.state,
data.proc_state.uid, data.proc_state.gid,
data.proc_state.ruid, data.proc_state.rgid,
data.proc_state.has_cpu, data.proc_state.processor,
data.proc_state.last_processor);
#else
printf ("Proc_State INIT %5d (0x%08lx): '%s', %c, %lu, %lu\n", 1, printf ("Proc_State INIT %5d (0x%08lx): '%s', %c, %lu, %lu\n", 1,
(unsigned long) data.proc_state.flags, (unsigned long) data.proc_state.flags,
data.proc_state.cmd, data.proc_state.state, data.proc_state.cmd, data.proc_state.state,
(unsigned long) data.proc_state.uid, (unsigned long) data.proc_state.uid,
(unsigned long) data.proc_state.gid); (unsigned long) data.proc_state.gid);
#endif
for (c = 0; c < PROFILE_COUNT; c++) for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_uid (&data.proc_uid, 1); glibtop_get_proc_uid (&data.proc_uid, 1);
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_Uid INIT %5d (0x%08lx): "
"%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d - %d", 1,
(unsigned long) data.proc_uid.flags,
data.proc_uid.uid, data.proc_uid.euid,
data.proc_uid.gid, data.proc_uid.egid,
data.proc_uid.suid, data.proc_uid.sgid,
data.proc_uid.fsuid, data.proc_uid.fsgid,
data.proc_uid.pid, data.proc_uid.ppid,
data.proc_uid.pgrp, data.proc_uid.session,
data.proc_uid.tty, data.proc_uid.tpgid,
data.proc_uid.priority, data.proc_uid.nice,
data.proc_uid.ngroups);
if (data.proc_uid.ngroups) {
for (i = 0; i < data.proc_uid.ngroups; i++) {
if (i)
printf (" %d", data.proc_uid.groups [i]);
else
printf (" (%d", data.proc_uid.groups [i]);
}
printf (")");
}
printf ("\n");
#else
printf ("Proc_Uid INIT %5d (0x%08lx): " printf ("Proc_Uid INIT %5d (0x%08lx): "
"%d %d %d %d %d %d %d %d %d %d %d %d\n", 1, "%d %d %d %d %d %d %d %d %d %d %d %d\n", 1,
(unsigned long) data.proc_uid.flags, (unsigned long) data.proc_uid.flags,
@@ -481,6 +679,7 @@ main (int argc, char *argv [])
data.proc_uid.pgrp, data.proc_uid.session, data.proc_uid.pgrp, data.proc_uid.session,
data.proc_uid.tty, data.proc_uid.tpgid, data.proc_uid.tty, data.proc_uid.tpgid,
data.proc_uid.priority, data.proc_uid.nice); data.proc_uid.priority, data.proc_uid.nice);
#endif
for (c = 0; c < PROFILE_COUNT; c++) for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_mem (&data.proc_mem, 1); glibtop_get_proc_mem (&data.proc_mem, 1);
@@ -498,6 +697,30 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++) for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_segment (&data.proc_segment, 1); glibtop_get_proc_segment (&data.proc_segment, 1);
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_Segment INIT %5d (0x%08lx): "
"%lu %lu %lu %lu %lu 0x%lx 0x%lx 0x%lx "
"0x%lx 0x%lx 0x%lx 0x%lx 0x%lx "
"0x%lx 0x%lx 0x%lx 0x%lx\n", 1,
(unsigned long) data.proc_segment.flags,
(unsigned long) data.proc_segment.text_rss,
(unsigned long) data.proc_segment.shlib_rss,
(unsigned long) data.proc_segment.data_rss,
(unsigned long) data.proc_segment.stack_rss,
(unsigned long) data.proc_segment.dirty_size,
(unsigned long) data.proc_segment.start_code,
(unsigned long) data.proc_segment.end_code,
(unsigned long) data.proc_segment.start_data,
(unsigned long) data.proc_segment.end_data,
(unsigned long) data.proc_segment.start_brk,
(unsigned long) data.proc_segment.end_brk,
(unsigned long) data.proc_segment.start_stack,
(unsigned long) data.proc_segment.start_mmap,
(unsigned long) data.proc_segment.arg_start,
(unsigned long) data.proc_segment.arg_end,
(unsigned long) data.proc_segment.env_start,
(unsigned long) data.proc_segment.env_end);
#else
printf ("Proc_Segment INIT %5d (0x%08lx): " printf ("Proc_Segment INIT %5d (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu\n", 1, "%lu %lu %lu %lu %lu %lu %lu %lu\n", 1,
(unsigned long) data.proc_segment.flags, (unsigned long) data.proc_segment.flags,
@@ -509,6 +732,7 @@ main (int argc, char *argv [])
(unsigned long) data.proc_segment.start_code, (unsigned long) data.proc_segment.start_code,
(unsigned long) data.proc_segment.end_code, (unsigned long) data.proc_segment.end_code,
(unsigned long) data.proc_segment.start_stack); (unsigned long) data.proc_segment.start_stack);
#endif
for (c = 0; c < PROFILE_COUNT; c++) for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_time (&data.proc_time, 1); glibtop_get_proc_time (&data.proc_time, 1);
@@ -529,6 +753,19 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++) for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_signal (&data.proc_signal, 1); glibtop_get_proc_signal (&data.proc_signal, 1);
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_Signal INIT %5d (0x%08lx): "
"%lx %lx %lx %lx %lx %lx %lx %lx\n", 1,
(unsigned long) data.proc_signal.flags,
(unsigned long) data.proc_signal.signal [0],
(unsigned long) data.proc_signal.signal [1],
(unsigned long) data.proc_signal.blocked [0],
(unsigned long) data.proc_signal.blocked [1],
(unsigned long) data.proc_signal.sigignore [0],
(unsigned long) data.proc_signal.sigignore [1],
(unsigned long) data.proc_signal.sigcatch [0],
(unsigned long) data.proc_signal.sigcatch [1]);
#else
printf ("Proc_Signal INIT %5d (0x%08lx): " printf ("Proc_Signal INIT %5d (0x%08lx): "
"%lu %lu %lu %lu\n", 1, "%lu %lu %lu %lu\n", 1,
(unsigned long) data.proc_signal.flags, (unsigned long) data.proc_signal.flags,
@@ -536,12 +773,13 @@ main (int argc, char *argv [])
(unsigned long) data.proc_signal.blocked, (unsigned long) data.proc_signal.blocked,
(unsigned long) data.proc_signal.sigignore, (unsigned long) data.proc_signal.sigignore,
(unsigned long) data.proc_signal.sigcatch); (unsigned long) data.proc_signal.sigcatch);
#endif
for (c = 0; c < PROFILE_COUNT; c++) for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_kernel (&data.proc_kernel, 1); glibtop_get_proc_kernel (&data.proc_kernel, 1);
printf ("Proc_Kernel INIT %5d (0x%08lx): " printf ("Proc_Kernel INIT %5d (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu (%s)\n", 1, "%lu %lu %lu %lu %lu 0x%lx 0x%lx 0x%lx (%s)\n", 1,
(unsigned long) data.proc_kernel.flags, (unsigned long) data.proc_kernel.flags,
(unsigned long) data.proc_kernel.k_flags, (unsigned long) data.proc_kernel.k_flags,
(unsigned long) data.proc_kernel.min_flt, (unsigned long) data.proc_kernel.min_flt,
@@ -565,7 +803,7 @@ main (int argc, char *argv [])
printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", 1, printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", 1,
(unsigned long) data.proc_args.flags, (unsigned long) data.proc_args.flags,
(unsigned long) data.proc_args.size, (unsigned long) data.proc_args.size,
args); args ? args : "");
glibtop_free (args); glibtop_free (args);

View File

@@ -43,7 +43,7 @@ int
main (int argc, char *argv []) main (int argc, char *argv [])
{ {
glibtop_netload netload; glibtop_netload netload;
unsigned method, count, port, i; unsigned method, count, port;
struct in_addr addr, subnet; struct in_addr addr, subnet;
char *address_string, *subnet_string; char *address_string, *subnet_string;
char buffer [BUFSIZ]; char buffer [BUFSIZ];

View File

@@ -97,7 +97,7 @@ main (int argc, char *argv [])
unsigned device, device_major, device_minor; unsigned device, device_major, device_minor;
char perm [5]; char perm [5];
if (maps [i].flags & (1 << GLIBTOP_MAP_ENTRY_FILENAME)) if (maps [i].flags & (1L << GLIBTOP_MAP_ENTRY_FILENAME))
filename = maps [i].filename; filename = maps [i].filename;
#ifdef GLIBTOP_INODEDB #ifdef GLIBTOP_INODEDB
@@ -116,24 +116,41 @@ main (int argc, char *argv [])
device_minor = (device & 255); device_minor = (device & 255);
device_major = ((device >> 8) & 255); device_major = ((device >> 8) & 255);
if (filename) if (filename) {
fprintf (stderr, "%08lx-%08lx %08lx - " char *format;
"%02x:%02x %08lu - %4s - %s\n",
if (sizeof (void*) == 8)
format = "%016lx-%016lx %016lx - "
"%02x:%02x %08lu - %4s - %s\n";
else
format = "%08lx-%08lx %08lx - "
"%02x:%02x %08lu - %4s - %s\n";
fprintf (stderr, format,
(unsigned long) maps [i].start, (unsigned long) maps [i].start,
(unsigned long) maps [i].end, (unsigned long) maps [i].end,
(unsigned long) maps [i].offset, (unsigned long) maps [i].offset,
device_major, device_minor, device_major, device_minor,
(unsigned long) maps [i].inode, (unsigned long) maps [i].inode,
perm, filename); perm, filename);
} else {
char * format;
if (sizeof (void*) == 8)
format = "%016lx-%016lx %016lx - "
"%02x:%02x %08lu - %4s\n";
else else
fprintf (stderr, "%08lx-%08lx %08lx - " format = "%08lx-%08lx %08lx - "
"%02x:%02x %08lu - %4s\n", "%02x:%02x %08lu - %4s\n";
fprintf (stderr, format,
(unsigned long) maps [i].start, (unsigned long) maps [i].start,
(unsigned long) maps [i].end, (unsigned long) maps [i].end,
(unsigned long) maps [i].offset, (unsigned long) maps [i].offset,
device_major, device_minor, device_major, device_minor,
(unsigned long) maps [i].inode, (unsigned long) maps [i].inode,
perm); perm);
}
if (filename && (filename != maps [i].filename)) if (filename && (filename != maps [i].filename))
glibtop_free (filename); glibtop_free (filename);

View File

@@ -31,8 +31,6 @@
#include <glibtop/union.h> #include <glibtop/union.h>
#include <glibtop/sysdeps.h> #include <glibtop/sysdeps.h>
#include <math.h>
static void static void
output (pid_t pid) output (pid_t pid)
{ {
@@ -53,15 +51,52 @@ output (pid_t pid)
glibtop_get_proc_state (&data.proc_state, pid); glibtop_get_proc_state (&data.proc_state, pid);
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_State PID %5d (0x%08lx): '%s', %u - "
"%u, %u, %u, %u - %u, %u, %u\n", (int) pid,
(unsigned long) data.proc_state.flags,
data.proc_state.cmd, data.proc_state.state,
data.proc_state.uid, data.proc_state.gid,
data.proc_state.ruid, data.proc_state.rgid,
data.proc_state.has_cpu, data.proc_state.processor,
data.proc_state.last_processor);
#else
printf ("Proc_State PID %5d (0x%08lx): " printf ("Proc_State PID %5d (0x%08lx): "
"'%s', %c, %lu, %lu\n", (int) pid, "'%s', %c, %lu, %lu\n", (int) pid,
(unsigned long) data.proc_state.flags, (unsigned long) data.proc_state.flags,
data.proc_state.cmd, data.proc_state.state, data.proc_state.cmd, data.proc_state.state,
(unsigned long) data.proc_state.uid, (unsigned long) data.proc_state.uid,
(unsigned long) data.proc_state.gid); (unsigned long) data.proc_state.gid);
#endif
glibtop_get_proc_uid (&data.proc_uid, pid); glibtop_get_proc_uid (&data.proc_uid, pid);
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_Uid PID %5d (0x%08lx): "
"%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d - %d",
(int) pid, (unsigned long) data.proc_uid.flags,
data.proc_uid.uid, data.proc_uid.euid,
data.proc_uid.gid, data.proc_uid.egid,
data.proc_uid.suid, data.proc_uid.sgid,
data.proc_uid.fsuid, data.proc_uid.fsgid,
data.proc_uid.pid, data.proc_uid.ppid,
data.proc_uid.pgrp, data.proc_uid.session,
data.proc_uid.tty, data.proc_uid.tpgid,
data.proc_uid.priority, data.proc_uid.nice,
data.proc_uid.ngroups);
if (data.proc_uid.ngroups) {
for (i = 0; i < data.proc_uid.ngroups; i++) {
if (i)
printf (" %d", data.proc_uid.groups [i]);
else
printf (" (%d", data.proc_uid.groups [i]);
}
printf (")");
}
printf ("\n");
#else
printf ("Proc_Uid PID %5d (0x%08lx): " printf ("Proc_Uid PID %5d (0x%08lx): "
"%d %d %d %d %d %d %d %d %d %d %d %d\n", (int) pid, "%d %d %d %d %d %d %d %d %d %d %d %d\n", (int) pid,
(unsigned long) data.proc_uid.flags, (unsigned long) data.proc_uid.flags,
@@ -71,6 +106,7 @@ output (pid_t pid)
data.proc_uid.pgrp, data.proc_uid.session, data.proc_uid.pgrp, data.proc_uid.session,
data.proc_uid.tty, data.proc_uid.tpgid, data.proc_uid.tty, data.proc_uid.tpgid,
data.proc_uid.priority, data.proc_uid.nice); data.proc_uid.priority, data.proc_uid.nice);
#endif
glibtop_get_proc_mem (&data.proc_mem, pid); glibtop_get_proc_mem (&data.proc_mem, pid);
@@ -86,6 +122,30 @@ output (pid_t pid)
glibtop_get_proc_segment (&data.proc_segment, pid); glibtop_get_proc_segment (&data.proc_segment, pid);
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_Segment PID %5d (0x%08lx): "
"%lu %lu %lu %lu %lu 0x%lx 0x%lx 0x%lx "
"0x%lx 0x%lx 0x%lx 0x%lx 0x%lx "
"0x%lx 0x%lx 0x%lx 0x%lx\n", (int) pid,
(unsigned long) data.proc_segment.flags,
(unsigned long) data.proc_segment.text_rss,
(unsigned long) data.proc_segment.shlib_rss,
(unsigned long) data.proc_segment.data_rss,
(unsigned long) data.proc_segment.stack_rss,
(unsigned long) data.proc_segment.dirty_size,
(unsigned long) data.proc_segment.start_code,
(unsigned long) data.proc_segment.end_code,
(unsigned long) data.proc_segment.start_data,
(unsigned long) data.proc_segment.end_data,
(unsigned long) data.proc_segment.start_brk,
(unsigned long) data.proc_segment.end_brk,
(unsigned long) data.proc_segment.start_stack,
(unsigned long) data.proc_segment.start_mmap,
(unsigned long) data.proc_segment.arg_start,
(unsigned long) data.proc_segment.arg_end,
(unsigned long) data.proc_segment.env_start,
(unsigned long) data.proc_segment.env_end);
#else
printf ("Proc_Segment PID %5d (0x%08lx): " printf ("Proc_Segment PID %5d (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu\n", (int) pid, "%lu %lu %lu %lu %lu %lu %lu %lu\n", (int) pid,
(unsigned long) data.proc_segment.flags, (unsigned long) data.proc_segment.flags,
@@ -97,6 +157,7 @@ output (pid_t pid)
(unsigned long) data.proc_segment.start_code, (unsigned long) data.proc_segment.start_code,
(unsigned long) data.proc_segment.end_code, (unsigned long) data.proc_segment.end_code,
(unsigned long) data.proc_segment.start_stack); (unsigned long) data.proc_segment.start_stack);
#endif
glibtop_get_proc_time (&data.proc_time, pid); glibtop_get_proc_time (&data.proc_time, pid);
@@ -115,6 +176,19 @@ output (pid_t pid)
glibtop_get_proc_signal (&data.proc_signal, pid); glibtop_get_proc_signal (&data.proc_signal, pid);
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_Signal PID %5d (0x%08lx): "
"%lx %lx %lx %lx %lx %lx %lx %lx\n", (int) pid,
(unsigned long) data.proc_signal.flags,
(unsigned long) data.proc_signal.signal [0],
(unsigned long) data.proc_signal.signal [1],
(unsigned long) data.proc_signal.blocked [0],
(unsigned long) data.proc_signal.blocked [1],
(unsigned long) data.proc_signal.sigignore [0],
(unsigned long) data.proc_signal.sigignore [1],
(unsigned long) data.proc_signal.sigcatch [0],
(unsigned long) data.proc_signal.sigcatch [1]);
#else
printf ("Proc_Signal PID %5d (0x%08lx): " printf ("Proc_Signal PID %5d (0x%08lx): "
"%lu %lu %lu %lu\n", (int) pid, "%lu %lu %lu %lu\n", (int) pid,
(unsigned long) data.proc_signal.flags, (unsigned long) data.proc_signal.flags,
@@ -122,11 +196,12 @@ output (pid_t pid)
(unsigned long) data.proc_signal.blocked, (unsigned long) data.proc_signal.blocked,
(unsigned long) data.proc_signal.sigignore, (unsigned long) data.proc_signal.sigignore,
(unsigned long) data.proc_signal.sigcatch); (unsigned long) data.proc_signal.sigcatch);
#endif
glibtop_get_proc_kernel (&data.proc_kernel, pid); glibtop_get_proc_kernel (&data.proc_kernel, pid);
printf ("Proc_Kernel PID %5d (0x%08lx): " printf ("Proc_Kernel PID %5d (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu (%s)\n", (int) pid, "%lu %lu %lu %lu %lu 0x%lx 0x%lx 0x%lx (%s)\n", (int) pid,
(unsigned long) data.proc_kernel.flags, (unsigned long) data.proc_kernel.flags,
(unsigned long) data.proc_kernel.k_flags, (unsigned long) data.proc_kernel.k_flags,
(unsigned long) data.proc_kernel.min_flt, (unsigned long) data.proc_kernel.min_flt,
@@ -150,7 +225,7 @@ output (pid_t pid)
printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", (int) pid, printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", (int) pid,
(unsigned long) data.proc_args.flags, (unsigned long) data.proc_args.flags,
(unsigned long) data.proc_args.size, (unsigned long) data.proc_args.size,
args); args ? args : "");
glibtop_free (args); glibtop_free (args);

View File

@@ -27,8 +27,6 @@
#include <glibtop/cpu.h> #include <glibtop/cpu.h>
#include <glibtop/xmalloc.h> #include <glibtop/xmalloc.h>
#include <math.h>
int int
main (int argc, char *argv []) main (int argc, char *argv [])
{ {
@@ -67,7 +65,7 @@ main (int argc, char *argv [])
memset (separator, '-', 91); memset (separator, '-', 91);
separator [92] = '\0'; separator [92] = '\0';
sprintf (buffer, _("Ticks (%d per second):"), frequency); sprintf (buffer, _("Ticks (%ld per second):"), frequency);
printf ("\n\n%-26s %12s %12s %12s %12s %12s\n%s\n", buffer, printf ("\n\n%-26s %12s %12s %12s %12s %12s\n%s\n", buffer,
_("Total"), _("User"), _("Nice"), _("Sys"), _("Idle"), separator); _("Total"), _("User"), _("Nice"), _("Sys"), _("Idle"), separator);

View File

@@ -38,7 +38,7 @@ int
main (int argc, char *argv []) main (int argc, char *argv [])
{ {
glibtop_sysdeps sysdeps; glibtop_sysdeps sysdeps;
unsigned method, count, port, i; unsigned method, count, port;
char buffer [BUFSIZ]; char buffer [BUFSIZ];
count = PROFILE_COUNT; count = PROFILE_COUNT;
@@ -69,10 +69,13 @@ main (int argc, char *argv [])
glibtop_get_sysdeps (&sysdeps); glibtop_get_sysdeps (&sysdeps);
#define FEATURE_CHECK(f) ((sysdeps.features & (1 << GLIBTOP_SYSDEPS_##f##)) ? 1 : 0) #define FEATURE_CHECK(f) ((sysdeps.features & (1L << GLIBTOP_SYSDEPS_##f##)) ? 1 : 0)
printf ("Sysdeps (0x%08lx):\n\n" printf ("Sysdeps (0x%08lx):\n\n"
"\tfeatures:\t\t0x%08lx\n\n" "\tfeatures:\t\t0x%08lx\n\n"
#if LIBGTOP_VERSION_CODE > 1001000
"\tpointer_size:\t\t0x%08lx\n\n"
#endif
"\tcpu:\t\t%d\t0x%08lx\n" "\tcpu:\t\t%d\t0x%08lx\n"
"\tmem:\t\t%d\t0x%08lx\n" "\tmem:\t\t%d\t0x%08lx\n"
"\tswap:\t\t%d\t0x%08lx\n\n" "\tswap:\t\t%d\t0x%08lx\n\n"
@@ -97,6 +100,9 @@ main (int argc, char *argv [])
"\tppp:\t\t%d\t0x%08lx\n\n", "\tppp:\t\t%d\t0x%08lx\n\n",
(unsigned long) sysdeps.flags, (unsigned long) sysdeps.flags,
(unsigned long) sysdeps.features, (unsigned long) sysdeps.features,
#if LIBGTOP_VERSION_CODE > 1001000
(unsigned long) sysdeps.pointer_size,
#endif
FEATURE_CHECK(CPU), FEATURE_CHECK(CPU),
(unsigned long) sysdeps.cpu, (unsigned long) sysdeps.cpu,
FEATURE_CHECK(MEM), FEATURE_CHECK(MEM),

357
examples/timings.c Normal file
View File

@@ -0,0 +1,357 @@
/* $Id$ */
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <locale.h>
#include <glibtop.h>
#include <glibtop/open.h>
#include <glibtop/close.h>
#include <glibtop/xmalloc.h>
#include <glibtop/parameter.h>
#include <glibtop/union.h>
#include <glibtop/sysdeps.h>
#include <sys/times.h>
#include <sys/resource.h>
#ifndef PROFILE_COUNT
#define PROFILE_COUNT 100000L
#endif
#ifndef PROFILE_COUNT_EXPENSIVE
#define PROFILE_COUNT_EXPENSIVE 10000L
#endif
#define ELAPSED_UTIME ((unsigned long) elapsed_utime.tv_sec * 1000000 + (unsigned long) elapsed_utime.tv_usec)
#define ELAPSED_STIME ((unsigned long) elapsed_stime.tv_sec * 1000000 + (unsigned long) elapsed_stime.tv_usec)
#define libgtop_timeradd(tvp, uvp, vvp) \
do { \
(vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \
(vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \
if ((vvp)->tv_usec >= 1000000) { \
(vvp)->tv_sec++; \
(vvp)->tv_usec -= 1000000; \
} \
} while (0)
#define libgtop_timersub(tvp, uvp, vvp) \
do { \
(vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \
(vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
if ((vvp)->tv_usec < 0) { \
(vvp)->tv_sec--; \
(vvp)->tv_usec += 1000000; \
} \
} while (0)
int
main (int argc, char *argv [])
{
glibtop_union data;
unsigned c, count, *ptr;
struct rusage total_start, total_end;
struct rusage rusage_start, rusage_end;
struct timeval elapsed_utime, elapsed_stime;
pid_t pid;
count = PROFILE_COUNT;
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, GTOPLOCALEDIR);
textdomain (PACKAGE);
printf ("%-12s (%-10s): %7s - %9s - %9s\n",
"Feature", "Flags", "Count", "utime", "stime");
printf ("-------------------------------------------"
"---------------\n");
glibtop_init_r (&glibtop_global_server, 0, 0);
getrusage (RUSAGE_SELF, &total_start);
getrusage (RUSAGE_SELF, &rusage_start);
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_cpu (&data.cpu);
getrusage (RUSAGE_SELF, &rusage_end);
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
&elapsed_stime);
printf ("CPU (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
(unsigned long) data.cpu.flags, PROFILE_COUNT,
(long double) ELAPSED_UTIME / PROFILE_COUNT,
(long double) ELAPSED_STIME / PROFILE_COUNT);
getrusage (RUSAGE_SELF, &rusage_start);
for (c = 0; c < PROFILE_COUNT_EXPENSIVE; c++)
glibtop_get_mem (&data.mem);
getrusage (RUSAGE_SELF, &rusage_end);
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
&elapsed_stime);
printf ("Memory (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
(unsigned long) data.mem.flags, PROFILE_COUNT_EXPENSIVE,
(long double) ELAPSED_UTIME / PROFILE_COUNT_EXPENSIVE,
(long double) ELAPSED_STIME / PROFILE_COUNT_EXPENSIVE);
getrusage (RUSAGE_SELF, &rusage_start);
for (c = 0; c < PROFILE_COUNT_EXPENSIVE; c++)
glibtop_get_swap (&data.swap);
getrusage (RUSAGE_SELF, &rusage_end);
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
&elapsed_stime);
printf ("Swap (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
(unsigned long) data.swap.flags, PROFILE_COUNT_EXPENSIVE,
(long double) ELAPSED_UTIME / PROFILE_COUNT_EXPENSIVE,
(long double) ELAPSED_STIME / PROFILE_COUNT_EXPENSIVE);
getrusage (RUSAGE_SELF, &rusage_start);
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_uptime (&data.uptime);
getrusage (RUSAGE_SELF, &rusage_end);
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
&elapsed_stime);
printf ("Uptime (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
(unsigned long) data.uptime.flags, PROFILE_COUNT,
(long double) ELAPSED_UTIME / PROFILE_COUNT,
(long double) ELAPSED_STIME / PROFILE_COUNT);
getrusage (RUSAGE_SELF, &rusage_start);
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_loadavg (&data.loadavg);
getrusage (RUSAGE_SELF, &rusage_end);
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
&elapsed_stime);
printf ("Loadavg (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
(unsigned long) data.loadavg.flags, PROFILE_COUNT,
(long double) ELAPSED_UTIME / PROFILE_COUNT,
(long double) ELAPSED_STIME / PROFILE_COUNT);
printf ("\n");
getrusage (RUSAGE_SELF, &rusage_start);
for (c = 0; c < PROFILE_COUNT_EXPENSIVE; c++) {
ptr = glibtop_get_proclist (&data.proclist, 0, 0);
glibtop_free (ptr);
}
getrusage (RUSAGE_SELF, &rusage_end);
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
&elapsed_stime);
printf ("Proclist (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
(unsigned long) data.proclist.flags,
PROFILE_COUNT_EXPENSIVE,
(long double) ELAPSED_UTIME / PROFILE_COUNT_EXPENSIVE,
(long double) ELAPSED_STIME / PROFILE_COUNT_EXPENSIVE);
pid = getpid ();
printf ("\n");
getrusage (RUSAGE_SELF, &rusage_start);
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_state (&data.proc_state, pid);
getrusage (RUSAGE_SELF, &rusage_end);
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
&elapsed_stime);
printf ("Proc_State (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
(unsigned long) data.proc_state.flags, PROFILE_COUNT,
(long double) ELAPSED_UTIME / PROFILE_COUNT,
(long double) ELAPSED_STIME / PROFILE_COUNT);
getrusage (RUSAGE_SELF, &rusage_start);
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_uid (&data.proc_uid, pid);
getrusage (RUSAGE_SELF, &rusage_end);
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
&elapsed_stime);
printf ("Proc_Uid (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
(unsigned long) data.proc_uid.flags, PROFILE_COUNT,
(long double) ELAPSED_UTIME / PROFILE_COUNT,
(long double) ELAPSED_STIME / PROFILE_COUNT);
getrusage (RUSAGE_SELF, &rusage_start);
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_mem (&data.proc_mem, pid);
getrusage (RUSAGE_SELF, &rusage_end);
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
&elapsed_stime);
printf ("Proc_Mem (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
(unsigned long) data.proc_mem.flags, PROFILE_COUNT,
(long double) ELAPSED_UTIME / PROFILE_COUNT,
(long double) ELAPSED_STIME / PROFILE_COUNT);
getrusage (RUSAGE_SELF, &rusage_start);
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_segment (&data.proc_segment, pid);
getrusage (RUSAGE_SELF, &rusage_end);
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
&elapsed_stime);
printf ("Proc_Segment (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
(unsigned long) data.proc_segment.flags, PROFILE_COUNT,
(long double) ELAPSED_UTIME / PROFILE_COUNT,
(long double) ELAPSED_STIME / PROFILE_COUNT);
getrusage (RUSAGE_SELF, &rusage_start);
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_time (&data.proc_time, pid);
getrusage (RUSAGE_SELF, &rusage_end);
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
&elapsed_stime);
printf ("Proc_Time (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
(unsigned long) data.proc_time.flags, PROFILE_COUNT,
(long double) ELAPSED_UTIME / PROFILE_COUNT,
(long double) ELAPSED_STIME / PROFILE_COUNT);
getrusage (RUSAGE_SELF, &rusage_start);
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_signal (&data.proc_signal, pid);
getrusage (RUSAGE_SELF, &rusage_end);
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
&elapsed_stime);
printf ("Proc_Signal (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
(unsigned long) data.proc_signal.flags, PROFILE_COUNT,
(long double) ELAPSED_UTIME / PROFILE_COUNT,
(long double) ELAPSED_STIME / PROFILE_COUNT);
getrusage (RUSAGE_SELF, &rusage_start);
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_kernel (&data.proc_kernel, pid);
getrusage (RUSAGE_SELF, &rusage_end);
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
&elapsed_stime);
printf ("Proc_Kernel (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
(unsigned long) data.proc_kernel.flags, PROFILE_COUNT,
(long double) ELAPSED_UTIME / PROFILE_COUNT,
(long double) ELAPSED_STIME / PROFILE_COUNT);
getrusage (RUSAGE_SELF, &total_end);
libgtop_timersub (&total_end.ru_utime, &total_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&total_end.ru_stime, &total_start.ru_stime,
&elapsed_stime);
printf ("-------------------------------------------"
"---------------\n");
printf ("%-36s %9lu - %9lu\n\n", "TOTAL",
ELAPSED_UTIME, ELAPSED_STIME);
printf ("All timings are in clock ticks "
"(1000000 ticks per second).\n\n");
glibtop_close ();
exit (0);
}

View File

@@ -28,13 +28,22 @@
BEGIN_LIBGTOP_DECLS BEGIN_LIBGTOP_DECLS
#ifndef G_GNUC_UNUSED
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
#define G_GNUC_UNUSED \
__attribute__((unused))
#else /* !__GNUC__ */
#define G_GNUC_UNUSED
#endif /* !__GNUC__ */
#endif /* defined G_GNUC_UNUSED */
void glibtop_error_vr (glibtop *server, char *format, va_list args); void glibtop_error_vr (glibtop *server, char *format, va_list args);
void glibtop_warn_vr (glibtop *server, char *format, va_list args); void glibtop_warn_vr (glibtop *server, char *format, va_list args);
void glibtop_error_io_vr (glibtop *server, char *format, int, va_list args); void glibtop_error_io_vr (glibtop *server, char *format, int, va_list args);
void glibtop_warn_io_vr (glibtop *server, char *format, int, va_list args); void glibtop_warn_io_vr (glibtop *server, char *format, int, va_list args);
static void static void G_GNUC_UNUSED
glibtop_error_r (glibtop *server, char *format, ...) glibtop_error_r (glibtop *server, char *format, ...)
{ {
va_list args; va_list args;
@@ -44,7 +53,7 @@ glibtop_error_r (glibtop *server, char *format, ...)
va_end (args); va_end (args);
} }
static void static void G_GNUC_UNUSED
glibtop_warn_r (glibtop *server, char *format, ...) glibtop_warn_r (glibtop *server, char *format, ...)
{ {
va_list args; va_list args;
@@ -54,7 +63,7 @@ glibtop_warn_r (glibtop *server, char *format, ...)
va_end (args); va_end (args);
} }
static void static void G_GNUC_UNUSED
glibtop_error_io_r (glibtop *server, char *format, ...) glibtop_error_io_r (glibtop *server, char *format, ...)
{ {
va_list args; va_list args;
@@ -64,7 +73,7 @@ glibtop_error_io_r (glibtop *server, char *format, ...)
va_end (args); va_end (args);
} }
static void static void G_GNUC_UNUSED
glibtop_warn_io_r (glibtop *server, char *format, ...) glibtop_warn_io_r (glibtop *server, char *format, ...)
{ {
va_list args; va_list args;

38
include/glibtop/limits.h Normal file
View File

@@ -0,0 +1,38 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* $Id$ */
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_LIMITS_H__
#define __GLIBTOP_LIMITS_H__
#include <glibtop/global.h>
BEGIN_LIBGTOP_DECLS
/* Nobody should really be using more than 64 processors. */
#define GLIBTOP_NCPU 64
END_LIBGTOP_DECLS
#endif

1
kernel/sysctl/.cvsignore Normal file
View File

@@ -0,0 +1 @@
*.flags

22
kernel/sysctl/Makefile Normal file
View File

@@ -0,0 +1,22 @@
#
# Makefile for the LibGTop linux sysctl interface.
#
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
# Note 2! The CFLAGS definition is now in the main makefile...
O_TARGET := kernel.o
ifeq ($(CONFIG_LIBGTOP),y)
O_OJBS := main.o libgtop.o
else
O_OBJS := main.o
endif
OX_OBJS := libgtop_syms.o
ifeq ($(CONFIG_LIBGTOP),m)
M_OBJS := libgtop.o
endif
include $(TOPDIR)/Rules.make

1268
kernel/sysctl/libgtop.c Normal file

File diff suppressed because it is too large Load Diff

242
kernel/sysctl/libgtop.h Normal file
View File

@@ -0,0 +1,242 @@
#ifndef _LINUX_LIBGTOP_H
#define _LINUX_LIBGTOP_H 1
#include <linux/tasks.h>
enum {
LIBGTOP_VERSION = 1,
LIBGTOP_UPDATE_EXPENSIVE,
LIBGTOP_STAT = 101,
LIBGTOP_MEM,
LIBGTOP_SWAP,
LIBGTOP_PROCLIST = 201,
LIBGTOP_PROC_STATE = 211,
LIBGTOP_PROC_KERNEL,
LIBGTOP_PROC_SEGMENT,
LIBGTOP_PROC_MEM,
LIBGTOP_PROC_SIGNAL,
LIBGTOP_PROC_ARGS = 251,
LIBGTOP_PROC_MAPS,
LIBGTOP_NETLOAD = 301
};
enum {
LIBGTOP_PROCLIST_ALL = 0,
LIBGTOP_PROCLIST_PID,
LIBGTOP_PROCLIST_PGRP,
LIBGTOP_PROCLIST_SESSION,
LIBGTOP_PROCLIST_TTY,
LIBGTOP_PROCLIST_UID,
LIBGTOP_PROCLIST_RUID
};
#define LIBGTOP_NSIG 4
#define LIBGTOP_PROCLIST_MASK 15
#define LIBGTOP_MAX_GROUPS 32
#define LIBGTOP_EXCLUDE_IDLE 0x1000
#define LIBGTOP_EXCLUDE_SYSTEM 0x2000
#define LIBGTOP_EXCLUDE_NOTTY 0x4000
#define LIBGTOP_TASK_RUNNING 1
#define LIBGTOP_TASK_INTERRUPTIBLE 2
#define LIBGTOP_TASK_UNINTERRUPTIBLE 4
#define LIBGTOP_TASK_ZOMBIE 8
#define LIBGTOP_TASK_STOPPED 16
#define LIBGTOP_TASK_SWAPPING 32
#define LIBGTOP_VM_READ 0x0001 /* currently active flags */
#define LIBGTOP_VM_WRITE 0x0002
#define LIBGTOP_VM_EXEC 0x0004
#define LIBGTOP_VM_SHARED 0x0008
#define LIBGTOP_VM_MAYREAD 0x0010 /* limits for mprotect() etc */
#define LIBGTOP_VM_MAYWRITE 0x0020
#define LIBGTOP_VM_MAYEXEC 0x0040
#define LIBGTOP_VM_MAYSHARE 0x0080
#define LIBGTOP_VM_GROWSDOWN 0x0100 /* general info on the segment */
#define LIBGTOP_VM_GROWSUP 0x0200
#define LIBGTOP_VM_SHM 0x0400 /* shared memory area, don't swap out */
#define LIBGTOP_VM_DENYWRITE 0x0800 /* ETXTBSY on write attempts.. */
#define LIBGTOP_VM_EXECUTABLE 0x1000
#define LIBGTOP_VM_LOCKED 0x2000
#define LIBGTOP_VM_IO 0x4000 /* Memory mapped I/O or similar */
#define LIBGTOP_MAP_PATH_LEN (PAGE_SIZE - sizeof (libgtop_proc_maps_header_t))
#ifndef min
#define min(a,b) ((a < b) ? a : b)
#endif
typedef struct libgtop_stat libgtop_stat_t;
typedef struct libgtop_cpu libgtop_cpu_t;
typedef struct libgtop_mem libgtop_mem_t;
typedef struct libgtop_swap libgtop_swap_t;
typedef struct libgtop_proclist libgtop_proclist_t;
typedef struct libgtop_proc_state libgtop_proc_state_t;
typedef struct libgtop_proc_kernel libgtop_proc_kernel_t;
typedef struct libgtop_proc_segment libgtop_proc_segment_t;
typedef struct libgtop_proc_mem libgtop_proc_mem_t;
typedef struct libgtop_proc_signal libgtop_proc_signal_t;
typedef struct libgtop_proc_maps_header libgtop_proc_maps_header_t;
typedef struct libgtop_proc_maps libgtop_proc_maps_t;
typedef struct libgtop_netload libgtop_netload_t;
struct libgtop_cpu
{
unsigned long total; /* Total CPU Time */
unsigned long user; /* CPU Time in User Mode */
unsigned long nice; /* CPU Time in User Mode (nice) */
unsigned long sys; /* CPU Time in System Mode */
unsigned long idle; /* CPU Time in the Idle Task */
};
struct libgtop_mem
{
unsigned long totalram; /* Total usable main memory size */
unsigned long freeram; /* Available memory size */
unsigned long sharedram; /* Amount of shared memory */
unsigned long bufferram; /* Memory used by buffers */
unsigned long cachedram;
};
struct libgtop_swap
{
unsigned long totalswap; /* Total swap space size */
unsigned long freeswap; /* swap space still available */
};
struct libgtop_proclist
{
int count;
int nr_running, nr_tasks, last_pid;
unsigned pids [NR_TASKS];
};
struct libgtop_stat
{
int ncpu; /* Number of CPUs */
unsigned long frequency; /* Tick frequency (HZ) */
libgtop_cpu_t cpu; /* CPU statistics */
libgtop_cpu_t xcpu [NR_CPUS]; /* SMP per-CPU statistics */
double loadavg [3]; /* Load average */
unsigned long total_forks; /* Total # of forks */
unsigned int context_swtch; /* Total # of context switches */
unsigned long boot_time; /* Boot time (seconds s. epoch) */
unsigned int pgpgin, pgpgout; /* # of pages paged in/out */
unsigned int pswpin, pswpout; /* # of swap pgs brought in/out */
};
struct libgtop_proc_state
{
long state;
unsigned long flags;
char comm [16];
int uid, euid, suid, fsuid;
int gid, egid, sgid, fsgid;
int pid, pgrp, ppid;
int session;
unsigned int tty;
int tpgid;
long priority, counter, def_priority;
long utime, stime, cutime, cstime, start_time;
long per_cpu_utime [NR_CPUS], per_cpu_stime [NR_CPUS];
int has_cpu, processor, last_processor;
unsigned long context;
unsigned long start_code, end_code, start_data, end_data;
unsigned long start_brk, brk, start_stack, start_mmap;
unsigned long arg_start, arg_end, env_start, env_end;
unsigned long rss, rlim, total_vm, locked_vm;
unsigned long policy, rt_priority;
unsigned long it_real_value, it_prof_value, it_virt_value;
unsigned long it_real_incr, it_prof_incr, it_virt_incr;
unsigned long keip, kesp;
unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt;
unsigned long nswap, cnswap;
int ngroups, groups [LIBGTOP_MAX_GROUPS];
};
struct libgtop_proc_kernel
{
unsigned long wchan;
};
struct libgtop_proc_segment
{
unsigned long vsize, data, exec, stack, lib;
};
struct libgtop_proc_mem
{
libgtop_proc_segment_t segment;
int size, resident, share, trs, lrs, drs, dt;
unsigned long rss, rlim;
};
struct libgtop_proc_signal
{
unsigned long signal [LIBGTOP_NSIG];
unsigned long blocked [LIBGTOP_NSIG];
unsigned long ignore [LIBGTOP_NSIG];
unsigned long catch [LIBGTOP_NSIG];
};
struct libgtop_proc_maps_header
{
unsigned long start, end, offset, perm;
off_t filename_offset;
ino_t inode;
dev_t device;
} __attribute__ ((aligned (64)));
struct libgtop_proc_maps
{
libgtop_proc_maps_header_t header;
char filename [LIBGTOP_MAP_PATH_LEN];
};
struct libgtop_netload
{
unsigned long rx_packets; /* total packets received */
unsigned long tx_packets; /* total packets transmitted */
unsigned long rx_bytes; /* total bytes received */
unsigned long tx_bytes; /* total bytes transmitted */
unsigned long rx_errors; /* bad packets received */
unsigned long tx_errors; /* packet transmit problems */
unsigned long rx_dropped; /* no space in linux buffers */
unsigned long tx_dropped; /* no space available in linux */
unsigned long multicast; /* multicast packets received */
unsigned long collisions;
/* detailed rx_errors: */
unsigned long rx_length_errors;
unsigned long rx_over_errors; /* receiver ring buff overflow */
unsigned long rx_crc_errors; /* recved pkt with crc error */
unsigned long rx_frame_errors; /* recv'd frame alignment error */
unsigned long rx_fifo_errors; /* recv'r fifo overrun */
unsigned long rx_missed_errors; /* receiver missed packet */
/* detailed tx_errors */
unsigned long tx_aborted_errors;
unsigned long tx_carrier_errors;
unsigned long tx_fifo_errors;
unsigned long tx_heartbeat_errors;
unsigned long tx_window_errors;
/* for cslip etc */
unsigned long rx_compressed;
unsigned long tx_compressed;
};
#endif

View File

@@ -0,0 +1,30 @@
/*
* linux/libgtop/libgtop_syms.c
* Copyright (C) 1999 Martin Baulig
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/pagemap.h>
#include <linux/swap.h>
extern unsigned long total_forks;
EXPORT_SYMBOL(task);
EXPORT_SYMBOL(init_mm);
EXPORT_SYMBOL(pidhash);
EXPORT_SYMBOL(avenrun);
EXPORT_SYMBOL(nr_running);
EXPORT_SYMBOL(nr_tasks);
EXPORT_SYMBOL(last_pid);
EXPORT_SYMBOL(total_forks);
EXPORT_SYMBOL(si_swapinfo);
extern void scheduling_functions_start_here(void);
extern void scheduling_functions_end_here(void);
EXPORT_SYMBOL(scheduling_functions_start_here);
EXPORT_SYMBOL(scheduling_functions_end_here);

4
kernel/sysctl/main.c Normal file
View File

@@ -0,0 +1,4 @@
/*
* linux/libgtop/main.c
* Copyright (C) 1999 Martin Baulig
*/

81
kernel/sysctl/patch-2.2.1 Normal file
View File

@@ -0,0 +1,81 @@
diff -ru linux-2.2.1/Makefile hacker/Makefile
--- linux-2.2.1/Makefile Sun Jan 31 22:45:42 1999
+++ hacker/Makefile Sun Mar 21 16:10:41 1999
@@ -109,6 +109,7 @@
DRIVERS =drivers/block/block.a \
drivers/char/char.a \
drivers/misc/misc.a
+EXTRAS =
LIBS =$(TOPDIR)/lib/lib.a
SUBDIRS =kernel drivers mm fs net ipc lib
@@ -186,6 +187,11 @@
DRIVERS := $(DRIVERS) drivers/net/irda/irda_drivers.a
endif
+ifdef CONFIG_LIBGTOP
+SUBDIRS := $(SUBDIRS) libgtop
+EXTRAS := $(EXTRAS) libgtop/kernel.o
+endif
+
include arch/$(ARCH)/Makefile
.S.s:
@@ -206,6 +212,7 @@
$(FILESYSTEMS) \
$(NETWORKS) \
$(DRIVERS) \
+ $(EXTRAS) \
$(LIBS) \
--end-group \
-o vmlinux
diff -ru linux-2.2.1/arch/i386/config.in hacker/arch/i386/config.in
--- linux-2.2.1/arch/i386/config.in Sun Jan 31 22:25:25 1999
+++ hacker/arch/i386/config.in Sat Mar 20 18:26:18 1999
@@ -84,6 +84,9 @@
bool 'System V IPC' CONFIG_SYSVIPC
bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT
bool 'Sysctl support' CONFIG_SYSCTL
+if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+ tristate 'LibGTop support' CONFIG_LIBGTOP
+fi
tristate 'Kernel support for a.out binaries' CONFIG_BINFMT_AOUT
tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
diff -ru linux-2.2.1/include/linux/sysctl.h hacker/include/linux/sysctl.h
--- linux-2.2.1/include/linux/sysctl.h Sun Jan 31 22:24:14 1999
+++ hacker/include/linux/sysctl.h Sat Mar 20 19:12:54 1999
@@ -56,7 +56,8 @@
CTL_PROC=4, /* Process info */
CTL_FS=5, /* Filesystems */
CTL_DEBUG=6, /* Debugging */
- CTL_DEV=7 /* Devices */
+ CTL_DEV=7, /* Devices */
+ CTL_LIBGTOP=408 /* LibGTop */
};
diff -ru linux-2.2.1/kernel/sysctl.c hacker/kernel/sysctl.c
--- linux-2.2.1/kernel/sysctl.c Sun Jan 31 22:24:43 1999
+++ hacker/kernel/sysctl.c Sat Mar 20 19:24:34 1999
@@ -82,7 +82,9 @@
static ctl_table fs_table[];
static ctl_table debug_table[];
static ctl_table dev_table[];
-
+#ifdef CONFIG_LIBGTOP
+extern ctl_table libgtop_table[];
+#endif
/* /proc declarations: */
@@ -148,6 +150,9 @@
{CTL_FS, "fs", NULL, 0, 0555, fs_table},
{CTL_DEBUG, "debug", NULL, 0, 0555, debug_table},
{CTL_DEV, "dev", NULL, 0, 0555, dev_table},
+#ifdef CONFIG_LIBGTOP
+ {CTL_LIBGTOP, "libgtop", NULL, 0, 0555, libgtop_table},
+#endif
{0}
};

View File

@@ -36,20 +36,26 @@ print 'static void';
print '_glibtop_missing_feature (glibtop *server, const char *feature,'; print '_glibtop_missing_feature (glibtop *server, const char *feature,';
print "\t\t\t const u_int64_t present, u_int64_t *required)"; print "\t\t\t const u_int64_t present, u_int64_t *required)";
print '{'; print '{';
print "\tu_int64_t old_required = *required;\n";
print "\t/* Return if we have all required fields. */";
print "\tif ((~present & old_required) == 0)";
print "\t\treturn;\n";
print "\tswitch (server->error_method) {"; print "\tswitch (server->error_method) {";
print "\tcase GLIBTOP_ERROR_METHOD_WARN_ONCE:"; print "\tcase GLIBTOP_ERROR_METHOD_WARN_ONCE:";
print "\t\t*required &= present;"; print "\t\t*required &= present;";
print "\tcase GLIBTOP_ERROR_METHOD_WARN:"; print "\tcase GLIBTOP_ERROR_METHOD_WARN:";
print "\t\tglibtop_warn_r (server,"; print "\t\tglibtop_warn_r (server,";
print "\t\t\t\t_(\"glibtop_get_%s (): Client requested \""; print "\t\t\t\t_(\"glibtop_get_%s (): Client requested \"";
print "\t\t\t\t \"field mask %05Lx, but only have %05Lx.\"),"; print "\t\t\t\t \"field mask %05lx, but only have %05lx.\"),";
print "\t\t\t\t feature, required, present);"; print "\t\t\t\t feature, (unsigned long) old_required,";
print "\t\t\t\t (unsigned long) present);";
print "\t\tbreak;"; print "\t\tbreak;";
print "\tcase GLIBTOP_ERROR_METHOD_ABORT:"; print "\tcase GLIBTOP_ERROR_METHOD_ABORT:";
print "\t\tglibtop_error_r (server,"; print "\t\tglibtop_error_r (server,";
print "\t\t\t\t _(\"glibtop_get_%s (): Client requested \""; print "\t\t\t\t _(\"glibtop_get_%s (): Client requested \"";
print "\t\t\t\t \"field mask %05x, but only have %05x.\"),"; print "\t\t\t\t \"field mask %05lx, but only have %05lx.\"),";
print "\t\t\t\t feature, required, present);"; print "\t\t\t\t feature, (unsigned long) old_required,";
print "\t\t\t\t (unsigned long) present);";
print "\t\tbreak;"; print "\t\tbreak;";
print "\t}"; print "\t}";
print '}'; print '}';

View File

@@ -30,6 +30,7 @@ do_read (int s, void *ptr, size_t total_size)
{ {
int nread; int nread;
size_t already_read = 0, remaining = total_size; size_t already_read = 0, remaining = total_size;
char *tmp_ptr;
while (already_read < total_size) { while (already_read < total_size) {
nread = recv (s, ptr, remaining, 0); nread = recv (s, ptr, remaining, 0);
@@ -46,7 +47,10 @@ do_read (int s, void *ptr, size_t total_size)
already_read += nread; already_read += nread;
remaining -= nread; remaining -= nread;
(char *) ptr += nread; /* (char *) ptr += nread; */
tmp_ptr = ptr;
tmp_ptr += nread;
ptr = tmp_ptr;
} }
} }

View File

@@ -40,6 +40,7 @@ GLIBTOP_SUID_PROC_TIME +
GLIBTOP_SUID_PROC_SIGNAL + GLIBTOP_SUID_PROC_SIGNAL +
GLIBTOP_SUID_PROC_KERNEL + GLIBTOP_SUID_PROC_KERNEL +
GLIBTOP_SUID_PROC_SEGMENT + GLIBTOP_SUID_PROC_SEGMENT +
GLIBTOP_SUID_PROC_ARGS +
GLIBTOP_SUID_PROC_MAP + GLIBTOP_SUID_PROC_MAP +
GLIBTOP_SUID_NETLOAD + GLIBTOP_SUID_NETLOAD +
GLIBTOP_SUID_PPP; GLIBTOP_SUID_PPP;

View File

@@ -118,7 +118,7 @@ AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[
fi fi
libgtop_need_server=no libgtop_need_server=no
;; ;;
freebsd*|netbsd*|openbsd*) freebsd*|netbsd*|openbsd*|bsdi*)
libgtop_sysdeps_dir=freebsd libgtop_sysdeps_dir=freebsd
libgtop_use_machine_h=yes libgtop_use_machine_h=yes
libgtop_need_server=yes libgtop_need_server=yes
@@ -177,7 +177,7 @@ AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[
#include <net/netisr.h> #include <net/netisr.h>
#include <net/route.h> #include <net/route.h>
#ifdef __FreeBSD__ #if (defined __FreeBSD__) || (defined __NetBSD__)
#include <net/if_sppp.h> #include <net/if_sppp.h>
#else #else
#include <i4b/sppp/if_sppp.h> #include <i4b/sppp/if_sppp.h>
@@ -203,7 +203,7 @@ AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[
#include <net/netisr.h> #include <net/netisr.h>
#include <net/route.h> #include <net/route.h>
#ifdef __FreeBSD__ #if defined(__FreeBSD__) || defined(__NetBSD__)
#include <net/if_sppp.h> #include <net/if_sppp.h>
#else #else
#include <i4b/sppp/if_sppp.h> #include <i4b/sppp/if_sppp.h>

View File

@@ -1,6 +1,7 @@
# Note that this is NOT a relocatable package # Note that this is NOT a relocatable package
%define ver @VERSION@ %define ver @VERSION@
%define rel SNAP %define RELEASE SNAP
%define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE}
%define prefix /usr %define prefix /usr
Summary: LibGTop library Summary: LibGTop library
@@ -118,8 +119,9 @@ rm -rf $RPM_BUILD_ROOT
%{prefix}/lib/*.sh %{prefix}/lib/*.sh
%{prefix}/lib/*.def %{prefix}/lib/*.def
%{prefix}/include/* %{prefix}/include/*
%{prefix}/lib/libgtop
%files examples %files examples
%defattr(-,root,root) %defattr(-,root,root)
%{prefix}/libexec/libgtop/* %{prefix}/libexec/libgtop

View File

@@ -0,0 +1,26 @@
This statistics were made on a PPRO 200 running Linux 2.2.1
reading everything from /proc while the system was idle.
Feature (Flags ): Count - utime - stime
----------------------------------------------------------
CPU (0x000007ff): 100000 - 13.90 - 181.80
Memory (0x0000007f): 10000 - 32.00 - 8061.00
Swap (0x0000001f): 10000 - 46.00 - 8130.00
Uptime (0x00000003): 100000 - 19.60 - 72.20
Loadavg (0x0000000f): 100000 - 32.40 - 77.10
Proclist (0x00000007): 10000 - 2250.00 - 4419.00
Proc_State (0x0000000f): 100000 - 40.70 - 221.00
Proc_Uid (0x00000fff): 100000 - 72.40 - 327.30
Proc_Mem (0x0000003f): 100000 - 65.70 - 283.90
Proc_Segment (0x000000f5): 100000 - 76.50 - 281.10
Proc_Time (0x000001ff): 100000 - 37.00 - 160.90
Proc_Signal (0x0000000f): 100000 - 52.50 - 148.50
Proc_Kernel (0x0000017f): 100000 - 56.70 - 153.50
----------------------------------------------------------
TOTAL 70030000 - 396830000
All timings are in clock ticks (1000000 ticks per second).

View File

@@ -0,0 +1,27 @@
This statistics were made on a PPRO 200 running Linux 2.2.1
(the same machine I made the timings.linux-proc on) with my
new sysctl () based kernel module.
Feature (Flags ): Count - utime - stime
----------------------------------------------------------
CPU (0x0000003f): 100000 - 3.50 - 5.40
Memory (0x0000003f): 10000 - 3.00 - 6.00
Swap (0x0000001f): 10000 - 10.00 - 7.00
Uptime (0x00000003): 100000 - 2.30 - 7.00
Loadavg (0x00000001): 100000 - 3.00 - 5.60
Proclist (0x00000007): 10000 - 13.00 - 46.00
Proc_State (0x0000000d): 100000 - 3.20 - 7.70
Proc_Uid (0x00000fff): 100000 - 3.60 - 7.40
Proc_Mem (0x0000003f): 100000 - 4.10 - 34.30
Proc_Segment (0x000000ff): 100000 - 5.90 - 41.50
Proc_Time (0x0000013d): 100000 - 3.50 - 7.50
Proc_Signal (0x0000000f): 100000 - 2.70 - 8.80
Proc_Kernel (0x000000fe): 100000 - 4.00 - 13.30
----------------------------------------------------------
TOTAL 3840000 - 14440000
All timings are in clock ticks (1000000 ticks per second).

View File

@@ -1,3 +1,15 @@
1999-09-16 Tomas Ogren <stric@ing.umu.se>
* sv.po: Synced
1999-07-11 Kjartan Maraas <kmaraas@online.no>
* no.po: Updated translation.
1999-07-11 Tomas Ogren <stric@ing.umu.se>
* sv.po: New file
1999-01-27 Kjartan Maraas <kmaraas@fib.hl.no> 1999-01-27 Kjartan Maraas <kmaraas@fib.hl.no>
* no.po: Updated translation * no.po: Updated translation

281
po/de.po
View File

@@ -1,12 +1,11 @@
# libgtop de.po # SOME DESCRIPTIVE TITLE.
# Copyright (C) 1998 Free Software Foundation, Inc. # Copyright (C) YEAR Free Software Foundation, Inc.
# Martin Baulig <martin@home-of-linux.org>, 1998. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: libgtop VERSION\n" "Project-Id-Version: libgtop VERSION\n"
"POT-Creation-Date: 1999-02-27 22:24+0100\n" "POT-Creation-Date: 1999-09-16 23:16+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: 1999-07-11 12:44+02:00\n"
"Last-Translator: Martin Baulig <martin@home-of-linux.org>\n" "Last-Translator: Martin Baulig <martin@home-of-linux.org>\n"
"Language-Team: Martin Baulig <martin@home-of-linux.org>\n" "Language-Team: Martin Baulig <martin@home-of-linux.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@@ -297,6 +296,17 @@ msgid ""
"\n" "\n"
"The math bit should be a decimal 4, and the traced bit is decimal 10." "The math bit should be a decimal 4, and the traced bit is decimal 10."
msgstr "" msgstr ""
"Kernelflags des Prozesses.\n"
"\n"
"Auf Linux hat momentan jedes Flag ein gesetztes Math-Bit, da crt0.s\n"
"auf Mathematikemulation pr<70>ft, also wird dies in der Ausgabe nicht\n"
"ausgegeben.\n"
"\n"
"Dies ist wahrscheinlich ein Fehler, da nicht jeder Prozess ein\n"
"compiliertes C-Programm ist.\n"
"\n"
"Das Math-Bit sollte eine dezimale 4 sein, und das Traced-Bit ist\n"
"dezimal 10. "
#. Min_Flt #. Min_Flt
#: sysdeps/names/prockernel.c:59 #: sysdeps/names/prockernel.c:59
@@ -396,8 +406,8 @@ msgid "Number of pages of virtual memory"
msgstr "Anzahl virtueller Speicherseiten" msgstr "Anzahl virtueller Speicherseiten"
#: sysdeps/names/procmem.c:55 #: sysdeps/names/procmem.c:55
msgid "Number of residnet set (non-swapped) pages" msgid "Number of resident set (non-swapped) pages"
msgstr "Anzahl nichtausgelagerter Speicherseiten" msgstr "Anzahl residenter (nicht ausgelagerter) Speicherseiten"
#: sysdeps/names/procmem.c:56 #: sysdeps/names/procmem.c:56
msgid "Number of pages of shared (mmap'd) memory" msgid "Number of pages of shared (mmap'd) memory"
@@ -544,11 +554,11 @@ msgstr "Prozessstatus (S=schl
#: sysdeps/names/procstate.c:47 #: sysdeps/names/procstate.c:47
msgid "UID of process" msgid "UID of process"
msgstr "UID des Prozesses" msgstr "echte UID des Prozesses"
#: sysdeps/names/procstate.c:48 #: sysdeps/names/procstate.c:48
msgid "GID of process" msgid "GID of process"
msgstr "GID des Prozesses" msgstr "echte GID des Prozesses"
#: sysdeps/names/proctime.c:44 #: sysdeps/names/proctime.c:44
msgid "Start_Time" msgid "Start_Time"
@@ -588,11 +598,11 @@ msgstr "Frequenz"
#: sysdeps/names/proctime.c:46 #: sysdeps/names/proctime.c:46
msgid "XCPU_UTime" msgid "XCPU_UTime"
msgstr "" msgstr "XCPU_UTime"
#: sysdeps/names/proctime.c:46 #: sysdeps/names/proctime.c:46
msgid "XCPU_STime" msgid "XCPU_STime"
msgstr "" msgstr "XCPU_STime"
#: sysdeps/names/proctime.c:51 #: sysdeps/names/proctime.c:51
msgid "Start time of process in seconds since the epoch" msgid "Start time of process in seconds since the epoch"
@@ -745,63 +755,63 @@ msgstr "Standard UNIX 'nice' Wert des Prozesses"
#: sysdeps/names/sem_limits.c:42 sysdeps/names/sem_limits.c:56 #: sysdeps/names/sem_limits.c:42 sysdeps/names/sem_limits.c:56
msgid "Number of entries in semaphore map" msgid "Number of entries in semaphore map"
msgstr "" msgstr "Anzahl Eintr<74>ge in der Semaphortabelle"
#: sysdeps/names/sem_limits.c:43 sysdeps/names/sem_limits.c:57 #: sysdeps/names/sem_limits.c:43 sysdeps/names/sem_limits.c:57
msgid "Max number of arrays" msgid "Max number of arrays"
msgstr "" msgstr "Maximale Anzahl Arrays"
#: sysdeps/names/sem_limits.c:44 sysdeps/names/sem_limits.c:58 #: sysdeps/names/sem_limits.c:44 sysdeps/names/sem_limits.c:58
msgid "Max semaphores system wide" msgid "Max semaphores system wide"
msgstr "" msgstr "Maximale Anzahl Semaphore im System"
#: sysdeps/names/sem_limits.c:45 sysdeps/names/sem_limits.c:59 #: sysdeps/names/sem_limits.c:45 sysdeps/names/sem_limits.c:59
msgid "Number of undo structures system wide" msgid "Number of undo structures system wide"
msgstr "" msgstr "Anzahl Undo-Strukturen im System"
#: sysdeps/names/sem_limits.c:46 sysdeps/names/sem_limits.c:60 #: sysdeps/names/sem_limits.c:46 sysdeps/names/sem_limits.c:60
msgid "Max semaphores per array" msgid "Max semaphores per array"
msgstr "" msgstr "Maximale Anzahl Semaphore pro Array"
#: sysdeps/names/sem_limits.c:47 sysdeps/names/sem_limits.c:61 #: sysdeps/names/sem_limits.c:47 sysdeps/names/sem_limits.c:61
msgid "Max ops per semop call" msgid "Max ops per semop call"
msgstr "" msgstr "Maximale Anzahl Operationen pro semop-Aufruf"
#: sysdeps/names/sem_limits.c:48 sysdeps/names/sem_limits.c:62 #: sysdeps/names/sem_limits.c:48 sysdeps/names/sem_limits.c:62
msgid "Max number of undo entries per process" msgid "Max number of undo entries per process"
msgstr "" msgstr "Maximale Anzahl Undo-Eintr<74>ge pro Prozess"
#: sysdeps/names/sem_limits.c:49 sysdeps/names/sem_limits.c:63 #: sysdeps/names/sem_limits.c:49 sysdeps/names/sem_limits.c:63
msgid "sizeof struct sem_undo" msgid "sizeof struct sem_undo"
msgstr "" msgstr "sizeof struct sem_undo"
#: sysdeps/names/sem_limits.c:50 sysdeps/names/sem_limits.c:64 #: sysdeps/names/sem_limits.c:50 sysdeps/names/sem_limits.c:64
msgid "Semaphore max value" msgid "Semaphore max value"
msgstr "" msgstr "Semaphor-Maximalwert"
#: sysdeps/names/sem_limits.c:51 sysdeps/names/sem_limits.c:65 #: sysdeps/names/sem_limits.c:51 sysdeps/names/sem_limits.c:65
msgid "Adjust on exit max value" msgid "Adjust on exit max value"
msgstr "" msgstr "Maximaler Adjust-on-Exit-Wert"
#: sysdeps/names/shm_limits.c:39 sysdeps/names/shm_limits.c:48 #: sysdeps/names/shm_limits.c:39 sysdeps/names/shm_limits.c:48
msgid "Max segment size" msgid "Max segment size"
msgstr "" msgstr "Maximale Segmentgr<67><72>e"
#: sysdeps/names/shm_limits.c:40 sysdeps/names/shm_limits.c:49 #: sysdeps/names/shm_limits.c:40 sysdeps/names/shm_limits.c:49
msgid "Min segment size" msgid "Min segment size"
msgstr "" msgstr "Minimale Segmentgr<67><72>e"
#: sysdeps/names/shm_limits.c:41 sysdeps/names/shm_limits.c:50 #: sysdeps/names/shm_limits.c:41 sysdeps/names/shm_limits.c:50
msgid "Max number of segments" msgid "Max number of segments"
msgstr "" msgstr "Maximale Anzahl Segmente"
#: sysdeps/names/shm_limits.c:42 sysdeps/names/shm_limits.c:51 #: sysdeps/names/shm_limits.c:42 sysdeps/names/shm_limits.c:51
msgid "Max shared segments per process" msgid "Max shared segments per process"
msgstr "" msgstr "Maximale Anzahl gemeinsame Segmente pro Prozess"
#: sysdeps/names/shm_limits.c:43 sysdeps/names/shm_limits.c:52 #: sysdeps/names/shm_limits.c:43 sysdeps/names/shm_limits.c:52
msgid "Max total shared memory" msgid "Max total shared memory"
msgstr "" msgstr "Maximaler gesamter gemeinsamer Speicher"
#: sysdeps/names/swap.c:39 sysdeps/names/swap.c:48 #: sysdeps/names/swap.c:39 sysdeps/names/swap.c:48
msgid "Total Swap Space" msgid "Total Swap Space"
@@ -869,7 +879,7 @@ msgstr "Limits f
#: sysdeps/names/sysdeps.c:57 sysdeps/names/sysdeps.c:84 #: sysdeps/names/sysdeps.c:57 sysdeps/names/sysdeps.c:84
msgid "Semaphore Set Limits" msgid "Semaphore Set Limits"
msgstr "" msgstr "Semaphor-Setzbegrenzungen"
#: sysdeps/names/sysdeps.c:58 sysdeps/names/sysdeps.c:85 #: sysdeps/names/sysdeps.c:58 sysdeps/names/sysdeps.c:85
msgid "List of running Processes" msgid "List of running Processes"
@@ -889,36 +899,35 @@ msgstr "Speicherbelegung des Prozesses"
#: sysdeps/names/sysdeps.c:62 sysdeps/names/sysdeps.c:89 #: sysdeps/names/sysdeps.c:62 sysdeps/names/sysdeps.c:89
msgid "Process Time information" msgid "Process Time information"
msgstr "" msgstr "Prozess-Zeitinformation"
#: sysdeps/names/sysdeps.c:63 sysdeps/names/sysdeps.c:90 #: sysdeps/names/sysdeps.c:63 sysdeps/names/sysdeps.c:90
msgid "Process Signal information" msgid "Process Signal information"
msgstr "" msgstr "Prozess-Signalinformation"
#: sysdeps/names/sysdeps.c:64 sysdeps/names/sysdeps.c:91 #: sysdeps/names/sysdeps.c:64 sysdeps/names/sysdeps.c:91
msgid "Process Kernel Data information" msgid "Process Kernel Data information"
msgstr "" msgstr "Prozess-Kerneldateninformation"
#: sysdeps/names/sysdeps.c:65 sysdeps/names/sysdeps.c:92 #: sysdeps/names/sysdeps.c:65 sysdeps/names/sysdeps.c:92
msgid "Process Segment information" msgid "Process Segment information"
msgstr "" msgstr "Prozess-Segmentinformation"
#: sysdeps/names/sysdeps.c:66 #: sysdeps/names/sysdeps.c:66
#, fuzzy
msgid "Process Arguments" msgid "Process Arguments"
msgstr "Prozessgruppen-ID" msgstr "Prozessargumente"
#: sysdeps/names/sysdeps.c:67 sysdeps/names/sysdeps.c:94 #: sysdeps/names/sysdeps.c:67 sysdeps/names/sysdeps.c:94
msgid "Process Memory Map" msgid "Process Memory Map"
msgstr "" msgstr "Prozess-Speicherplan"
#: sysdeps/names/sysdeps.c:68 #: sysdeps/names/sysdeps.c:68
msgid "Mount List" msgid "Mount List"
msgstr "" msgstr "Mountliste"
#: sysdeps/names/sysdeps.c:69 sysdeps/names/sysdeps.c:96 #: sysdeps/names/sysdeps.c:69 sysdeps/names/sysdeps.c:96
msgid "File System Usage" msgid "File System Usage"
msgstr "" msgstr "Dateisystemnutzung"
#: sysdeps/names/sysdeps.c:70 sysdeps/names/sysdeps.c:97 #: sysdeps/names/sysdeps.c:70 sysdeps/names/sysdeps.c:97
msgid "Network Load" msgid "Network Load"
@@ -938,7 +947,7 @@ msgstr "Liste gegenw
#: sysdeps/names/uptime.c:38 #: sysdeps/names/uptime.c:38
msgid "Uptime" msgid "Uptime"
msgstr "" msgstr "Uptime"
#: sysdeps/names/uptime.c:39 #: sysdeps/names/uptime.c:39
msgid "Idletime" msgid "Idletime"
@@ -951,6 +960,7 @@ msgstr "Zeit in Sekunden seit System-Boot"
#: sysdeps/names/uptime.c:45 #: sysdeps/names/uptime.c:45
msgid "Time in seconds the system spent in the idle task since system boot" msgid "Time in seconds the system spent in the idle task since system boot"
msgstr "" msgstr ""
"Zeit in Sekunden, die das System seit dem Booten im Leerlauf verbracht hat"
#: support/error.c:109 #: support/error.c:109
msgid "Unknown system error" msgid "Unknown system error"
@@ -959,116 +969,245 @@ msgstr "Unbekannter Systemfehler"
#: support/getopt.c:669 #: support/getopt.c:669
#, c-format #, c-format
msgid "%s: option `%s' is ambiguous\n" msgid "%s: option `%s' is ambiguous\n"
msgstr "" msgstr "%s: option `%s' ist mehrdeutig\n"
#: support/getopt.c:693 #: support/getopt.c:693
#, c-format #, c-format
msgid "%s: option `--%s' doesn't allow an argument\n" msgid "%s: option `--%s' doesn't allow an argument\n"
msgstr "" msgstr "%s: option `--%s' erlaubt kein Argument\n"
#: support/getopt.c:698 #: support/getopt.c:698
#, c-format #, c-format
msgid "%s: option `%c%s' doesn't allow an argument\n" msgid "%s: option `%c%s' doesn't allow an argument\n"
msgstr "" msgstr "%s: option `%c%s' erlaubt kein Argument\n"
#: support/getopt.c:715 support/getopt.c:888 #: support/getopt.c:715 support/getopt.c:888
#, c-format #, c-format
msgid "%s: option `%s' requires an argument\n" msgid "%s: option `%s' requires an argument\n"
msgstr "" msgstr "%s: option `%s' ben<65>tigt ein Argument\n"
#. --option #. --option
#: support/getopt.c:744 #: support/getopt.c:744
#, c-format #, c-format
msgid "%s: unrecognized option `--%s'\n" msgid "%s: unrecognized option `--%s'\n"
msgstr "" msgstr "%s: unbekannte Option: `--%s'\n"
#. +option or -option #. +option or -option
#: support/getopt.c:748 #: support/getopt.c:748
#, c-format #, c-format
msgid "%s: unrecognized option `%c%s'\n" msgid "%s: unrecognized option `%c%s'\n"
msgstr "" msgstr "%s: unbekannte Option: `%c%s'\n"
#. 1003.2 specifies the format of this message. #. 1003.2 specifies the format of this message.
#: support/getopt.c:774 #: support/getopt.c:774
#, c-format #, c-format
msgid "%s: illegal option -- %c\n" msgid "%s: illegal option -- %c\n"
msgstr "" msgstr "%s: illegale Option -- %c\n"
#: support/getopt.c:777 #: support/getopt.c:777
#, c-format #, c-format
msgid "%s: invalid option -- %c\n" msgid "%s: invalid option -- %c\n"
msgstr "" msgstr "%s: ung<6E>ltige Option -- %c\n"
#. 1003.2 specifies the format of this message. #. 1003.2 specifies the format of this message.
#: support/getopt.c:807 support/getopt.c:937 #: support/getopt.c:807 support/getopt.c:937
#, c-format #, c-format
msgid "%s: option requires an argument -- %c\n" msgid "%s: option requires an argument -- %c\n"
msgstr "" msgstr "%s: option ben<65>tigt ein Argument -- %c\n"
#: support/getopt.c:854 #: support/getopt.c:854
#, c-format #, c-format
msgid "%s: option `-W %s' is ambiguous\n" msgid "%s: option `-W %s' is ambiguous\n"
msgstr "" msgstr "%s: Option `-W %s' ist mehrdeutig\n"
#: support/getopt.c:872 #: support/getopt.c:872
#, c-format #, c-format
msgid "%s: option `-W %s' doesn't allow an argument\n" msgid "%s: option `-W %s' doesn't allow an argument\n"
msgstr "" msgstr "%s: Option `-W %s' erlaubt kein Argument\n"
#: lib/read.c:71 #: lib/read.c:75
#, c-format #, c-format
msgid "read %d bytes" msgid "read %d bytes"
msgstr "" msgstr "%d bytes gelesen"
#: lib/read_data.c:49 #: lib/read_data.c:49
msgid "read data size" msgid "read data size"
msgstr "" msgstr "lese Datenmenge"
#: lib/read_data.c:66 #: lib/read_data.c:66
#, c-format #, c-format
msgid "read data %d bytes" msgid "read data %d bytes"
msgstr "" msgstr "%d Datenbytes gelesen"
#: lib/write.c:48 #: lib/write.c:48
#, c-format #, c-format
msgid "write %d bytes" msgid "write %d bytes"
msgstr "" msgstr "schreibe %d bytes"
#: src/daemon/gnuserv.c:445 #: src/daemon/gnuserv.c:446
msgid "Enable debugging" msgid "Enable debugging"
msgstr "" msgstr "Fehlerdiagnose einschalten"
#: src/daemon/gnuserv.c:445 #: src/daemon/gnuserv.c:446
msgid "DEBUG" msgid "DEBUG"
msgstr "" msgstr "DIAGNOSE"
#: src/daemon/gnuserv.c:447 #: src/daemon/gnuserv.c:448
msgid "Enable verbose output" msgid "Enable verbose output"
msgstr "" msgstr "Gespr<EFBFBD>chige Ausgabe einschalten"
#: src/daemon/gnuserv.c:447 #: src/daemon/gnuserv.c:448
msgid "VERBOSE" msgid "VERBOSE"
msgstr "" msgstr "GESPRAECHIG"
#: src/daemon/gnuserv.c:449 #: src/daemon/gnuserv.c:450
msgid "Don't fork into background" msgid "Don't fork into background"
msgstr "" msgstr "Nicht in den Hintergrund abforken"
#: src/daemon/gnuserv.c:449 #: src/daemon/gnuserv.c:450
msgid "NO-DAEMON" msgid "NO-DAEMON"
msgstr "" msgstr "KEIN-D<>MON"
#: src/daemon/gnuserv.c:451 #: src/daemon/gnuserv.c:452
msgid "Invoked from inetd" msgid "Invoked from inetd"
msgstr "" msgstr "Durch inetd aufgerufen"
#: src/daemon/gnuserv.c:451 #: src/daemon/gnuserv.c:452
msgid "INETD" msgid "INETD"
msgstr "" msgstr "INETD"
#: src/daemon/gnuserv.c:485 #: src/daemon/gnuserv.c:486
#, c-format #, c-format
msgid "" msgid ""
"Error on option %s: %s.\n" "Error on option %s: %s.\n"
"Run '%s --help' to see a full list of available command line options.\n" "Run '%s --help' to see a full list of available command line options.\n"
msgstr "" msgstr ""
"Fehler bei Option %s: %s.\n"
"F<>hren Sie `%s --help' aus, um eine volle Liste der verf<72>gbaren Optionen zu "
"sehen.\n"
#~ msgid "SMP CPU Flags"
#~ msgstr "SMP-CPU-Flags"
#~ msgid "Start_Data"
#~ msgstr "Start_Daten"
#~ msgid "End_Data"
#~ msgstr "Ende_Daten"
#~ msgid "Start_Brk"
#~ msgstr "Start_Brk"
#~ msgid "Brk"
#~ msgstr "Brk"
#~ msgid "Start_MMap"
#~ msgstr "Start_MMap"
#~ msgid "Arg_Start"
#~ msgstr "Arg_Start"
#~ msgid "Arg_End"
#~ msgstr "Arg_Ende"
#~ msgid "Env_Start"
#~ msgstr "Env_Start"
#~ msgid "Env_End"
#~ msgstr "Env_Ende"
#~ msgid "Address of beginning of data segment"
#~ msgstr "Adresse, an der das Datensegment anf<6E>ngt"
#~ msgid "Address of end of data segment"
#~ msgstr "Addresse, an der das Datensegment aufh<66>rt"
#~ msgid "Brk_Start"
#~ msgstr "Brk_Start"
#~ msgid "Brk_End"
#~ msgstr "Brk_Ende"
#~ msgid "Start of mmap()ed areas"
#~ msgstr "Start der mmap()-Zonen"
#~ msgid "RUID"
#~ msgstr "RUID"
#~ msgid "RGID"
#~ msgstr "RGID"
#~ msgid "Has CPU"
#~ msgstr "Hat CPU"
#~ msgid "Processor"
#~ msgstr "Prozessor"
#~ msgid "Last Processor"
#~ msgstr "Letzter Prozessor"
#~ msgid "effective UID of process"
#~ msgstr "effektive UID des Prozesses"
#~ msgid "effective GID of process"
#~ msgstr "effektive GID des Prozesses"
#~ msgid "has_cpu"
#~ msgstr "has_cpu"
#~ msgid "processor"
#~ msgstr "processor"
#~ msgid "last_processor"
#~ msgstr "last_processor"
#~ msgid "XCPU_Flags"
#~ msgstr "XCPU_Flags"
#~ msgid "SUid"
#~ msgstr "SUid"
#~ msgid "SGid"
#~ msgstr "SGid"
#~ msgid "FsUid"
#~ msgstr "FsUid"
#~ msgid "FsGid"
#~ msgstr "FsGid"
#~ msgid "NGroups"
#~ msgstr "NGruppen"
#~ msgid "Groups"
#~ msgstr "Gruppen"
#~ msgid "Saved User ID"
#~ msgstr "Gespeicherte Benutzer-ID"
#~ msgid "Saved Group ID"
#~ msgstr "Gespeicherte Gruppen-ID"
#~ msgid "Filesystem User ID"
#~ msgstr "Dateisystem-Benutzer-ID"
#~ msgid "Filesystem Group ID"
#~ msgstr "Dateisystem-Gruppen-ID"
#~ msgid "Number of additional process groups"
#~ msgstr "Anzahl zus<75>tzlicher Proze<7A>gruppen"
#~ msgid "Additional process groups"
#~ msgstr "Zus<75>tzliche Prozessgruppen"
#~ msgid "Pointer Size"
#~ msgstr "Zeigergr<67><72>e"
#~ msgid "Pointer Size on the Server (in bits)"
#~ msgstr "Zeigergr<67><72>e auf dem Server (in Bits)"
#~ msgid "Boot time"
#~ msgstr "Startzeit"
#~ msgid "Boot time (seconds sice epoch)"
#~ msgstr "Startzeit (Sekunden seit Epoche)"

View File

@@ -1,7 +1,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: glibtop 1.0.0\n" "Project-Id-Version: glibtop 1.0.0\n"
"POT-Creation-Date: 1999-02-23 13:48+0100\n" "POT-Creation-Date: 1999-09-16 23:16+0200\n"
"PO-Revision-Date: 1998-12-13 04:38+0100\n" "PO-Revision-Date: 1998-12-13 04:38+0100\n"
"Last-Translator: Pablo Saratxaga <srtxg@chanae.alphanet.ch>\n" "Last-Translator: Pablo Saratxaga <srtxg@chanae.alphanet.ch>\n"
"Language-Team: Pablo Saratxaga <srtxg@chanae.alphanet.ch>\n" "Language-Team: Pablo Saratxaga <srtxg@chanae.alphanet.ch>\n"
@@ -442,7 +442,8 @@ msgid "Number of pages of virtual memory"
msgstr "Cantidad de p<>ginas de memoria virtual" msgstr "Cantidad de p<>ginas de memoria virtual"
#: sysdeps/names/procmem.c:55 #: sysdeps/names/procmem.c:55
msgid "Number of residnet set (non-swapped) pages" #, fuzzy
msgid "Number of resident set (non-swapped) pages"
msgstr "Cantidad de p<>ginas de conjuntos compartidos (que no estan en swap)" msgstr "Cantidad de p<>ginas de conjuntos compartidos (que no estan en swap)"
#: sysdeps/names/procmem.c:56 #: sysdeps/names/procmem.c:56
@@ -1057,7 +1058,7 @@ msgstr "%s: la opci
msgid "%s: option `-W %s' doesn't allow an argument\n" msgid "%s: option `-W %s' doesn't allow an argument\n"
msgstr "%s: la opci<63>n `-W %s' no admite argumentos\n" msgstr "%s: la opci<63>n `-W %s' no admite argumentos\n"
#: lib/read.c:71 #: lib/read.c:75
#, c-format #, c-format
msgid "read %d bytes" msgid "read %d bytes"
msgstr "le<6C>dos %d bytes" msgstr "le<6C>dos %d bytes"
@@ -1076,39 +1077,39 @@ msgstr "le
msgid "write %d bytes" msgid "write %d bytes"
msgstr "escritos %d bytes" msgstr "escritos %d bytes"
#: src/daemon/gnuserv.c:445 #: src/daemon/gnuserv.c:446
msgid "Enable debugging" msgid "Enable debugging"
msgstr "Activar depuraci<63>n" msgstr "Activar depuraci<63>n"
#: src/daemon/gnuserv.c:445 #: src/daemon/gnuserv.c:446
msgid "DEBUG" msgid "DEBUG"
msgstr "DEPURACI<43>N" msgstr "DEPURACI<43>N"
#: src/daemon/gnuserv.c:447 #: src/daemon/gnuserv.c:448
msgid "Enable verbose output" msgid "Enable verbose output"
msgstr "Activa salida detallada" msgstr "Activa salida detallada"
#: src/daemon/gnuserv.c:447 #: src/daemon/gnuserv.c:448
msgid "VERBOSE" msgid "VERBOSE"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:449 #: src/daemon/gnuserv.c:450
msgid "Don't fork into background" msgid "Don't fork into background"
msgstr "No abrir un proceso de fondo" msgstr "No abrir un proceso de fondo"
#: src/daemon/gnuserv.c:449 #: src/daemon/gnuserv.c:450
msgid "NO-DAEMON" msgid "NO-DAEMON"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:451 #: src/daemon/gnuserv.c:452
msgid "Invoked from inetd" msgid "Invoked from inetd"
msgstr "Invocado desde inetd" msgstr "Invocado desde inetd"
#: src/daemon/gnuserv.c:451 #: src/daemon/gnuserv.c:452
msgid "INETD" msgid "INETD"
msgstr "INETD" msgstr "INETD"
#: src/daemon/gnuserv.c:485 #: src/daemon/gnuserv.c:486
#, c-format #, c-format
msgid "" msgid ""
"Error on option %s: %s.\n" "Error on option %s: %s.\n"

View File

@@ -6,7 +6,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 1999-02-27 22:24+0100\n" "POT-Creation-Date: 1999-09-16 23:16+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -380,7 +380,7 @@ msgid "Number of pages of virtual memory"
msgstr "" msgstr ""
#: sysdeps/names/procmem.c:55 #: sysdeps/names/procmem.c:55
msgid "Number of residnet set (non-swapped) pages" msgid "Number of resident set (non-swapped) pages"
msgstr "" msgstr ""
#: sysdeps/names/procmem.c:56 #: sysdeps/names/procmem.c:56
@@ -992,7 +992,7 @@ msgstr ""
msgid "%s: option `-W %s' doesn't allow an argument\n" msgid "%s: option `-W %s' doesn't allow an argument\n"
msgstr "" msgstr ""
#: lib/read.c:71 #: lib/read.c:75
#, c-format #, c-format
msgid "read %d bytes" msgid "read %d bytes"
msgstr "" msgstr ""
@@ -1011,39 +1011,39 @@ msgstr ""
msgid "write %d bytes" msgid "write %d bytes"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:445 #: src/daemon/gnuserv.c:446
msgid "Enable debugging" msgid "Enable debugging"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:445 #: src/daemon/gnuserv.c:446
msgid "DEBUG" msgid "DEBUG"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:447 #: src/daemon/gnuserv.c:448
msgid "Enable verbose output" msgid "Enable verbose output"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:447 #: src/daemon/gnuserv.c:448
msgid "VERBOSE" msgid "VERBOSE"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:449 #: src/daemon/gnuserv.c:450
msgid "Don't fork into background" msgid "Don't fork into background"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:449 #: src/daemon/gnuserv.c:450
msgid "NO-DAEMON" msgid "NO-DAEMON"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:451 #: src/daemon/gnuserv.c:452
msgid "Invoked from inetd" msgid "Invoked from inetd"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:451 #: src/daemon/gnuserv.c:452
msgid "INETD" msgid "INETD"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:485 #: src/daemon/gnuserv.c:486
#, c-format #, c-format
msgid "" msgid ""
"Error on option %s: %s.\n" "Error on option %s: %s.\n"

View File

@@ -6,7 +6,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 1999-02-27 22:24+0100\n" "POT-Creation-Date: 1999-09-16 23:16+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -380,7 +380,7 @@ msgid "Number of pages of virtual memory"
msgstr "" msgstr ""
#: sysdeps/names/procmem.c:55 #: sysdeps/names/procmem.c:55
msgid "Number of residnet set (non-swapped) pages" msgid "Number of resident set (non-swapped) pages"
msgstr "" msgstr ""
#: sysdeps/names/procmem.c:56 #: sysdeps/names/procmem.c:56
@@ -992,7 +992,7 @@ msgstr ""
msgid "%s: option `-W %s' doesn't allow an argument\n" msgid "%s: option `-W %s' doesn't allow an argument\n"
msgstr "" msgstr ""
#: lib/read.c:71 #: lib/read.c:75
#, c-format #, c-format
msgid "read %d bytes" msgid "read %d bytes"
msgstr "" msgstr ""
@@ -1011,39 +1011,39 @@ msgstr ""
msgid "write %d bytes" msgid "write %d bytes"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:445 #: src/daemon/gnuserv.c:446
msgid "Enable debugging" msgid "Enable debugging"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:445 #: src/daemon/gnuserv.c:446
msgid "DEBUG" msgid "DEBUG"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:447 #: src/daemon/gnuserv.c:448
msgid "Enable verbose output" msgid "Enable verbose output"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:447 #: src/daemon/gnuserv.c:448
msgid "VERBOSE" msgid "VERBOSE"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:449 #: src/daemon/gnuserv.c:450
msgid "Don't fork into background" msgid "Don't fork into background"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:449 #: src/daemon/gnuserv.c:450
msgid "NO-DAEMON" msgid "NO-DAEMON"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:451 #: src/daemon/gnuserv.c:452
msgid "Invoked from inetd" msgid "Invoked from inetd"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:451 #: src/daemon/gnuserv.c:452
msgid "INETD" msgid "INETD"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:485 #: src/daemon/gnuserv.c:486
#, c-format #, c-format
msgid "" msgid ""
"Error on option %s: %s.\n" "Error on option %s: %s.\n"

View File

@@ -6,7 +6,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 1999-02-27 22:24+0100\n" "POT-Creation-Date: 1999-09-16 23:16+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -380,7 +380,7 @@ msgid "Number of pages of virtual memory"
msgstr "" msgstr ""
#: sysdeps/names/procmem.c:55 #: sysdeps/names/procmem.c:55
msgid "Number of residnet set (non-swapped) pages" msgid "Number of resident set (non-swapped) pages"
msgstr "" msgstr ""
#: sysdeps/names/procmem.c:56 #: sysdeps/names/procmem.c:56
@@ -992,7 +992,7 @@ msgstr ""
msgid "%s: option `-W %s' doesn't allow an argument\n" msgid "%s: option `-W %s' doesn't allow an argument\n"
msgstr "" msgstr ""
#: lib/read.c:71 #: lib/read.c:75
#, c-format #, c-format
msgid "read %d bytes" msgid "read %d bytes"
msgstr "" msgstr ""
@@ -1011,39 +1011,39 @@ msgstr ""
msgid "write %d bytes" msgid "write %d bytes"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:445 #: src/daemon/gnuserv.c:446
msgid "Enable debugging" msgid "Enable debugging"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:445 #: src/daemon/gnuserv.c:446
msgid "DEBUG" msgid "DEBUG"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:447 #: src/daemon/gnuserv.c:448
msgid "Enable verbose output" msgid "Enable verbose output"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:447 #: src/daemon/gnuserv.c:448
msgid "VERBOSE" msgid "VERBOSE"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:449 #: src/daemon/gnuserv.c:450
msgid "Don't fork into background" msgid "Don't fork into background"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:449 #: src/daemon/gnuserv.c:450
msgid "NO-DAEMON" msgid "NO-DAEMON"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:451 #: src/daemon/gnuserv.c:452
msgid "Invoked from inetd" msgid "Invoked from inetd"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:451 #: src/daemon/gnuserv.c:452
msgid "INETD" msgid "INETD"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:485 #: src/daemon/gnuserv.c:486
#, c-format #, c-format
msgid "" msgid ""
"Error on option %s: %s.\n" "Error on option %s: %s.\n"

View File

@@ -6,7 +6,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 1999-02-27 22:24+0100\n" "POT-Creation-Date: 1999-09-16 23:16+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -380,7 +380,7 @@ msgid "Number of pages of virtual memory"
msgstr "" msgstr ""
#: sysdeps/names/procmem.c:55 #: sysdeps/names/procmem.c:55
msgid "Number of residnet set (non-swapped) pages" msgid "Number of resident set (non-swapped) pages"
msgstr "" msgstr ""
#: sysdeps/names/procmem.c:56 #: sysdeps/names/procmem.c:56
@@ -992,7 +992,7 @@ msgstr ""
msgid "%s: option `-W %s' doesn't allow an argument\n" msgid "%s: option `-W %s' doesn't allow an argument\n"
msgstr "" msgstr ""
#: lib/read.c:71 #: lib/read.c:75
#, c-format #, c-format
msgid "read %d bytes" msgid "read %d bytes"
msgstr "" msgstr ""
@@ -1011,39 +1011,39 @@ msgstr ""
msgid "write %d bytes" msgid "write %d bytes"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:445 #: src/daemon/gnuserv.c:446
msgid "Enable debugging" msgid "Enable debugging"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:445 #: src/daemon/gnuserv.c:446
msgid "DEBUG" msgid "DEBUG"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:447 #: src/daemon/gnuserv.c:448
msgid "Enable verbose output" msgid "Enable verbose output"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:447 #: src/daemon/gnuserv.c:448
msgid "VERBOSE" msgid "VERBOSE"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:449 #: src/daemon/gnuserv.c:450
msgid "Don't fork into background" msgid "Don't fork into background"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:449 #: src/daemon/gnuserv.c:450
msgid "NO-DAEMON" msgid "NO-DAEMON"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:451 #: src/daemon/gnuserv.c:452
msgid "Invoked from inetd" msgid "Invoked from inetd"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:451 #: src/daemon/gnuserv.c:452
msgid "INETD" msgid "INETD"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:485 #: src/daemon/gnuserv.c:486
#, c-format #, c-format
msgid "" msgid ""
"Error on option %s: %s.\n" "Error on option %s: %s.\n"

View File

@@ -6,7 +6,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 1999-02-27 22:24+0100\n" "POT-Creation-Date: 1999-09-16 23:16+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -380,7 +380,7 @@ msgid "Number of pages of virtual memory"
msgstr "" msgstr ""
#: sysdeps/names/procmem.c:55 #: sysdeps/names/procmem.c:55
msgid "Number of residnet set (non-swapped) pages" msgid "Number of resident set (non-swapped) pages"
msgstr "" msgstr ""
#: sysdeps/names/procmem.c:56 #: sysdeps/names/procmem.c:56
@@ -992,7 +992,7 @@ msgstr ""
msgid "%s: option `-W %s' doesn't allow an argument\n" msgid "%s: option `-W %s' doesn't allow an argument\n"
msgstr "" msgstr ""
#: lib/read.c:71 #: lib/read.c:75
#, c-format #, c-format
msgid "read %d bytes" msgid "read %d bytes"
msgstr "" msgstr ""
@@ -1011,39 +1011,39 @@ msgstr ""
msgid "write %d bytes" msgid "write %d bytes"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:445 #: src/daemon/gnuserv.c:446
msgid "Enable debugging" msgid "Enable debugging"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:445 #: src/daemon/gnuserv.c:446
msgid "DEBUG" msgid "DEBUG"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:447 #: src/daemon/gnuserv.c:448
msgid "Enable verbose output" msgid "Enable verbose output"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:447 #: src/daemon/gnuserv.c:448
msgid "VERBOSE" msgid "VERBOSE"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:449 #: src/daemon/gnuserv.c:450
msgid "Don't fork into background" msgid "Don't fork into background"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:449 #: src/daemon/gnuserv.c:450
msgid "NO-DAEMON" msgid "NO-DAEMON"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:451 #: src/daemon/gnuserv.c:452
msgid "Invoked from inetd" msgid "Invoked from inetd"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:451 #: src/daemon/gnuserv.c:452
msgid "INETD" msgid "INETD"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:485 #: src/daemon/gnuserv.c:486
#, c-format #, c-format
msgid "" msgid ""
"Error on option %s: %s.\n" "Error on option %s: %s.\n"

View File

@@ -6,7 +6,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 1999-02-27 22:24+0100\n" "POT-Creation-Date: 1999-09-16 23:16+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -380,7 +380,7 @@ msgid "Number of pages of virtual memory"
msgstr "" msgstr ""
#: sysdeps/names/procmem.c:55 #: sysdeps/names/procmem.c:55
msgid "Number of residnet set (non-swapped) pages" msgid "Number of resident set (non-swapped) pages"
msgstr "" msgstr ""
#: sysdeps/names/procmem.c:56 #: sysdeps/names/procmem.c:56
@@ -992,7 +992,7 @@ msgstr ""
msgid "%s: option `-W %s' doesn't allow an argument\n" msgid "%s: option `-W %s' doesn't allow an argument\n"
msgstr "" msgstr ""
#: lib/read.c:71 #: lib/read.c:75
#, c-format #, c-format
msgid "read %d bytes" msgid "read %d bytes"
msgstr "" msgstr ""
@@ -1011,39 +1011,39 @@ msgstr ""
msgid "write %d bytes" msgid "write %d bytes"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:445 #: src/daemon/gnuserv.c:446
msgid "Enable debugging" msgid "Enable debugging"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:445 #: src/daemon/gnuserv.c:446
msgid "DEBUG" msgid "DEBUG"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:447 #: src/daemon/gnuserv.c:448
msgid "Enable verbose output" msgid "Enable verbose output"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:447 #: src/daemon/gnuserv.c:448
msgid "VERBOSE" msgid "VERBOSE"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:449 #: src/daemon/gnuserv.c:450
msgid "Don't fork into background" msgid "Don't fork into background"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:449 #: src/daemon/gnuserv.c:450
msgid "NO-DAEMON" msgid "NO-DAEMON"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:451 #: src/daemon/gnuserv.c:452
msgid "Invoked from inetd" msgid "Invoked from inetd"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:451 #: src/daemon/gnuserv.c:452
msgid "INETD" msgid "INETD"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:485 #: src/daemon/gnuserv.c:486
#, c-format #, c-format
msgid "" msgid ""
"Error on option %s: %s.\n" "Error on option %s: %s.\n"

View File

@@ -6,7 +6,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 1999-02-27 22:24+0100\n" "POT-Creation-Date: 1999-09-16 23:16+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -380,7 +380,7 @@ msgid "Number of pages of virtual memory"
msgstr "" msgstr ""
#: sysdeps/names/procmem.c:55 #: sysdeps/names/procmem.c:55
msgid "Number of residnet set (non-swapped) pages" msgid "Number of resident set (non-swapped) pages"
msgstr "" msgstr ""
#: sysdeps/names/procmem.c:56 #: sysdeps/names/procmem.c:56
@@ -992,7 +992,7 @@ msgstr ""
msgid "%s: option `-W %s' doesn't allow an argument\n" msgid "%s: option `-W %s' doesn't allow an argument\n"
msgstr "" msgstr ""
#: lib/read.c:71 #: lib/read.c:75
#, c-format #, c-format
msgid "read %d bytes" msgid "read %d bytes"
msgstr "" msgstr ""
@@ -1011,39 +1011,39 @@ msgstr ""
msgid "write %d bytes" msgid "write %d bytes"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:445 #: src/daemon/gnuserv.c:446
msgid "Enable debugging" msgid "Enable debugging"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:445 #: src/daemon/gnuserv.c:446
msgid "DEBUG" msgid "DEBUG"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:447 #: src/daemon/gnuserv.c:448
msgid "Enable verbose output" msgid "Enable verbose output"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:447 #: src/daemon/gnuserv.c:448
msgid "VERBOSE" msgid "VERBOSE"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:449 #: src/daemon/gnuserv.c:450
msgid "Don't fork into background" msgid "Don't fork into background"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:449 #: src/daemon/gnuserv.c:450
msgid "NO-DAEMON" msgid "NO-DAEMON"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:451 #: src/daemon/gnuserv.c:452
msgid "Invoked from inetd" msgid "Invoked from inetd"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:451 #: src/daemon/gnuserv.c:452
msgid "INETD" msgid "INETD"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:485 #: src/daemon/gnuserv.c:486
#, c-format #, c-format
msgid "" msgid ""
"Error on option %s: %s.\n" "Error on option %s: %s.\n"

1227
po/fi.po Normal file

File diff suppressed because it is too large Load Diff

571
po/fr.po

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: libgtop VERSION\n" "Project-Id-Version: libgtop VERSION\n"
"POT-Creation-Date: 1999-02-27 22:24+0100\n" "POT-Creation-Date: 1999-09-16 23:16+0200\n"
"PO-Revision-Date: 1998-12-11 06:53+09:00\n" "PO-Revision-Date: 1998-12-11 06:53+09:00\n"
"Last-Translator: Eiichiro ITANI <emu@ceres.dti.ne.jp>\n" "Last-Translator: Eiichiro ITANI <emu@ceres.dti.ne.jp>\n"
"Language-Team: <gnome@lists.hypercore.co.jp>\n" "Language-Team: <gnome@lists.hypercore.co.jp>\n"
@@ -396,7 +396,8 @@ msgid "Number of pages of virtual memory"
msgstr "<22><><EFBFBD>ۥ<EFBFBD><DBA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υڡ<CEA5><DAA1><EFBFBD><EFBFBD><EFBFBD>" msgstr "<22><><EFBFBD>ۥ<EFBFBD><DBA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υڡ<CEA5><DAA1><EFBFBD><EFBFBD><EFBFBD>"
#: sysdeps/names/procmem.c:55 #: sysdeps/names/procmem.c:55
msgid "Number of residnet set (non-swapped) pages" #, fuzzy
msgid "Number of resident set (non-swapped) pages"
msgstr "<22><><EFBFBD>󥻥å<F3A5BBA5>(<28><><EFBFBD><EFBFBD><EFBFBD>åפ<C3A5><D7A4><EFBFBD><EFBFBD>ʤ<EFBFBD>)<29>ڡ<EFBFBD><DAA1><EFBFBD><EFBFBD><EFBFBD>" msgstr "<22><><EFBFBD>󥻥å<F3A5BBA5>(<28><><EFBFBD><EFBFBD><EFBFBD>åפ<C3A5><D7A4><EFBFBD><EFBFBD>ʤ<EFBFBD>)<29>ڡ<EFBFBD><DAA1><EFBFBD><EFBFBD><EFBFBD>"
#: sysdeps/names/procmem.c:56 #: sysdeps/names/procmem.c:56
@@ -1004,7 +1005,7 @@ msgstr ""
msgid "%s: option `-W %s' doesn't allow an argument\n" msgid "%s: option `-W %s' doesn't allow an argument\n"
msgstr "" msgstr ""
#: lib/read.c:71 #: lib/read.c:75
#, c-format #, c-format
msgid "read %d bytes" msgid "read %d bytes"
msgstr "" msgstr ""
@@ -1023,39 +1024,39 @@ msgstr ""
msgid "write %d bytes" msgid "write %d bytes"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:445 #: src/daemon/gnuserv.c:446
msgid "Enable debugging" msgid "Enable debugging"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:445 #: src/daemon/gnuserv.c:446
msgid "DEBUG" msgid "DEBUG"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:447 #: src/daemon/gnuserv.c:448
msgid "Enable verbose output" msgid "Enable verbose output"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:447 #: src/daemon/gnuserv.c:448
msgid "VERBOSE" msgid "VERBOSE"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:449 #: src/daemon/gnuserv.c:450
msgid "Don't fork into background" msgid "Don't fork into background"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:449 #: src/daemon/gnuserv.c:450
msgid "NO-DAEMON" msgid "NO-DAEMON"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:451 #: src/daemon/gnuserv.c:452
msgid "Invoked from inetd" msgid "Invoked from inetd"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:451 #: src/daemon/gnuserv.c:452
msgid "INETD" msgid "INETD"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:485 #: src/daemon/gnuserv.c:486
#, c-format #, c-format
msgid "" msgid ""
"Error on option %s: %s.\n" "Error on option %s: %s.\n"

View File

@@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: libgtop VERSION\n" "Project-Id-Version: libgtop VERSION\n"
"POT-Creation-Date: 1999-02-27 22:24+0100\n" "POT-Creation-Date: 1999-09-16 23:16+0200\n"
"PO-Revision-Date: 1999-02-04 14:31:38+0900\n" "PO-Revision-Date: 1999-02-04 14:31:38+0900\n"
"Last-Translator: Sung-Hyun Nam <namsh@lgic.co.kr>\n" "Last-Translator: Sung-Hyun Nam <namsh@lgic.co.kr>\n"
"Language-Team: Korean <ko@li.org>\n" "Language-Team: Korean <ko@li.org>\n"
@@ -379,7 +379,7 @@ msgid "Number of pages of virtual memory"
msgstr "" msgstr ""
#: sysdeps/names/procmem.c:55 #: sysdeps/names/procmem.c:55
msgid "Number of residnet set (non-swapped) pages" msgid "Number of resident set (non-swapped) pages"
msgstr "" msgstr ""
#: sysdeps/names/procmem.c:56 #: sysdeps/names/procmem.c:56
@@ -980,7 +980,7 @@ msgstr "%s: `-W %s'
msgid "%s: option `-W %s' doesn't allow an argument\n" msgid "%s: option `-W %s' doesn't allow an argument\n"
msgstr "%s: `-W %s' <20>ɼ<EFBFBD><C9BC><EFBFBD> <20><><EFBFBD>ڰ<EFBFBD> <20>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>\n" msgstr "%s: `-W %s' <20>ɼ<EFBFBD><C9BC><EFBFBD> <20><><EFBFBD>ڰ<EFBFBD> <20>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>\n"
#: lib/read.c:71 #: lib/read.c:75
#, c-format #, c-format
msgid "read %d bytes" msgid "read %d bytes"
msgstr "" msgstr ""
@@ -999,39 +999,39 @@ msgstr ""
msgid "write %d bytes" msgid "write %d bytes"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:445 #: src/daemon/gnuserv.c:446
msgid "Enable debugging" msgid "Enable debugging"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:445 #: src/daemon/gnuserv.c:446
msgid "DEBUG" msgid "DEBUG"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:447 #: src/daemon/gnuserv.c:448
msgid "Enable verbose output" msgid "Enable verbose output"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:447 #: src/daemon/gnuserv.c:448
msgid "VERBOSE" msgid "VERBOSE"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:449 #: src/daemon/gnuserv.c:450
msgid "Don't fork into background" msgid "Don't fork into background"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:449 #: src/daemon/gnuserv.c:450
msgid "NO-DAEMON" msgid "NO-DAEMON"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:451 #: src/daemon/gnuserv.c:452
msgid "Invoked from inetd" msgid "Invoked from inetd"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:451 #: src/daemon/gnuserv.c:452
msgid "INETD" msgid "INETD"
msgstr "" msgstr ""
#: src/daemon/gnuserv.c:485 #: src/daemon/gnuserv.c:486
#, c-format #, c-format
msgid "" msgid ""
"Error on option %s: %s.\n" "Error on option %s: %s.\n"

View File

@@ -1,13 +1,13 @@
# Norwegian translation for Libgtop (bokm<6B>l dialect) # Norwegian translation for Libgtop (bokm<6B>l dialect)
# Copyright (C) 1998 Free Software Foundation, Inc. # Copyright (C) 1998 Free Software Foundation, Inc.
# Kjartan Maraas <kmaraas@fib.hl.no>, 1998,1999. # Kjartan Maraas <kmaraas@online.no>, 1998,1999.
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: libgtop 0.99.3\n" "Project-Id-Version: libgtop 0.99.3\n"
"POT-Creation-Date: 1999-02-27 22:24+0100\n" "POT-Creation-Date: 1999-09-16 23:16+0200\n"
"PO-Revision-Date: 1999-01-27 23:22+0100\n" "PO-Revision-Date: 1999-07-11 14:25+0200\n"
"Last-Translator: Kjartan Maraas <kmaraas@fib.hl.no>\n" "Last-Translator: Kjartan Maraas <kmaraas@online.no>\n"
"Language-Team: Norwegian <no@li.org>\n" "Language-Team: Norwegian <no@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n" "Content-Type: text/plain; charset=iso-8859-1\n"
@@ -397,7 +397,7 @@ msgid "Number of pages of virtual memory"
msgstr "Antall sider virtuelt minne" msgstr "Antall sider virtuelt minne"
#: sysdeps/names/procmem.c:55 #: sysdeps/names/procmem.c:55
msgid "Number of residnet set (non-swapped) pages" msgid "Number of resident set (non-swapped) pages"
msgstr "Antallet resident sett (ikke swappete) sider" msgstr "Antallet resident sett (ikke swappete) sider"
#: sysdeps/names/procmem.c:56 #: sysdeps/names/procmem.c:56
@@ -1004,7 +1004,7 @@ msgstr "%s: flagget `-W %s' er flertydig\n"
msgid "%s: option `-W %s' doesn't allow an argument\n" msgid "%s: option `-W %s' doesn't allow an argument\n"
msgstr "%s: flagget `-W %s' tar ikke argumenter\n" msgstr "%s: flagget `-W %s' tar ikke argumenter\n"
#: lib/read.c:71 #: lib/read.c:75
#, c-format #, c-format
msgid "read %d bytes" msgid "read %d bytes"
msgstr "les %d bytes" msgstr "les %d bytes"
@@ -1023,39 +1023,39 @@ msgstr "les data %d bytes"
msgid "write %d bytes" msgid "write %d bytes"
msgstr "skriv %d bytes" msgstr "skriv %d bytes"
#: src/daemon/gnuserv.c:445 #: src/daemon/gnuserv.c:446
msgid "Enable debugging" msgid "Enable debugging"
msgstr "Sl<53> p<> avlusing" msgstr "Sl<53> p<> avlusing"
#: src/daemon/gnuserv.c:445 #: src/daemon/gnuserv.c:446
msgid "DEBUG" msgid "DEBUG"
msgstr "DEBUG" msgstr "DEBUG"
#: src/daemon/gnuserv.c:447 #: src/daemon/gnuserv.c:448
msgid "Enable verbose output" msgid "Enable verbose output"
msgstr "Sl<53> p<> utfyllende utskrift" msgstr "Sl<53> p<> utfyllende utskrift"
#: src/daemon/gnuserv.c:447 #: src/daemon/gnuserv.c:448
msgid "VERBOSE" msgid "VERBOSE"
msgstr "VERBOSE" msgstr "VERBOSE"
#: src/daemon/gnuserv.c:449 #: src/daemon/gnuserv.c:450
msgid "Don't fork into background" msgid "Don't fork into background"
msgstr "Ikke forgren til bakgrunnen" msgstr "Ikke forgren til bakgrunnen"
#: src/daemon/gnuserv.c:449 #: src/daemon/gnuserv.c:450
msgid "NO-DAEMON" msgid "NO-DAEMON"
msgstr "NO-DAEMON" msgstr "NO-DAEMON"
#: src/daemon/gnuserv.c:451 #: src/daemon/gnuserv.c:452
msgid "Invoked from inetd" msgid "Invoked from inetd"
msgstr "Kalt fra inetd" msgstr "Kalt fra inetd"
#: src/daemon/gnuserv.c:451 #: src/daemon/gnuserv.c:452
msgid "INETD" msgid "INETD"
msgstr "INETD" msgstr "INETD"
#: src/daemon/gnuserv.c:485 #: src/daemon/gnuserv.c:486
#, c-format #, c-format
msgid "" msgid ""
"Error on option %s: %s.\n" "Error on option %s: %s.\n"

1068
po/sv.po Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,7 @@
Makefile.in Makefile.in
Makefile Makefile
libgtop_daemon libgtop_daemon
libgtop_server
server.conf server.conf
.libs .libs
.deps .deps

View File

@@ -1,3 +1,16 @@
1999-07-29 Martin Baulig <martin@home-of-linux.org>
* Makefile.am: Link the `libgtop_daemon' and the `libgtop_server'
statically if possible.
1999-05-07 Martin Baulig <martin@home-of-linux.org>
* server.c (main): There's some problem with uname () - some systems
like Solaris or Digital Unix return a nonnegative value on success,
some others like Linux return 0. Since all known systems seem to return
a negative value on failure, we simply check whether the return value is
not negative here.
1999-02-19 Martin Baulig <martin@home-of-linux.org> 1999-02-19 Martin Baulig <martin@home-of-linux.org>
* Makefile.am (LIBGTOP_COMPILE_SYSTEM): Hardcoded system name. * Makefile.am (LIBGTOP_COMPILE_SYSTEM): Hardcoded system name.

View File

@@ -41,11 +41,19 @@ libgtop_daemon_LDADD = $(top_builddir)/lib/libgtop.la \
$(GLIB_LIBS)\ $(GLIB_LIBS)\
@LIBSUPPORT@ @INTLLIBS@ @libs_xauth@ @LIBSUPPORT@ @INTLLIBS@ @libs_xauth@
if ENABLE_STATIC
libgtop_daemon_LDFLAGS = -static
endif
libgtop_server_SOURCES = server.c slave.c io.c version.c daemon.h libgtop_server_SOURCES = server.c slave.c io.c version.c daemon.h
libgtop_server_LDADD = $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps_suid.la \ libgtop_server_LDADD = $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps_suid.la \
$(top_builddir)/sysdeps/common/libgtop_suid_common.la \ $(top_builddir)/sysdeps/common/libgtop_suid_common.la \
@LIBSUPPORT@ @LIBSUPPORT@
if ENABLE_STATIC
libgtop_server_LDFLAGS = -static
endif
EXTRA_DIST = server_config.h.in server_config.pl EXTRA_DIST = server_config.h.in server_config.pl
install-exec-hook: install-exec-hook:

View File

@@ -219,7 +219,7 @@ permitted (u_long host_addr, int fd)
* GNU_SECURE protocol.... * GNU_SECURE protocol....
*/ */
if (verbose_output) if (verbose_output) {
if (changed_uid || invoked_from_inetd) if (changed_uid || invoked_from_inetd)
syslog_message (LOG_WARNING, syslog_message (LOG_WARNING,
"Xauth authentication not allowed, " "Xauth authentication not allowed, "
@@ -229,6 +229,7 @@ permitted (u_long host_addr, int fd)
"Xauth authentication failed, " "Xauth authentication failed, "
"trying GNU_SECURE auth..."); "trying GNU_SECURE auth...");
} }
}
/* Other auth protocols go here, and should execute only if /* Other auth protocols go here, and should execute only if
* the * auth_protocol name matches. */ * the * auth_protocol name matches. */
@@ -243,7 +244,7 @@ permitted (u_long host_addr, int fd)
if (enable_debug) if (enable_debug)
syslog_message (LOG_DEBUG, "Trying %lx - %lx", syslog_message (LOG_DEBUG, "Trying %lx - %lx",
host_addr, permitted_hosts [i]); host_addr, permitted_hosts [i]);
if (permitted_hosts [i] == NULL) if (permitted_hosts [i] == 0L)
return (FALSE); return (FALSE);
if (host_addr == permitted_hosts [i]) if (host_addr == permitted_hosts [i])
return (TRUE); return (TRUE);

View File

@@ -62,6 +62,7 @@ int
do_read (int s, void *ptr, size_t total_size) do_read (int s, void *ptr, size_t total_size)
{ {
int nread; int nread;
char *tmp_ptr;
size_t already_read = 0, remaining = total_size; size_t already_read = 0, remaining = total_size;
while (already_read < total_size) { while (already_read < total_size) {
@@ -82,7 +83,10 @@ do_read (int s, void *ptr, size_t total_size)
already_read += nread; already_read += nread;
remaining -= nread; remaining -= nread;
(char *) ptr += nread; /* (char *) ptr += nread; */
tmp_ptr = ptr;
tmp_ptr += nread;
ptr = tmp_ptr;
#ifdef REAL_DEBUG #ifdef REAL_DEBUG
fprintf (stderr, "READ (%d): %d - %d - %d\n", fprintf (stderr, "READ (%d): %d - %d - %d\n",

View File

@@ -68,7 +68,7 @@ main(int argc, char *argv[])
uid = getuid (); euid = geteuid (); uid = getuid (); euid = geteuid ();
gid = getgid (); egid = getegid (); gid = getgid (); egid = getegid ();
if (uname (&uts)) _exit (1); if (uname (&uts) < 0) _exit (1);
if (strcmp (uts.sysname, LIBGTOP_COMPILE_SYSTEM) || if (strcmp (uts.sysname, LIBGTOP_COMPILE_SYSTEM) ||
strcmp (uts.release, LIBGTOP_COMPILE_RELEASE) || strcmp (uts.release, LIBGTOP_COMPILE_RELEASE) ||

View File

@@ -26,12 +26,12 @@
void void
handle_slave_connection (int input, int output) handle_slave_connection (int input, int output)
{ {
glibtop *server = glibtop_global_server; glibtop *server G_GNUC_UNUSED = glibtop_global_server;
int64_t *param_ptr; int64_t *param_ptr G_GNUC_UNUSED;
const void *ptr; const void *ptr G_GNUC_UNUSED;
unsigned short max_len; unsigned short max_len G_GNUC_UNUSED;
pid_t pid; pid_t pid G_GNUC_UNUSED;
glibtop_response _resp, *resp = &_resp; glibtop_response _resp, *resp = &_resp;
glibtop_command _cmnd, *cmnd = &_cmnd; glibtop_command _cmnd, *cmnd = &_cmnd;
@@ -119,8 +119,8 @@ handle_slave_command (glibtop_command *cmnd, glibtop_response *resp,
const void *parameter) const void *parameter)
{ {
glibtop *server = glibtop_global_server; glibtop *server = glibtop_global_server;
unsigned device; unsigned device G_GNUC_UNUSED;
pid_t pid; pid_t pid G_GNUC_UNUSED;
switch (cmnd->command) { switch (cmnd->command) {
case GLIBTOP_CMND_SYSDEPS: case GLIBTOP_CMND_SYSDEPS:
@@ -128,7 +128,7 @@ handle_slave_command (glibtop_command *cmnd, glibtop_response *resp,
sizeof (glibtop_sysdeps)); sizeof (glibtop_sysdeps));
resp->u.sysdeps.features = glibtop_server_features; resp->u.sysdeps.features = glibtop_server_features;
resp->u.sysdeps.flags = glibtop_server_features | resp->u.sysdeps.flags = glibtop_server_features |
(1 << GLIBTOP_SYSDEPS_FEATURES); (1L << GLIBTOP_SYSDEPS_FEATURES);
resp->offset = _offset_union (sysdeps); resp->offset = _offset_union (sysdeps);
break; break;
#if GLIBTOP_SUID_CPU #if GLIBTOP_SUID_CPU

View File

@@ -2,24 +2,5 @@
.libs .libs
Makefile Makefile
Makefile.in Makefile.in
close.lo *.lo
cpu.lo *.la
init.lo
libgtop_sysdeps.la
loadavg.lo
mem.lo
msg_limits.lo
open.lo
prockernel.lo
proclist.lo
procmem.lo
procsegment.lo
procsignal.lo
procstate.lo
proctime.lo
procuid.lo
sem_limits.lo
shm_limits.lo
swap.lo
sysdeps.lo
uptime.lo

View File

@@ -1 +1,2 @@
Josh Sled <jsled@scam.XCF.Berkeley.EDU> Martin Baulig (martin@home-of-linux.org)
Josh Sled (jsled@scam.XCF.Berkeley.EDU)

View File

@@ -1,3 +1,60 @@
1999-07-29 Martin Baulig <martin@home-of-linux.org>
* proctime.c (glibtop_get_proc_time_p): Fix bug reported by
Takis Psarogiannakopoulos: `start_time' are seconds since the
epoch as it is stated in the manual.
Tue Jun 15 16:04:10 1999 Timur Bakeyev <mc@bat.ru>
* procuid.c: A fix to a ommitted case, when nor NetBSD, nor
LibGTop >= 1.1.0. This should be investigated closely to cover
more cases....
1999-05-26 Martin Baulig <martin@home-of-linux.org>
More NetBSD 1.4 fixes.
* mem.c, procmap.c, procmem.c: Make this work with the new UVM code.
[FIXME: This following most likely works on all BSD systems, but
this needs to be tested; I made it conditional to NetBSD 1.4 at
the moment. Please extend the conditionals to any other systems
where this works ...]
* procstate.c: Added `ruid' and `rgid' for LibGTop >= 1.1.0.
* procuid.c: Added `ngroups' and `groups' for LibGTop >= 1.1.0.
1999-05-25 Martin Baulig <martin@home-of-linux.org>
* ppp.c: Make this work on NetBSD.
Thu Apr 8 23:47:29 1999 Timur Bakeyev <timur@gnu.org>
* cpu.c, mem.c, netload.c, procargs.c, procstate.c, proctime.c,
sem_limits.c, shm_limits.c, swap.c: Added initial port for BSD/OS
(aka BSDI) 2.x and 3.x. 4.x should also(?) work.
Still, this port require more close look and extended check.
1999-03-19 Martin Baulig <martin@home-of-linux.org>
Added basic support for BSDI. It compiles without problems on
BSDI 2.1 and 3.1, but it is *untested* - I'm neither root on
the machine nor have I access to /dev/kmem, so I don't know
whether it will work.
You need to give configure the `--enable-hacker-mode' parameter
to use the code.
If someone can verify whether it actually works, please let me
know.
1999-03-18 Martin Baulig <martin@home-of-linux.org>
* ppp.c: Don't use `sppp.pp_phase' if we don't HAVE_I4B_ACCT.
This is an ugly hack until someone tells me which versions have
this field and which not.
1999-02-25 Martin Baulig <martin@home-of-linux.org> 1999-02-25 Martin Baulig <martin@home-of-linux.org>
* prockernel.c, proctime.c: Applied patch Stanislav Grozev for * prockernel.c, proctime.c: Applied patch Stanislav Grozev for

View File

@@ -28,13 +28,17 @@
#include <glibtop_suid.h> #include <glibtop_suid.h>
static const unsigned long _glibtop_sysdeps_cpu = static const unsigned long _glibtop_sysdeps_cpu =
(1 << GLIBTOP_CPU_TOTAL) + (1 << GLIBTOP_CPU_USER) + (1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_USER) +
(1 << GLIBTOP_CPU_NICE) + (1 << GLIBTOP_CPU_SYS) + (1L << GLIBTOP_CPU_NICE) + (1L << GLIBTOP_CPU_SYS) +
(1 << GLIBTOP_CPU_IDLE) + (1 << GLIBTOP_CPU_FREQUENCY); (1L << GLIBTOP_CPU_IDLE) + (1L << GLIBTOP_CPU_FREQUENCY);
/* nlist structure for kernel access */ /* nlist structure for kernel access */
static struct nlist nlst [] = { static struct nlist nlst [] = {
#ifdef __bsdi__
{ "_cpustats" },
#else
{ "_cp_time" }, { "_cp_time" },
#endif
{ 0 } { 0 }
}; };
@@ -66,7 +70,7 @@ glibtop_get_cpu_p (glibtop *server, glibtop_cpu *buf)
struct clockinfo ci; struct clockinfo ci;
size_t length; size_t length;
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_CPU), 0); glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_CPU), 0);
memset (buf, 0, sizeof (glibtop_cpu)); memset (buf, 0, sizeof (glibtop_cpu));

View File

@@ -26,6 +26,10 @@
BEGIN_LIBGTOP_DECLS BEGIN_LIBGTOP_DECLS
#if _IN_LIBGTOP
#include <sys/param.h>
#endif
#define KI_PROC(ki) (&(ki))->kp_proc) #define KI_PROC(ki) (&(ki))->kp_proc)
#define KI_EPROC(ki) (&(ki))->kp_eproc) #define KI_EPROC(ki) (&(ki))->kp_eproc)

View File

@@ -28,7 +28,7 @@
#include <glibtop_suid.h> #include <glibtop_suid.h>
static const unsigned long _glibtop_sysdeps_loadavg = static const unsigned long _glibtop_sysdeps_loadavg =
(1 << GLIBTOP_LOADAVG_LOADAVG); (1L << GLIBTOP_LOADAVG_LOADAVG);
/* Init function. */ /* Init function. */
@@ -46,7 +46,7 @@ glibtop_get_loadavg_p (glibtop *server, glibtop_loadavg *buf)
double ldavg[3]; double ldavg[3];
int i; int i;
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_LOADAVG), 0); glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_LOADAVG), 0);
memset (buf, 0, sizeof (glibtop_loadavg)); memset (buf, 0, sizeof (glibtop_loadavg));

View File

@@ -31,14 +31,19 @@
#include <sys/vmmeter.h> #include <sys/vmmeter.h>
#include <vm/vm_param.h> #include <vm/vm_param.h>
static const unsigned long _glibtop_sysdeps_mem = #if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
(1 << GLIBTOP_MEM_TOTAL) + (1 << GLIBTOP_MEM_USED) + #include <uvm/uvm_extern.h>
(1 << GLIBTOP_MEM_FREE) + (1 << GLIBTOP_MEM_SHARED) +
(1 << GLIBTOP_MEM_BUFFER) +
#ifdef __FreeBSD__
(1 << GLIBTOP_MEM_CACHED) +
#endif #endif
(1 << GLIBTOP_MEM_USER) + (1 << GLIBTOP_MEM_LOCKED);
static const unsigned long _glibtop_sysdeps_mem =
(1L << GLIBTOP_MEM_TOTAL) + (1L << GLIBTOP_MEM_USED) +
(1L << GLIBTOP_MEM_FREE) +
(1L << GLIBTOP_MEM_SHARED) +
(1L << GLIBTOP_MEM_BUFFER) +
#ifdef __FreeBSD__
(1L << GLIBTOP_MEM_CACHED) +
#endif
(1L << GLIBTOP_MEM_USER) + (1L << GLIBTOP_MEM_LOCKED);
#ifndef LOG1024 #ifndef LOG1024
#define LOG1024 10 #define LOG1024 10
@@ -52,18 +57,33 @@ static int pageshift; /* log base 2 of the pagesize */
/* nlist structure for kernel access */ /* nlist structure for kernel access */
static struct nlist nlst [] = { static struct nlist nlst [] = {
{ "_cnt" }, #if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
#ifdef __FreeBSD__ { "_bufpages" },
{ 0 }
#else
#if defined(__bsdi__)
{ "_bufcachemem" },
#elif defined(__FreeBSD__)
{ "_bufspace" }, { "_bufspace" },
#else #else
{ "_bufpages" }, { "_bufpages" },
#endif #endif
{ "_cnt" },
{ 0 } { 0 }
#endif
}; };
/* MIB array for sysctl */ /* MIB array for sysctl */
/* static int mib_length=2; */ static int mib_length=2;
#ifdef __bsdi__
static int mib [] = { CTL_VM, VM_TOTAL };
#else
static int mib [] = { CTL_VM, VM_METER }; static int mib [] = { CTL_VM, VM_METER };
#endif
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
static int mib_uvmexp [] = { CTL_VM, VM_UVMEXP };
#endif
/* Init function. */ /* Init function. */
@@ -97,12 +117,18 @@ glibtop_get_mem_p (glibtop *server, glibtop_mem *buf)
{ {
struct vmtotal vmt; struct vmtotal vmt;
size_t length_vmt; size_t length_vmt;
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
struct uvmexp uvmexp;
size_t length_uvmexp;
#else
struct vmmeter vmm; struct vmmeter vmm;
#endif
u_int v_used_count; u_int v_used_count;
u_int v_total_count; u_int v_total_count;
u_int v_free_count;
int bufspace; int bufspace;
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_MEM), 0); glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_MEM), 0);
memset (buf, 0, sizeof (glibtop_mem)); memset (buf, 0, sizeof (glibtop_mem));
@@ -116,18 +142,26 @@ glibtop_get_mem_p (glibtop *server, glibtop_mem *buf)
/* Get the data from sysctl */ /* Get the data from sysctl */
length_vmt = sizeof (vmt); length_vmt = sizeof (vmt);
if (sysctl (mib, 2, &vmt, &length_vmt, NULL, 0)) { if (sysctl (mib, 2, &vmt, &length_vmt, NULL, 0)) {
glibtop_warn_io_r (server, "sysctl"); glibtop_warn_io_r (server, "sysctl (vmt)");
return; return;
} }
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
length_uvmexp = sizeof (uvmexp);
if (sysctl (mib_uvmexp, 2, &uvmexp, &length_uvmexp, NULL, 0)) {
glibtop_warn_io_r (server, "sysctl (uvmexp)");
return;
}
#else
/* Get the data from kvm_* */ /* Get the data from kvm_* */
if (kvm_read (server->machine.kd, nlst[0].n_value, if (kvm_read (server->machine.kd, nlst[1].n_value,
&vmm, sizeof (vmm)) != sizeof (vmm)) { &vmm, sizeof (vmm)) != sizeof (vmm)) {
glibtop_warn_io_r (server, "kvm_read (cnt)"); glibtop_warn_io_r (server, "kvm_read (cnt)");
return; return;
} }
#endif
if (kvm_read (server->machine.kd, nlst[1].n_value, if (kvm_read (server->machine.kd, nlst[0].n_value,
&bufspace, sizeof (bufspace)) != sizeof (bufspace)) { &bufspace, sizeof (bufspace)) != sizeof (bufspace)) {
glibtop_warn_io_r (server, "kvm_read (bufspace)"); glibtop_warn_io_r (server, "kvm_read (bufspace)");
return; return;
@@ -135,25 +169,43 @@ glibtop_get_mem_p (glibtop *server, glibtop_mem *buf)
/* convert memory stats to Kbytes */ /* convert memory stats to Kbytes */
#ifdef __FreeBSD__ #if defined(__FreeBSD__)
v_total_count = vmm.v_page_count; v_total_count = vmm.v_page_count;
#else
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
v_total_count = uvmexp.reserve_kernel +
uvmexp.reserve_pagedaemon +
uvmexp.free + uvmexp.wired + uvmexp.active +
uvmexp.inactive;
#else #else
v_total_count = vmm.v_kernel_pages + v_total_count = vmm.v_kernel_pages +
vmm.v_free_count + vmm.v_wire_count + vmm.v_free_count + vmm.v_wire_count +
vmm.v_active_count + vmm.v_inactive_count; vmm.v_active_count + vmm.v_inactive_count;
#endif #endif
#endif
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
v_used_count = uvmexp.active + uvmexp.inactive;
v_free_count = uvmexp.free;
#else
v_used_count = vmm.v_active_count + vmm.v_inactive_count; v_used_count = vmm.v_active_count + vmm.v_inactive_count;
v_free_count = vmm.v_free_count;
#endif
buf->total = (u_int64_t) pagetok (v_total_count) << LOG1024; buf->total = (u_int64_t) pagetok (v_total_count) << LOG1024;
buf->used = (u_int64_t) pagetok (v_used_count) << LOG1024; buf->used = (u_int64_t) pagetok (v_used_count) << LOG1024;
buf->free = (u_int64_t) pagetok (vmm.v_free_count) << LOG1024; buf->free = (u_int64_t) pagetok (v_free_count) << LOG1024;
#ifdef __FreeBSD__ #ifdef __FreeBSD__
buf->cached = (u_int64_t) pagetok (vmm.v_cache_count) << LOG1024; buf->cached = (u_int64_t) pagetok (vmm.v_cache_count) << LOG1024;
#endif #endif
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
buf->locked = (u_int64_t) pagetok (uvmexp.wired) << LOG1024;
#else
buf->locked = (u_int64_t) pagetok (vmm.v_wire_count) << LOG1024; buf->locked = (u_int64_t) pagetok (vmm.v_wire_count) << LOG1024;
#endif
buf->shared = (u_int64_t) pagetok (vmt.t_rmshr) << LOG1024; buf->shared = (u_int64_t) pagetok (vmt.t_rmshr) << LOG1024;
#if __FreeBSD__ #if __FreeBSD__

View File

@@ -27,9 +27,26 @@
#include <glibtop_suid.h> #include <glibtop_suid.h>
#if (defined __bsdi__) && (_BSDI_VERSION < 199700)
/* Older versions of BSDI don't seem to have this. */
void
glibtop_init_msg_limits_p (glibtop *server)
{ }
void
glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf)
{
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_MSG_LIMITS), 0);
memset (buf, 0, sizeof (glibtop_msg_limits));
}
#else
/* #define KERNEL to get declaration of `struct msginfo'. */ /* #define KERNEL to get declaration of `struct msginfo'. */
#ifdef __FreeBSD__ #if (defined __FreeBSD__) || (defined __bsdi__)
#define KERNEL 1 #define KERNEL 1
#else #else
#define _KERNEL 1 #define _KERNEL 1
@@ -39,9 +56,9 @@
#include <sys/msg.h> #include <sys/msg.h>
static const unsigned long _glibtop_sysdeps_msg_limits = static const unsigned long _glibtop_sysdeps_msg_limits =
(1 << GLIBTOP_IPC_MSGMAX) + (1 << GLIBTOP_IPC_MSGMNI) + (1L << GLIBTOP_IPC_MSGMAX) + (1L << GLIBTOP_IPC_MSGMNI) +
(1 << GLIBTOP_IPC_MSGMNB) + (1 << GLIBTOP_IPC_MSGTQL) + (1L << GLIBTOP_IPC_MSGMNB) + (1L << GLIBTOP_IPC_MSGTQL) +
(1 << GLIBTOP_IPC_MSGSSZ); (1L << GLIBTOP_IPC_MSGSSZ);
/* The values in this structure never change at runtime, so we only /* The values in this structure never change at runtime, so we only
* read it once during initialization. We have to use the name `_msginfo' * read it once during initialization. We have to use the name `_msginfo'
@@ -78,7 +95,7 @@ glibtop_init_msg_limits_p (glibtop *server)
void void
glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf) glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf)
{ {
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_MSG_LIMITS), 0); glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_MSG_LIMITS), 0);
memset (buf, 0, sizeof (glibtop_msg_limits)); memset (buf, 0, sizeof (glibtop_msg_limits));
@@ -93,3 +110,6 @@ glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf)
buf->flags = _glibtop_sysdeps_msg_limits; buf->flags = _glibtop_sysdeps_msg_limits;
} }
#endif /* either a newer BSDI or no BSDI at all. */

View File

@@ -39,20 +39,20 @@
#include <netinet/in_var.h> #include <netinet/in_var.h>
static const unsigned long _glibtop_sysdeps_netload = static const unsigned long _glibtop_sysdeps_netload =
(1 << GLIBTOP_NETLOAD_IF_FLAGS) + (1L << GLIBTOP_NETLOAD_IF_FLAGS) +
(1 << GLIBTOP_NETLOAD_MTU) + (1L << GLIBTOP_NETLOAD_MTU) +
(1 << GLIBTOP_NETLOAD_SUBNET) + (1L << GLIBTOP_NETLOAD_SUBNET) +
(1 << GLIBTOP_NETLOAD_ADDRESS) + (1L << GLIBTOP_NETLOAD_ADDRESS) +
(1 << GLIBTOP_NETLOAD_PACKETS_IN) + (1L << GLIBTOP_NETLOAD_PACKETS_IN) +
(1 << GLIBTOP_NETLOAD_PACKETS_OUT) + (1L << GLIBTOP_NETLOAD_PACKETS_OUT) +
(1 << GLIBTOP_NETLOAD_PACKETS_TOTAL) + (1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) +
(1 << GLIBTOP_NETLOAD_BYTES_IN) + (1L << GLIBTOP_NETLOAD_BYTES_IN) +
(1 << GLIBTOP_NETLOAD_BYTES_OUT) + (1L << GLIBTOP_NETLOAD_BYTES_OUT) +
(1 << GLIBTOP_NETLOAD_BYTES_TOTAL) + (1L << GLIBTOP_NETLOAD_BYTES_TOTAL) +
(1 << GLIBTOP_NETLOAD_ERRORS_IN) + (1L << GLIBTOP_NETLOAD_ERRORS_IN) +
(1 << GLIBTOP_NETLOAD_ERRORS_OUT) + (1L << GLIBTOP_NETLOAD_ERRORS_OUT) +
(1 << GLIBTOP_NETLOAD_ERRORS_TOTAL) + (1L << GLIBTOP_NETLOAD_ERRORS_TOTAL) +
(1 << GLIBTOP_NETLOAD_COLLISIONS); (1L << GLIBTOP_NETLOAD_COLLISIONS);
/* nlist structure for kernel access */ /* nlist structure for kernel access */
static struct nlist nlst [] = { static struct nlist nlst [] = {
@@ -87,7 +87,7 @@ glibtop_get_netload_p (glibtop *server, glibtop_netload *buf,
struct in_ifaddr in; struct in_ifaddr in;
} ifaddr; } ifaddr;
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_NETLOAD), 0); glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_NETLOAD), 0);
memset (buf, 0, sizeof (glibtop_netload)); memset (buf, 0, sizeof (glibtop_netload));
@@ -107,7 +107,7 @@ glibtop_get_netload_p (glibtop *server, glibtop_netload *buf,
sizeof (ifnet)) != sizeof (ifnet)) sizeof (ifnet)) != sizeof (ifnet))
glibtop_error_io_r (server, "kvm_read (ifnetaddr)"); glibtop_error_io_r (server, "kvm_read (ifnetaddr)");
#ifdef __FreeBSD__ #if defined(__FreeBSD__) || defined(__bsdi__)
if (kvm_read (server->machine.kd, (u_long) ifnet.if_name, if (kvm_read (server->machine.kd, (u_long) ifnet.if_name,
tname, 16) != 16) tname, 16) != 16)
glibtop_error_io_r (server, "kvm_read (if_name)"); glibtop_error_io_r (server, "kvm_read (if_name)");
@@ -116,9 +116,9 @@ glibtop_get_netload_p (glibtop *server, glibtop_netload *buf,
tname [15] = 0; tname [15] = 0;
#endif #endif
#if (defined __FreeBSD__) && (__FreeBSD_version >= 300000) #if defined(__FreeBSD__) && (__FreeBSD_version >= 300000)
ifaddraddr = (u_long) ifnet.if_addrhead.tqh_first; ifaddraddr = (u_long) ifnet.if_addrhead.tqh_first;
#elif (defined __FreeBSD__) #elif defined(__FreeBSD__) || defined(__bsdi__)
ifaddraddr = (u_long) ifnet.if_addrlist; ifaddraddr = (u_long) ifnet.if_addrlist;
#else #else
ifaddraddr = (u_long) ifnet.if_addrlist.tqh_first; ifaddraddr = (u_long) ifnet.if_addrlist.tqh_first;
@@ -194,18 +194,18 @@ glibtop_get_netload_p (glibtop *server, glibtop_netload *buf,
return; return;
} }
#if (defined __FreeBSD__) && (__FreeBSD_version >= 300000) #if defined(__FreeBSD__) && (__FreeBSD_version >= 300000)
ifaddraddr = (u_long)ifaddr.ifa.ifa_link.tqe_next; ifaddraddr = (u_long)ifaddr.ifa.ifa_link.tqe_next;
#elif (defined __FreeBSD__) #elif defined(__FreeBSD__) || defined(__bsdi__)
ifaddraddr = (u_long)ifaddr.ifa.ifa_next; ifaddraddr = (u_long)ifaddr.ifa.ifa_next;
#else #else
ifaddraddr = (u_long)ifaddr.ifa.ifa_list.tqe_next; ifaddraddr = (u_long)ifaddr.ifa.ifa_list.tqe_next;
#endif #endif
} }
#if (defined __FreeBSD__) && (__FreeBSD_version >= 300000) #if defined(__FreeBSD__) && (__FreeBSD_version >= 300000)
ifnetaddr = (u_long) ifnet.if_link.tqe_next; ifnetaddr = (u_long) ifnet.if_link.tqe_next;
#elif (defined __FreeBSD__) #elif defined(__FreeBSD__) || defined(__bsdi__)
ifnetaddr = (u_long) ifnet.if_next; ifnetaddr = (u_long) ifnet.if_next;
#else #else
ifnetaddr = (u_long) ifnet.if_list.tqe_next; ifnetaddr = (u_long) ifnet.if_list.tqe_next;

View File

@@ -39,7 +39,7 @@
#include <net/netisr.h> #include <net/netisr.h>
#include <net/route.h> #include <net/route.h>
#ifdef __FreeBSD__ #if defined(__FreeBSD__) || defined(__NetBSD__)
#include <net/if_sppp.h> #include <net/if_sppp.h>
#else #else
#include <i4b/sppp/if_sppp.h> #include <i4b/sppp/if_sppp.h>
@@ -51,11 +51,11 @@
#endif #endif
static const unsigned long _glibtop_sysdeps_ppp = static const unsigned long _glibtop_sysdeps_ppp =
(1 << GLIBTOP_PPP_STATE); (1L << GLIBTOP_PPP_STATE);
#ifdef HAVE_I4B_ACCT #ifdef HAVE_I4B_ACCT
static const unsigned long _glibtop_sysdeps_ppp_acct = static const unsigned long _glibtop_sysdeps_ppp_acct =
(1 << GLIBTOP_PPP_BYTES_IN) + (1 << GLIBTOP_PPP_BYTES_OUT); (1L << GLIBTOP_PPP_BYTES_IN) + (1L << GLIBTOP_PPP_BYTES_OUT);
#endif #endif
#endif /* HAVE_I4B */ #endif /* HAVE_I4B */
@@ -99,7 +99,7 @@ glibtop_get_ppp_p (glibtop *server, glibtop_ppp *buf, unsigned short device)
#endif #endif
int phase; int phase;
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PPP), 0); glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PPP), 0);
memset (buf, 0, sizeof (glibtop_ppp)); memset (buf, 0, sizeof (glibtop_ppp));
@@ -110,10 +110,15 @@ glibtop_get_ppp_p (glibtop *server, glibtop_ppp *buf, unsigned short device)
#ifdef HAVE_I4B_ACCT #ifdef HAVE_I4B_ACCT
phase = data.sc_if_un.scu_sp.pp_phase; phase = data.sc_if_un.scu_sp.pp_phase;
#else #else
/* FIXME: Which FreeBSD version have this field and
* which not. */
#if 0
phase = data.pp_phase; phase = data.pp_phase;
#endif
#endif #endif
switch (phase) { switch (phase) {
#ifdef HAVE_I4B_ACCT
case PHASE_DEAD: case PHASE_DEAD:
case PHASE_TERMINATE: case PHASE_TERMINATE:
buf->state = GLIBTOP_PPP_STATE_HANGUP; buf->state = GLIBTOP_PPP_STATE_HANGUP;
@@ -122,6 +127,7 @@ glibtop_get_ppp_p (glibtop *server, glibtop_ppp *buf, unsigned short device)
case PHASE_NETWORK: case PHASE_NETWORK:
buf->state = GLIBTOP_PPP_STATE_ONLINE; buf->state = GLIBTOP_PPP_STATE_ONLINE;
break; break;
#endif
default: default:
buf->state = GLIBTOP_PPP_STATE_UNKNOWN; buf->state = GLIBTOP_PPP_STATE_UNKNOWN;
break; break;

View File

@@ -33,7 +33,7 @@
#include <sys/proc.h> #include <sys/proc.h>
static const unsigned long _glibtop_sysdeps_proc_args = static const unsigned long _glibtop_sysdeps_proc_args =
(1 << GLIBTOP_PROC_ARGS_SIZE); (1L << GLIBTOP_PROC_ARGS_SIZE);
/* Init function. */ /* Init function. */
@@ -54,18 +54,22 @@ glibtop_get_proc_args_p (glibtop *server, glibtop_proc_args *buf,
unsigned size = 0, pos = 0; unsigned size = 0, pos = 0;
int count; int count;
#ifndef __bsdi__
char filename [BUFSIZ]; char filename [BUFSIZ];
struct stat statb; struct stat statb;
#endif
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_ARGS), 0); glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_ARGS), 0);
memset (buf, 0, sizeof (glibtop_proc_args)); memset (buf, 0, sizeof (glibtop_proc_args));
/* swapper, init, pagedaemon, vmdaemon, update - this doen't work. */ /* swapper, init, pagedaemon, vmdaemon, update - this doen't work. */
if (pid < 5) return NULL; if (pid < 5) return NULL;
#ifndef __bsdi__
sprintf (filename, "/proc/%d/mem", pid); sprintf (filename, "/proc/%d/mem", pid);
if (stat (filename, &statb)) return NULL; if (stat (filename, &statb)) return NULL;
#endif
glibtop_suid_enter (server); glibtop_suid_enter (server);

View File

@@ -28,7 +28,7 @@
#define LINUX_VERSION(x,y,z) (0x10000*(x) + 0x100*(y) + z) #define LINUX_VERSION(x,y,z) (0x10000*(x) + 0x100*(y) + z)
#define BIT_SHIFT(x) (1 << (x % 32)) #define BIT_SHIFT(x) (1L << (x % 64))
static const unsigned long _glibtop_sysdeps_procdata_0 = static const unsigned long _glibtop_sysdeps_procdata_0 =
BIT_SHIFT(GLIBTOP_PROCDATA_CMD) + BIT_SHIFT(GLIBTOP_PROCDATA_CMD) +

View File

@@ -31,10 +31,12 @@
#include <sys/param.h> #include <sys/param.h>
#include <sys/sysctl.h> #include <sys/sysctl.h>
#include <sys/proc.h> #include <sys/proc.h>
#ifndef __OpenBSD__ #if (!defined __OpenBSD__) && (!defined __bsdi__)
#include <sys/user.h> #include <sys/user.h>
#endif #endif
#ifndef __bsdi__
#include <machine/pcb.h> #include <machine/pcb.h>
#endif
#ifdef __FreeBSD__ #ifdef __FreeBSD__
#include <machine/tss.h> #include <machine/tss.h>
#endif #endif
@@ -47,18 +49,18 @@
#endif #endif
static const unsigned long _glibtop_sysdeps_proc_kernel_pstats = static const unsigned long _glibtop_sysdeps_proc_kernel_pstats =
(1 << GLIBTOP_PROC_KERNEL_MIN_FLT) + (1L << GLIBTOP_PROC_KERNEL_MIN_FLT) +
(1 << GLIBTOP_PROC_KERNEL_MAJ_FLT) + (1L << GLIBTOP_PROC_KERNEL_MAJ_FLT) +
(1 << GLIBTOP_PROC_KERNEL_CMIN_FLT) + (1L << GLIBTOP_PROC_KERNEL_CMIN_FLT) +
(1 << GLIBTOP_PROC_KERNEL_CMAJ_FLT); (1L << GLIBTOP_PROC_KERNEL_CMAJ_FLT);
static const unsigned long _glibtop_sysdeps_proc_kernel_pcb = static const unsigned long _glibtop_sysdeps_proc_kernel_pcb =
(1 << GLIBTOP_PROC_KERNEL_KSTK_EIP) + (1L << GLIBTOP_PROC_KERNEL_KSTK_EIP) +
(1 << GLIBTOP_PROC_KERNEL_KSTK_ESP); (1L << GLIBTOP_PROC_KERNEL_KSTK_ESP);
static const unsigned long _glibtop_sysdeps_proc_kernel_wchan = static const unsigned long _glibtop_sysdeps_proc_kernel_wchan =
(1 << GLIBTOP_PROC_KERNEL_NWCHAN) + (1L << GLIBTOP_PROC_KERNEL_NWCHAN) +
(1 << GLIBTOP_PROC_KERNEL_WCHAN); (1L << GLIBTOP_PROC_KERNEL_WCHAN);
/* Init function. */ /* Init function. */
@@ -84,7 +86,7 @@ glibtop_get_proc_kernel_p (glibtop *server,
char filename [BUFSIZ]; char filename [BUFSIZ];
struct stat statb; struct stat statb;
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_KERNEL), 0); glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_KERNEL), 0);
memset (buf, 0, sizeof (glibtop_proc_kernel)); memset (buf, 0, sizeof (glibtop_proc_kernel));
@@ -100,13 +102,13 @@ glibtop_get_proc_kernel_p (glibtop *server,
glibtop_error_io_r (server, "kvm_getprocs (%d)", pid); glibtop_error_io_r (server, "kvm_getprocs (%d)", pid);
buf->nwchan = (unsigned long) pinfo [0].kp_proc.p_wchan &~ KERNBASE; buf->nwchan = (unsigned long) pinfo [0].kp_proc.p_wchan &~ KERNBASE;
buf->flags |= (1 << GLIBTOP_PROC_KERNEL_NWCHAN); buf->flags |= (1L << GLIBTOP_PROC_KERNEL_NWCHAN);
if (pinfo [0].kp_proc.p_wchan && pinfo [0].kp_proc.p_wmesg) { if (pinfo [0].kp_proc.p_wchan && pinfo [0].kp_proc.p_wmesg) {
strncpy (buf->wchan, pinfo [0].kp_eproc.e_wmesg, strncpy (buf->wchan, pinfo [0].kp_eproc.e_wmesg,
sizeof (buf->wchan) - 1); sizeof (buf->wchan) - 1);
buf->wchan [sizeof (buf->wchan) - 1] = 0; buf->wchan [sizeof (buf->wchan) - 1] = 0;
buf->flags |= (1 << GLIBTOP_PROC_KERNEL_WCHAN); buf->flags |= (1L << GLIBTOP_PROC_KERNEL_WCHAN);
} else { } else {
buf->wchan [0] = 0; buf->wchan [0] = 0;
} }
@@ -122,7 +124,7 @@ glibtop_get_proc_kernel_p (glibtop *server,
/* NOTE: You need to mount the /proc filesystem to make /* NOTE: You need to mount the /proc filesystem to make
* `kvm_uread' work. */ * `kvm_uread' work. */
sprintf (filename, "/proc/%d/mem", pid); sprintf (filename, "/proc/%d/mem", (int) pid);
if (stat (filename, &statb)) return; if (stat (filename, &statb)) return;
glibtop_suid_enter (server); glibtop_suid_enter (server);
@@ -162,7 +164,11 @@ glibtop_get_proc_kernel_p (glibtop *server,
#endif #endif
#else #else
buf->kstk_esp = (u_int64_t) pcb.pcb_tss.tss_esp0; buf->kstk_esp = (u_int64_t) pcb.pcb_tss.tss_esp0;
#ifdef __bsdi__
buf->kstk_eip = (u_int64_t) pcb.pcb_tss.tss_eip;
#else
buf->kstk_eip = (u_int64_t) pcb.pcb_tss.__tss_eip; buf->kstk_eip = (u_int64_t) pcb.pcb_tss.__tss_eip;
#endif
buf->flags |= _glibtop_sysdeps_proc_kernel_pcb; buf->flags |= _glibtop_sysdeps_proc_kernel_pcb;
#endif #endif

View File

@@ -29,8 +29,8 @@
#include <glibtop_suid.h> #include <glibtop_suid.h>
static const unsigned long _glibtop_sysdeps_proclist = static const unsigned long _glibtop_sysdeps_proclist =
(1 << GLIBTOP_PROCLIST_TOTAL) + (1 << GLIBTOP_PROCLIST_NUMBER) + (1L << GLIBTOP_PROCLIST_TOTAL) + (1L << GLIBTOP_PROCLIST_NUMBER) +
(1 << GLIBTOP_PROCLIST_SIZE); (1L << GLIBTOP_PROCLIST_SIZE);
/* Fetch list of currently running processes. /* Fetch list of currently running processes.
* The interface of this function is a little bit different from the others: * The interface of this function is a little bit different from the others:
@@ -67,7 +67,7 @@ glibtop_get_proclist_p (glibtop *server, glibtop_proclist *buf,
int which, count; int which, count;
int i,j; int i,j;
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROCLIST), 0); glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROCLIST), 0);
memset (buf, 0, sizeof (glibtop_proclist)); memset (buf, 0, sizeof (glibtop_proclist));

View File

@@ -42,20 +42,28 @@
#include <ufs/ufs/inode.h> #include <ufs/ufs/inode.h>
#include <sys/ucred.h> #include <sys/ucred.h>
#ifndef __OpenBSD__ #if (!defined __OpenBSD__) && (!defined __bsdi__)
#include <sys/user.h> #include <sys/user.h>
#endif #endif
#include <sys/sysctl.h> #include <sys/sysctl.h>
#include <vm/vm.h> #include <vm/vm.h>
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
/* Fixme ... */
#undef _KERNEL
#define _UVM_UVM_AMAP_I_H_ 1
#define _UVM_UVM_MAP_I_H_ 1
#include <uvm/uvm.h>
#endif
static const unsigned long _glibtop_sysdeps_proc_map = static const unsigned long _glibtop_sysdeps_proc_map =
(1 << GLIBTOP_PROC_MAP_TOTAL) + (1 << GLIBTOP_PROC_MAP_NUMBER) + (1L << GLIBTOP_PROC_MAP_TOTAL) + (1L << GLIBTOP_PROC_MAP_NUMBER) +
(1 << GLIBTOP_PROC_MAP_SIZE); (1L << GLIBTOP_PROC_MAP_SIZE);
static const unsigned long _glibtop_sysdeps_map_entry = static const unsigned long _glibtop_sysdeps_map_entry =
(1 << GLIBTOP_MAP_ENTRY_START) + (1 << GLIBTOP_MAP_ENTRY_END) + (1L << GLIBTOP_MAP_ENTRY_START) + (1L << GLIBTOP_MAP_ENTRY_END) +
(1 << GLIBTOP_MAP_ENTRY_OFFSET) + (1 << GLIBTOP_MAP_ENTRY_PERM) + (1L << GLIBTOP_MAP_ENTRY_OFFSET) + (1L << GLIBTOP_MAP_ENTRY_PERM) +
(1 << GLIBTOP_MAP_ENTRY_INODE) + (1 << GLIBTOP_MAP_ENTRY_DEVICE); (1L << GLIBTOP_MAP_ENTRY_INODE) + (1L << GLIBTOP_MAP_ENTRY_DEVICE);
/* Init function. */ /* Init function. */
@@ -74,15 +82,22 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf,
struct kinfo_proc *pinfo; struct kinfo_proc *pinfo;
struct vm_map_entry entry, *first; struct vm_map_entry entry, *first;
struct vmspace vmspace; struct vmspace vmspace;
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
struct vnode vnode;
struct inode inode;
#else
struct vm_object object; struct vm_object object;
#endif
glibtop_map_entry *maps; glibtop_map_entry *maps;
#if defined __FreeBSD__
struct vnode vnode; struct vnode vnode;
struct inode inode; struct inode inode;
struct mount mount; struct mount mount;
#endif
int count, i = 0; int count, i = 0;
int update = 0; int update = 0;
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_MAP), 0); glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_MAP), 0);
memset (buf, 0, sizeof (glibtop_proc_map)); memset (buf, 0, sizeof (glibtop_proc_map));
@@ -147,9 +162,14 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf,
if (entry.eflags & (MAP_ENTRY_IS_A_MAP|MAP_ENTRY_IS_SUB_MAP)) if (entry.eflags & (MAP_ENTRY_IS_A_MAP|MAP_ENTRY_IS_SUB_MAP))
continue; continue;
#endif #endif
#else
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
if (UVM_ET_ISSUBMAP (&entry))
continue;
#else #else
if (entry.is_a_map || entry.is_sub_map) if (entry.is_a_map || entry.is_sub_map)
continue; continue;
#endif
#endif #endif
maps [i].flags = _glibtop_sysdeps_map_entry; maps [i].flags = _glibtop_sysdeps_map_entry;
@@ -169,6 +189,19 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf,
i++; i++;
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
if (!entry.object.uvm_obj)
continue;
/* We're only interested in vnodes */
if (kvm_read (server->machine.kd,
(unsigned long) entry.object.uvm_obj,
&vnode, sizeof (vnode)) != sizeof (vnode)) {
glibtop_warn_io_r (server, "kvm_read (vnode)");
return NULL;
}
#else
if (!entry.object.vm_object) if (!entry.object.vm_object)
continue; continue;
@@ -178,6 +211,24 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf,
(unsigned long) entry.object.vm_object, (unsigned long) entry.object.vm_object,
&object, sizeof (object)) != sizeof (object)) &object, sizeof (object)) != sizeof (object))
glibtop_error_io_r (server, "kvm_read (object)"); glibtop_error_io_r (server, "kvm_read (object)");
#endif
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
if (!vnode.v_uvm.u_flags & UVM_VNODE_VALID)
continue;
if ((vnode.v_type != VREG) || (vnode.v_tag != VT_UFS) ||
!vnode.v_data) continue;
if (kvm_read (server->machine.kd,
(unsigned long) vnode.v_data,
&inode, sizeof (inode)) != sizeof (inode))
glibtop_error_io_r (server, "kvm_read (inode)");
maps [i-1].inode = inode.i_number;
maps [i-1].device = inode.i_dev;
#endif
#ifdef __FreeBSD__ #ifdef __FreeBSD__
/* If the object is of type vnode, add its size */ /* If the object is of type vnode, add its size */

View File

@@ -39,19 +39,35 @@
#include <ufs/ufs/inode.h> #include <ufs/ufs/inode.h>
#include <sys/ucred.h> #include <sys/ucred.h>
#ifndef __OpenBSD__ #if (!defined __OpenBSD__) && (!defined __bsdi__)
#include <sys/user.h> #include <sys/user.h>
#endif #endif
#include <sys/sysctl.h> #include <sys/sysctl.h>
#include <vm/vm.h> #include <vm/vm.h>
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
/* Fixme ... */
#undef _KERNEL
#define _UVM_UVM_AMAP_I_H_ 1
#define _UVM_UVM_MAP_I_H_ 1
#include <uvm/uvm.h>
#endif
static const unsigned long _glibtop_sysdeps_proc_mem = static const unsigned long _glibtop_sysdeps_proc_mem =
(1 << GLIBTOP_PROC_MEM_SIZE) + (1L << GLIBTOP_PROC_MEM_SIZE) +
(1 << GLIBTOP_PROC_MEM_VSIZE) + (1L << GLIBTOP_PROC_MEM_VSIZE) +
(1 << GLIBTOP_PROC_MEM_SHARE) + (1L << GLIBTOP_PROC_MEM_RESIDENT) +
(1 << GLIBTOP_PROC_MEM_RESIDENT) + (1L << GLIBTOP_PROC_MEM_RSS) +
(1 << GLIBTOP_PROC_MEM_RSS) + (1L << GLIBTOP_PROC_MEM_RSS_RLIM);
(1 << GLIBTOP_PROC_MEM_RSS_RLIM);
static const unsigned long _glibtop_sysdeps_proc_mem_share =
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
(1L << GLIBTOP_PROC_MEM_SHARE);
#elif defined(__FreeBSD__)
(1L << GLIBTOP_PROC_MEM_SHARE);
#else
0;
#endif
#ifndef LOG1024 #ifndef LOG1024
#define LOG1024 10 #define LOG1024 10
@@ -82,7 +98,8 @@ glibtop_init_proc_mem_p (glibtop *server)
/* we only need the amount of log(2)1024 for our conversion */ /* we only need the amount of log(2)1024 for our conversion */
pageshift -= LOG1024; pageshift -= LOG1024;
server->sysdeps.proc_mem = _glibtop_sysdeps_proc_mem; server->sysdeps.proc_mem = _glibtop_sysdeps_proc_mem |
_glibtop_sysdeps_proc_mem_share;
} }
/* Provides detailed information about a process. */ /* Provides detailed information about a process. */
@@ -94,11 +111,16 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf,
struct kinfo_proc *pinfo; struct kinfo_proc *pinfo;
struct vm_map_entry entry, *first; struct vm_map_entry entry, *first;
struct vmspace *vms, vmspace; struct vmspace *vms, vmspace;
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
struct vnode vnode;
struct inode inode;
#else
struct vm_object object; struct vm_object object;
#endif
struct plimit plimit; struct plimit plimit;
int count; int count;
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_MEM), 0); glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_MEM), 0);
memset (buf, 0, sizeof (glibtop_proc_mem)); memset (buf, 0, sizeof (glibtop_proc_mem));
@@ -173,11 +195,29 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf,
if (entry.eflags & (MAP_ENTRY_IS_A_MAP|MAP_ENTRY_IS_SUB_MAP)) if (entry.eflags & (MAP_ENTRY_IS_A_MAP|MAP_ENTRY_IS_SUB_MAP))
continue; continue;
#endif #endif
#else
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
if (UVM_ET_ISSUBMAP (&entry))
continue;
#else #else
if (entry.is_a_map || entry.is_sub_map) if (entry.is_a_map || entry.is_sub_map)
continue; continue;
#endif #endif
#endif
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
if (!entry.object.uvm_obj)
continue;
/* We're only interested in vnodes */
if (kvm_read (server->machine.kd,
(unsigned long) entry.object.uvm_obj,
&vnode, sizeof (vnode)) != sizeof (vnode)) {
glibtop_warn_io_r (server, "kvm_read (vnode)");
return;
}
#else
if (!entry.object.vm_object) if (!entry.object.vm_object)
continue; continue;
@@ -189,18 +229,31 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf,
glibtop_warn_io_r (server, "kvm_read (object)"); glibtop_warn_io_r (server, "kvm_read (object)");
return; return;
} }
#endif
/* If the object is of type vnode, add its size */ /* If the object is of type vnode, add its size */
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
if (!vnode.v_uvm.u_flags & UVM_VNODE_VALID)
continue;
if ((vnode.v_type != VREG) || (vnode.v_tag != VT_UFS) ||
!vnode.v_data) continue;
/* Reference count must be at least two. */
if (vnode.v_uvm.u_obj.uo_refs <= 1)
continue;
buf->share += pagetok (vnode.v_uvm.u_obj.uo_npages) << LOG1024;
#endif
#ifdef __FreeBSD__ #ifdef __FreeBSD__
if (object.type != OBJT_VNODE) if (object.type != OBJT_VNODE)
continue; continue;
buf->share += object.un_pager.vnp.vnp_size; buf->share += object.un_pager.vnp.vnp_size;
#else
buf->share += object.size;
#endif #endif
} }
buf->flags = _glibtop_sysdeps_proc_mem; buf->flags = _glibtop_sysdeps_proc_mem |
_glibtop_sysdeps_proc_mem_share;
} }

View File

@@ -48,7 +48,7 @@ glibtop_get_proc_segment_p (glibtop *server,
glibtop_proc_segment *buf, glibtop_proc_segment *buf,
pid_t pid) pid_t pid)
{ {
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_SEGMENT), 0); glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_SEGMENT), 0);
memset (buf, 0, sizeof (glibtop_proc_segment)); memset (buf, 0, sizeof (glibtop_proc_segment));

View File

@@ -28,10 +28,10 @@
#include <glibtop_suid.h> #include <glibtop_suid.h>
static const unsigned long _glibtop_sysdeps_proc_signal = static const unsigned long _glibtop_sysdeps_proc_signal =
(1 << GLIBTOP_PROC_SIGNAL_SIGNAL) + (1L << GLIBTOP_PROC_SIGNAL_SIGNAL) +
(1 << GLIBTOP_PROC_SIGNAL_BLOCKED) + (1L << GLIBTOP_PROC_SIGNAL_BLOCKED) +
(1 << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + (1L << GLIBTOP_PROC_SIGNAL_SIGIGNORE) +
(1 << GLIBTOP_PROC_SIGNAL_SIGCATCH); (1L << GLIBTOP_PROC_SIGNAL_SIGCATCH);
/* Init function. */ /* Init function. */
@@ -49,7 +49,7 @@ glibtop_get_proc_signal_p (glibtop *server,
struct kinfo_proc *pinfo; struct kinfo_proc *pinfo;
int count = 0; int count = 0;
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_SIGNAL), 0); glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_SIGNAL), 0);
memset (buf, 0, sizeof (glibtop_proc_signal)); memset (buf, 0, sizeof (glibtop_proc_signal));

View File

@@ -27,20 +27,29 @@
#include <glibtop_suid.h> #include <glibtop_suid.h>
#ifndef __OpenBSD__ #if !defined(__OpenBSD__)
//&& (!defined __bsdi__)
#include <sys/user.h> #include <sys/user.h>
#endif #endif
static const unsigned long _glibtop_sysdeps_proc_state = static const unsigned long _glibtop_sysdeps_proc_state =
(1 << GLIBTOP_PROC_STATE_CMD) + (1 << GLIBTOP_PROC_STATE_STATE) + (1L << GLIBTOP_PROC_STATE_CMD) + (1L << GLIBTOP_PROC_STATE_UID) +
(1 << GLIBTOP_PROC_STATE_UID) + (1 << GLIBTOP_PROC_STATE_GID); (1L << GLIBTOP_PROC_STATE_GID);
static const unsigned long _glibtop_sysdeps_proc_state_new =
#if LIBGTOP_VERSION_CODE >= 1001000
(1L << GLIBTOP_PROC_STATE_RUID) + (1L << GLIBTOP_PROC_STATE_RGID);
#else
0;
#endif
/* Init function. */ /* Init function. */
void void
glibtop_init_proc_state_p (glibtop *server) glibtop_init_proc_state_p (glibtop *server)
{ {
server->sysdeps.proc_state = _glibtop_sysdeps_proc_state; server->sysdeps.proc_state = _glibtop_sysdeps_proc_state |
_glibtop_sysdeps_proc_state_new;
} }
/* Provides detailed information about a process. */ /* Provides detailed information about a process. */
@@ -53,7 +62,7 @@ glibtop_get_proc_state_p (glibtop *server,
struct kinfo_proc *pinfo; struct kinfo_proc *pinfo;
int count = 0; int count = 0;
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_STATE), 0); glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_STATE), 0);
memset (buf, 0, sizeof (glibtop_proc_state)); memset (buf, 0, sizeof (glibtop_proc_state));
@@ -73,27 +82,34 @@ glibtop_get_proc_state_p (glibtop *server,
buf->uid = pinfo [0].kp_eproc.e_pcred.p_svuid; buf->uid = pinfo [0].kp_eproc.e_pcred.p_svuid;
buf->gid = pinfo [0].kp_eproc.e_pcred.p_svgid; buf->gid = pinfo [0].kp_eproc.e_pcred.p_svgid;
switch (pinfo [0].kp_proc.p_stat) { #if LIBGTOP_VERSION_CODE >= 1001000
case SIDL: buf->ruid = pinfo [0].kp_eproc.e_pcred.p_ruid;
buf->state = 'I'; buf->rgid = pinfo [0].kp_eproc.e_pcred.p_rgid;
break; #endif
case SRUN:
buf->state = 'R';
break;
case SSLEEP:
buf->state = 'S';
break;
case SSTOP:
buf->state = 'T';
break;
case SZOMB:
buf->state = 'Z';
break;
default:
buf->state = '?';
break;
}
/* Set the flags for the data we're about to return*/ /* Set the flags for the data we're about to return*/
buf->flags = _glibtop_sysdeps_proc_state; buf->flags = _glibtop_sysdeps_proc_state |
_glibtop_sysdeps_proc_state_new;
switch (pinfo [0].kp_proc.p_stat) {
case SIDL:
buf->state = 0;
break;
case SRUN:
buf->state = GLIBTOP_PROCESS_RUNNING;
break;
case SSLEEP:
buf->state = GLIBTOP_PROCESS_INTERRUPTIBLE;
break;
case SSTOP:
buf->state = GLIBTOP_PROCESS_STOPPED;
break;
case SZOMB:
buf->state = GLIBTOP_PROCESS_ZOMBIE;
break;
default:
return;
}
buf->flags |= (1L << GLIBTOP_PROC_STATE_STATE);
} }

View File

@@ -32,11 +32,12 @@
#endif #endif
static const unsigned long _glibtop_sysdeps_proc_time = static const unsigned long _glibtop_sysdeps_proc_time =
(1 << GLIBTOP_PROC_TIME_RTIME) + (1 << GLIBTOP_PROC_TIME_FREQUENCY); (1L << GLIBTOP_PROC_TIME_RTIME) + (1L << GLIBTOP_PROC_TIME_FREQUENCY);
static const unsigned long _glibtop_sysdeps_proc_time_user = static const unsigned long _glibtop_sysdeps_proc_time_user =
(1 << GLIBTOP_PROC_TIME_UTIME) + (1 << GLIBTOP_PROC_TIME_STIME) + (1L << GLIBTOP_PROC_TIME_UTIME) + (1L << GLIBTOP_PROC_TIME_STIME) +
(1 << GLIBTOP_PROC_TIME_CUTIME) + (1 << GLIBTOP_PROC_TIME_CSTIME); (1L << GLIBTOP_PROC_TIME_CUTIME) + (1L << GLIBTOP_PROC_TIME_CSTIME) +
(1L << GLIBTOP_PROC_TIME_START_TIME);
#define tv2sec(tv) (((u_int64_t) tv.tv_sec * 1000000) + (u_int64_t) tv.tv_usec) #define tv2sec(tv) (((u_int64_t) tv.tv_sec * 1000000) + (u_int64_t) tv.tv_usec)
@@ -123,31 +124,74 @@ glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf,
pid_t pid) pid_t pid)
{ {
struct kinfo_proc *pinfo; struct kinfo_proc *pinfo;
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
register struct rusage *rup;
#else
struct user *u_addr = (struct user *)USRSTACK; struct user *u_addr = (struct user *)USRSTACK;
#endif
struct pstats pstats; struct pstats pstats;
int count; int count;
char filename [BUFSIZ]; char filename [BUFSIZ];
struct stat statb; struct stat statb;
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_TIME), 0); glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_TIME), 0);
memset (buf, 0, sizeof (glibtop_proc_time)); memset (buf, 0, sizeof (glibtop_proc_time));
if (server->sysdeps.proc_time == 0)
return;
/* It does not work for the swapper task. */ /* It does not work for the swapper task. */
if (pid == 0) return; if (pid == 0) return;
sprintf (filename, "/proc/%d/mem", pid); #if !(defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000))
if (server->sysdeps.proc_time == 0)
return;
#ifndef __bsdi__
sprintf (filename, "/proc/%d/mem", (int) pid);
if (stat (filename, &statb)) return; if (stat (filename, &statb)) return;
#endif
#endif
/* Get the process information */ /* Get the process information */
pinfo = kvm_getprocs (server->machine.kd, KERN_PROC_PID, pid, &count); pinfo = kvm_getprocs (server->machine.kd, KERN_PROC_PID, pid, &count);
if ((pinfo == NULL) || (count != 1)) if ((pinfo == NULL) || (count != 1))
glibtop_error_io_r (server, "kvm_getprocs (%d)", pid); glibtop_error_io_r (server, "kvm_getprocs (%d)", pid);
#if (defined __FreeBSD__) && (__FreeBSD_version >= 300003)
buf->rtime = pinfo [0].kp_proc.p_runtime;
#else
buf->rtime = tv2sec (pinfo [0].kp_proc.p_rtime);
#endif
buf->frequency = 1000000;
buf->flags = _glibtop_sysdeps_proc_time;
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
glibtop_suid_enter (server);
if (kvm_read (server->machine.kd,
(unsigned long) pinfo [0].kp_proc.p_stats,
&pstats, sizeof (pstats)) != sizeof (pstats)) {
glibtop_warn_io_r (server, "kvm_read (pstats)");
return;
}
glibtop_suid_leave (server);
rup = &pstats.p_ru;
calcru(&(pinfo [0]).kp_proc,
&rup->ru_utime, &rup->ru_stime, NULL);
buf->utime = tv2sec (pstats.p_ru.ru_utime);
buf->stime = tv2sec (pstats.p_ru.ru_stime);
buf->cutime = tv2sec (pstats.p_cru.ru_utime);
buf->cstime = tv2sec (pstats.p_cru.ru_stime);
buf->start_time = (u_int64_t) pstats.p_start.tv_sec;
buf->flags |= _glibtop_sysdeps_proc_time_user;
#else
glibtop_suid_enter (server); glibtop_suid_enter (server);
if ((pinfo [0].kp_proc.p_flag & P_INMEM) && if ((pinfo [0].kp_proc.p_flag & P_INMEM) &&
@@ -180,15 +224,6 @@ glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf,
} }
glibtop_suid_leave (server); glibtop_suid_leave (server);
#if (defined __FreeBSD__) && (__FreeBSD_version >= 300003)
buf->rtime = pinfo [0].kp_proc.p_runtime;
#else
buf->rtime = tv2sec (pinfo [0].kp_proc.p_rtime);
#endif #endif
buf->frequency = 1000000;
buf->flags |= _glibtop_sysdeps_proc_time;
} }

View File

@@ -28,18 +28,30 @@
#include <glibtop_suid.h> #include <glibtop_suid.h>
static const unsigned long _glibtop_sysdeps_proc_uid = static const unsigned long _glibtop_sysdeps_proc_uid =
(1 << GLIBTOP_PROC_UID_UID) + (1 << GLIBTOP_PROC_UID_EUID) + (1L << GLIBTOP_PROC_UID_UID) + (1L << GLIBTOP_PROC_UID_EUID) +
(1 << GLIBTOP_PROC_UID_EGID) + (1 << GLIBTOP_PROC_UID_PID) + (1L << GLIBTOP_PROC_UID_EGID) + (1L << GLIBTOP_PROC_UID_PID) +
(1 << GLIBTOP_PROC_UID_PPID) + (1 << GLIBTOP_PROC_UID_PGRP) + (1L << GLIBTOP_PROC_UID_PPID) + (1L << GLIBTOP_PROC_UID_PGRP) +
(1 << GLIBTOP_PROC_UID_TPGID) + (1 << GLIBTOP_PROC_UID_PRIORITY) + (1L << GLIBTOP_PROC_UID_TPGID) + (1L << GLIBTOP_PROC_UID_PRIORITY) +
(1 << GLIBTOP_PROC_UID_NICE); (1L << GLIBTOP_PROC_UID_NICE);
static const unsigned long _glibtop_sysdeps_proc_uid_groups =
#if LIBGTOP_VERSION_CODE >= 1001000
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
(1L << GLIBTOP_PROC_UID_NGROUPS) + (1L << GLIBTOP_PROC_UID_GROUPS);
#else
0L;
#endif
#else /* LIBGTOP_VERSION_CODE < 1001000 */
0L;
#endif
/* Init function. */ /* Init function. */
void void
glibtop_init_proc_uid_p (glibtop *server) glibtop_init_proc_uid_p (glibtop *server)
{ {
server->sysdeps.proc_uid = _glibtop_sysdeps_proc_uid; server->sysdeps.proc_uid = _glibtop_sysdeps_proc_uid |
_glibtop_sysdeps_proc_uid_groups;
} }
/* Provides detailed information about a process. */ /* Provides detailed information about a process. */
@@ -51,7 +63,14 @@ glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf,
struct kinfo_proc *pinfo; struct kinfo_proc *pinfo;
int count = 0; int count = 0;
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_UID), 0); #if LIBGTOP_VERSION_CODE >= 1001000
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
struct ucred ucred;
void *ucred_ptr;
#endif
#endif
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_UID), 0);
memset (buf, 0, sizeof (glibtop_proc_uid)); memset (buf, 0, sizeof (glibtop_proc_uid));
@@ -80,4 +99,30 @@ glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf,
/* Set the flags for the data we're about to return*/ /* Set the flags for the data we're about to return*/
buf->flags = _glibtop_sysdeps_proc_uid; buf->flags = _glibtop_sysdeps_proc_uid;
/* Use LibGTop conditionals here so we can more easily merge this
* code into the LIBGTOP_STABLE_1_0 branch. */
#if LIBGTOP_VERSION_CODE >= 1001000
/* This probably also works with other versions, but not yet
* tested. Please remove the conditional if this is true. */
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
ucred_ptr = (void *) pinfo [0].kp_eproc.e_pcred.pc_ucred;
if (ucred_ptr) {
if (kvm_read (server->machine.kd, (unsigned long) ucred_ptr,
&ucred, sizeof (ucred)) != sizeof (ucred)) {
glibtop_warn_io_r (server, "kvm_read (ucred)");
} else {
int count = (ucred.cr_ngroups < GLIBTOP_MAX_GROUPS) ?
ucred.cr_ngroups : GLIBTOP_MAX_GROUPS;
int i;
for (i = 0; i < count; i++)
buf->groups [i] = ucred.cr_groups [i];
buf->ngroups = count;
buf->flags |= _glibtop_sysdeps_proc_uid_groups;
}
}
#endif
#endif
} }

View File

@@ -27,9 +27,26 @@
#include <glibtop_suid.h> #include <glibtop_suid.h>
#if defined(__bsdi__) && (_BSDI_VERSION < 199700)
/* Older versions of BSDI don't seem to have this. */
void
glibtop_init_sem_limits_p (glibtop *server)
{ }
void
glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf)
{
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SEM_LIMITS), 0);
memset (buf, 0, sizeof (glibtop_sem_limits));
}
#else
/* #define KERNEL to get declaration of `struct seminfo'. */ /* #define KERNEL to get declaration of `struct seminfo'. */
#ifdef __FreeBSD__ #if defined(__FreeBSD__) || defined(__bsdi__)
#define KERNEL 1 #define KERNEL 1
#else #else
#define _KERNEL 1 #define _KERNEL 1
@@ -39,11 +56,11 @@
#include <sys/sem.h> #include <sys/sem.h>
static unsigned long _glibtop_sysdeps_sem_limits = static unsigned long _glibtop_sysdeps_sem_limits =
(1 << GLIBTOP_IPC_SEMMAP) + (1 << GLIBTOP_IPC_SEMMNI) + (1L << GLIBTOP_IPC_SEMMAP) + (1L << GLIBTOP_IPC_SEMMNI) +
(1 << GLIBTOP_IPC_SEMMNS) + (1 << GLIBTOP_IPC_SEMMNU) + (1L << GLIBTOP_IPC_SEMMNS) + (1L << GLIBTOP_IPC_SEMMNU) +
(1 << GLIBTOP_IPC_SEMMSL) + (1 << GLIBTOP_IPC_SEMOPM) + (1L << GLIBTOP_IPC_SEMMSL) + (1L << GLIBTOP_IPC_SEMOPM) +
(1 << GLIBTOP_IPC_SEMUME) + (1 << GLIBTOP_IPC_SEMUSZ) + (1L << GLIBTOP_IPC_SEMUME) + (1L << GLIBTOP_IPC_SEMUSZ) +
(1 << GLIBTOP_IPC_SEMVMX) + (1 << GLIBTOP_IPC_SEMAEM); (1L << GLIBTOP_IPC_SEMVMX) + (1L << GLIBTOP_IPC_SEMAEM);
/* The values in this structure never change at runtime, so we only /* The values in this structure never change at runtime, so we only
* read it once during initialization. We have to use the name `_seminfo' * read it once during initialization. We have to use the name `_seminfo'
@@ -80,7 +97,7 @@ glibtop_init_sem_limits_p (glibtop *server)
void void
glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf) glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf)
{ {
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SEM_LIMITS), 0); glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SEM_LIMITS), 0);
memset (buf, 0, sizeof (glibtop_sem_limits)); memset (buf, 0, sizeof (glibtop_sem_limits));
@@ -98,3 +115,6 @@ glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf)
buf->flags = _glibtop_sysdeps_sem_limits; buf->flags = _glibtop_sysdeps_sem_limits;
} }
#endif /* either a newer BSDI or no BSDI at all. */

View File

@@ -27,9 +27,26 @@
#include <glibtop_suid.h> #include <glibtop_suid.h>
#if defined(__bsdi__) && (_BSDI_VERSION < 199700)
/* Older versions of BSDI don't seem to have this. */
void
glibtop_init_shm_limits_p (glibtop *server)
{ }
void
glibtop_get_shm_limits_p (glibtop *server, glibtop_shm_limits *buf)
{
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SHM_LIMITS), 0);
memset (buf, 0, sizeof (glibtop_shm_limits));
}
#else
/* #define KERNEL to get declaration of `struct shminfo'. */ /* #define KERNEL to get declaration of `struct shminfo'. */
#ifdef __FreeBSD__ #if defined(__FreeBSD__) || defined(__bsdi__)
#define KERNEL 1 #define KERNEL 1
#else #else
#define _KERNEL 1 #define _KERNEL 1
@@ -39,9 +56,9 @@
#include <sys/shm.h> #include <sys/shm.h>
static unsigned long _glibtop_sysdeps_shm_limits = static unsigned long _glibtop_sysdeps_shm_limits =
(1 << GLIBTOP_IPC_SHMMAX) + (1 << GLIBTOP_IPC_SHMMIN) + (1L << GLIBTOP_IPC_SHMMAX) + (1L << GLIBTOP_IPC_SHMMIN) +
(1 << GLIBTOP_IPC_SHMMNI) + (1 << GLIBTOP_IPC_SHMSEG) + (1L << GLIBTOP_IPC_SHMMNI) + (1L << GLIBTOP_IPC_SHMSEG) +
(1 << GLIBTOP_IPC_SHMALL); (1L << GLIBTOP_IPC_SHMALL);
/* The values in this structure never change at runtime, so we only /* The values in this structure never change at runtime, so we only
* read it once during initialization. We have to use the name `_shminfo' * read it once during initialization. We have to use the name `_shminfo'
@@ -78,7 +95,7 @@ glibtop_init_shm_limits_p (glibtop *server)
void void
glibtop_get_shm_limits_p (glibtop *server, glibtop_shm_limits *buf) glibtop_get_shm_limits_p (glibtop *server, glibtop_shm_limits *buf)
{ {
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SHM_LIMITS), 0); glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SHM_LIMITS), 0);
memset (buf, 0, sizeof (glibtop_shm_limits)); memset (buf, 0, sizeof (glibtop_shm_limits));
@@ -93,3 +110,6 @@ glibtop_get_shm_limits_p (glibtop *server, glibtop_shm_limits *buf)
buf->flags = _glibtop_sysdeps_shm_limits; buf->flags = _glibtop_sysdeps_shm_limits;
} }
#endif /* either a newer BSDI or no BSDI at all. */

View File

@@ -30,19 +30,28 @@
#include <glibtop_suid.h> #include <glibtop_suid.h>
static const unsigned long _glibtop_sysdeps_swap = static const unsigned long _glibtop_sysdeps_swap =
(1 << GLIBTOP_SWAP_TOTAL) + (1 << GLIBTOP_SWAP_USED) + (1L << GLIBTOP_SWAP_TOTAL) + (1L << GLIBTOP_SWAP_USED) +
(1 << GLIBTOP_SWAP_FREE) + (1 << GLIBTOP_SWAP_PAGEIN) + (1L << GLIBTOP_SWAP_FREE) + (1L << GLIBTOP_SWAP_PAGEIN) +
(1 << GLIBTOP_SWAP_PAGEOUT); (1L << GLIBTOP_SWAP_PAGEOUT);
#ifdef __FreeBSD__ #if defined(__FreeBSD__) || defined(__bsdi__)
#include <sys/conf.h> #include <sys/conf.h>
#ifdef __bsdi__
#include <vm/swap_pager.h>
#else
#include <sys/rlist.h> #include <sys/rlist.h>
#endif
#include <sys/vmmeter.h> #include <sys/vmmeter.h>
#if __FreeBSD__ < 4
/* nlist structure for kernel access */ /* nlist structure for kernel access */
#if defined(__bsdi__)
static struct nlist nlst [] = {
{ "_swapstats" }, /* general swap info */
{ 0 }
};
#elif __FreeBSD__ < 4
static struct nlist nlst [] = { static struct nlist nlst [] = {
#define VM_SWAPLIST 0 #define VM_SWAPLIST 0
{ "_swaplist" },/* list of free swap areas */ { "_swaplist" },/* list of free swap areas */
@@ -56,28 +65,36 @@ static struct nlist nlst [] = {
{ "_dmmax" }, /* maximum size of a swap block */ { "_dmmax" }, /* maximum size of a swap block */
{ 0 } { 0 }
}; };
#endif #endif
#elif (defined __NetBSD__) #elif defined(__NetBSD__)
#if (__NetBSD_Version__ >= 104000000)
#include <uvm/uvm_extern.h>
#include <sys/swap.h>
#else
#include <vm/vm_swap.h> #include <vm/vm_swap.h>
#endif
#endif #endif
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
static int mib_uvmexp [] = { CTL_VM, VM_UVMEXP };
#else
/* nlist structure for kernel access */ /* nlist structure for kernel access */
static struct nlist nlst2 [] = { static struct nlist nlst2 [] = {
{ "_cnt" }, { "_cnt" },
{ 0 } { 0 }
}; };
#endif
/* Init function. */ /* Init function. */
void void
glibtop_init_swap_p (glibtop *server) glibtop_init_swap_p (glibtop *server)
{ {
#ifdef __FreeBSD__ #if defined(__FreeBSD__) || defined(__bsdi__)
#if __FreeBSD__ < 4 #if __FreeBSD__ < 4 || defined(__bsdi__)
if (kvm_nlist (server->machine.kd, nlst) != 0) { if (kvm_nlist (server->machine.kd, nlst) != 0) {
glibtop_warn_io_r (server, "kvm_nlist (swap)"); glibtop_warn_io_r (server, "kvm_nlist (swap)");
return; return;
@@ -86,16 +103,18 @@ glibtop_init_swap_p (glibtop *server)
struct kvm_swap dummy; struct kvm_swap dummy;
if (kvm_getswapinfo (server->machine.kd, &dummy, 1, 0) != 0) { if (kvm_getswapinfo (server->machine.kd, &dummy, 1, 0) != 0) {
glibtop_warn_io_r (server, "kvm_nlist (swap)"); glibtop_warn_io_r (server, "kvm_swap (swap)");
return; return;
} }
#endif #endif
#endif #endif
#if !(defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000))
if (kvm_nlist (server->machine.kd, nlst2) != 0) { if (kvm_nlist (server->machine.kd, nlst2) != 0) {
glibtop_warn_io_r (server, "kvm_nlist (swap)"); glibtop_warn_io_r (server, "kvm_nlist (cnt)");
return; return;
} }
#endif
server->sysdeps.swap = _glibtop_sysdeps_swap; server->sysdeps.swap = _glibtop_sysdeps_swap;
} }
@@ -110,7 +129,8 @@ glibtop_init_swap_p (glibtop *server)
void void
glibtop_get_swap_p (glibtop *server, glibtop_swap *buf) glibtop_get_swap_p (glibtop *server, glibtop_swap *buf)
{ {
#ifdef __FreeBSD__ #if defined(__FreeBSD__)
# if __FreeBSD__ < 4 # if __FreeBSD__ < 4
char *header; char *header;
int hlen, nswdev, dmmax; int hlen, nswdev, dmmax;
@@ -126,25 +146,40 @@ glibtop_get_swap_p (glibtop *server, glibtop_swap *buf)
int nswdev; int nswdev;
struct kvm_swap kvmsw[16]; struct kvm_swap kvmsw[16];
# endif # endif
#elif (defined __NetBSD__)
#elif defined(__bsdi__)
struct swapstats swap;
#elif defined(__NetBSD__)
struct swapent *swaplist; struct swapent *swaplist;
#endif #endif
int nswap, i; int nswap, i;
int avail = 0, inuse = 0; int avail = 0, inuse = 0;
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
struct uvmexp uvmexp;
size_t length_uvmexp;
#else
/* To get `pagein' and `pageout'. */ /* To get `pagein' and `pageout'. */
struct vmmeter vmm; struct vmmeter vmm;
#endif
static int swappgsin = -1; static int swappgsin = -1;
static int swappgsout = -1; static int swappgsout = -1;
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SWAP), 0); glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SWAP), 0);
memset (buf, 0, sizeof (glibtop_swap)); memset (buf, 0, sizeof (glibtop_swap));
if (server->sysdeps.swap == 0) if (server->sysdeps.swap == 0)
return; return;
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
length_uvmexp = sizeof (uvmexp);
if (sysctl (mib_uvmexp, 2, &uvmexp, &length_uvmexp, NULL, 0)) {
glibtop_warn_io_r (server, "sysctl (uvmexp)");
return;
}
#else
/* This is used to get the `pagein' and `pageout' members. */ /* This is used to get the `pagein' and `pageout' members. */
if (kvm_read (server->machine.kd, nlst2[0].n_value, if (kvm_read (server->machine.kd, nlst2[0].n_value,
@@ -152,6 +187,7 @@ glibtop_get_swap_p (glibtop *server, glibtop_swap *buf)
glibtop_warn_io_r (server, "kvm_read (cnt)"); glibtop_warn_io_r (server, "kvm_read (cnt)");
return; return;
} }
#endif
if (swappgsin < 0) { if (swappgsin < 0) {
buf->pagein = 0; buf->pagein = 0;
@@ -160,21 +196,31 @@ glibtop_get_swap_p (glibtop *server, glibtop_swap *buf)
#ifdef __FreeBSD__ #ifdef __FreeBSD__
buf->pagein = vmm.v_swappgsin - swappgsin; buf->pagein = vmm.v_swappgsin - swappgsin;
buf->pageout = vmm.v_swappgsout - swappgsout; buf->pageout = vmm.v_swappgsout - swappgsout;
#else
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
buf->pagein = uvmexp.swapins - swappgsin;
buf->pageout = uvmexp.swapouts - swappgsout;
#else #else
buf->pagein = vmm.v_swpin - swappgsin; buf->pagein = vmm.v_swpin - swappgsin;
buf->pageout = vmm.v_swpout - swappgsout; buf->pageout = vmm.v_swpout - swappgsout;
#endif
#endif #endif
} }
#ifdef __FreeBSD__ #ifdef __FreeBSD__
swappgsin = vmm.v_swappgsin; swappgsin = vmm.v_swappgsin;
swappgsout = vmm.v_swappgsout; swappgsout = vmm.v_swappgsout;
#else
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
swappgsin = uvmexp.swapins;
swappgsout = uvmexp.swapouts;
#else #else
swappgsin = vmm.v_swpin; swappgsin = vmm.v_swpin;
swappgsout = vmm.v_swpout; swappgsout = vmm.v_swpout;
#endif #endif
#endif
#ifdef __FreeBSD__ #if defined(__FreeBSD__)
#if __FreeBSD__ < 4 #if __FreeBSD__ < 4
@@ -214,7 +260,7 @@ glibtop_get_swap_p (glibtop *server, glibtop_swap *buf)
if (kvm_read (server->machine.kd, nlst[VM_SWDEVT].n_value, if (kvm_read (server->machine.kd, nlst[VM_SWDEVT].n_value,
&ptr, sizeof (ptr)) != sizeof (ptr)) { &ptr, sizeof (ptr)) != sizeof (ptr)) {
glibtop_warn_io_r (server, "kvm_read (swaplist)"); glibtop_warn_io_r (server, "kvm_read (swdevt)");
return; return;
} }
@@ -328,7 +374,24 @@ glibtop_get_swap_p (glibtop *server, glibtop_swap *buf)
#endif #endif
#elif (defined __NetBSD__) #elif defined(__bsdi__)
/* General info about swap devices. */
if (kvm_read (server->machine.kd, nlst[0].n_value,
&swap, sizeof (swap)) != sizeof (swap)) {
glibtop_warn_io_r (server, "kvm_read (swap)");
return;
}
buf->flags = _glibtop_sysdeps_swap;
buf->used = swap.swap_total - swap.swap_free;
buf->free = swap.swap_free;
buf->total = swap.swap_total;
#elif defined(__NetBSD__)
nswap = swapctl (SWAP_NSWAP, NULL, 0); nswap = swapctl (SWAP_NSWAP, NULL, 0);
if (nswap < 0) { if (nswap < 0) {

View File

@@ -30,11 +30,11 @@
#include <glibtop_suid.h> #include <glibtop_suid.h>
static const unsigned long _glibtop_sysdeps_uptime = static const unsigned long _glibtop_sysdeps_uptime =
(1 << GLIBTOP_UPTIME_UPTIME) + (1 << GLIBTOP_UPTIME_IDLETIME); (1L << GLIBTOP_UPTIME_UPTIME) + (1L << GLIBTOP_UPTIME_IDLETIME);
static const unsigned long _required_cpu_flags = static const unsigned long _required_cpu_flags =
(1 << GLIBTOP_CPU_TOTAL) + (1 << GLIBTOP_CPU_IDLE) + (1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_IDLE) +
(1 << GLIBTOP_CPU_FREQUENCY); (1L << GLIBTOP_CPU_FREQUENCY);
/* Init function. */ /* Init function. */
@@ -51,7 +51,7 @@ glibtop_get_uptime_p (glibtop *server, glibtop_uptime *buf)
{ {
glibtop_cpu cpu; glibtop_cpu cpu;
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_UPTIME), 0); glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_UPTIME), 0);
memset (buf, 0, sizeof (glibtop_uptime)); memset (buf, 0, sizeof (glibtop_uptime));

View File

@@ -113,7 +113,6 @@ sub output {
print 'static SCM'; print 'static SCM';
print 'glibtop_guile_types_' . $feature . ' (void)'; print 'glibtop_guile_types_' . $feature . ' (void)';
print '{'; print '{';
print "\tint i;";
print "\tSCM list;"; print "\tSCM list;";
print ''; print '';

View File

@@ -0,0 +1,89 @@
/* $Id$ */
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, March 1999.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_PRIVATE_H__
#define __GLIBTOP_PRIVATE_H__
#include <glibtop.h>
#include <glibtop/error.h>
#include <sys/param.h>
#include <sys/sysctl.h>
#include <sys/user.h>
#undef LIBGTOP_VERSION
#include <linux/libgtop.h>
BEGIN_LIBGTOP_DECLS
int
glibtop_get_proc_data_stat_s (glibtop *server, libgtop_stat_t *stat);
int
glibtop_get_proc_data_mem_s (glibtop *server, libgtop_mem_t *mem);
int
glibtop_get_proc_data_swap_s (glibtop *server, libgtop_swap_t *swap);
int
glibtop_get_proc_data_proclist_s (glibtop *server,
libgtop_proclist_t *proclist,
u_int64_t which, u_int64_t arg);
int
glibtop_get_proc_data_proc_state_s (glibtop *server,
libgtop_proc_state_t *proc_state,
pid_t pid);
int
glibtop_get_proc_data_proc_mem_s (glibtop *server,
libgtop_proc_mem_t *proc_mem,
pid_t pid);
int
glibtop_get_proc_data_proc_signal_s (glibtop *server,
libgtop_proc_signal_t *proc_signal,
pid_t pid);
int
glibtop_get_proc_data_proc_kernel_s (glibtop *server,
libgtop_proc_kernel_t *proc_kernel,
pid_t pid);
int
glibtop_get_proc_data_proc_args_s (glibtop *server, pid_t pid,
char *result, size_t max_len);
int
glibtop_get_proc_data_proc_maps_s (glibtop *server, pid_t pid,
libgtop_proc_maps_t *result,
size_t max_len);
int
glibtop_get_proc_data_netload_s (glibtop *server,
libgtop_netload_t *netload,
const char *device);
END_LIBGTOP_DECLS
#endif __GLIBTOP_PRIVATE_H__

94
sysdeps/kernel/sysinfo.c Normal file
View File

@@ -0,0 +1,94 @@
/* $Id$ */
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <config.h>
#include <glibtop/cpu.h>
#include <glibtop/sysinfo.h>
static const unsigned long _glibtop_sysdeps_sysinfo =
(1 << GLIBTOP_SYSINFO_CPUINFO);
static glibtop_sysinfo sysinfo;
static void
init_sysinfo (glibtop *server)
{
char buffer [BUFSIZ];
static int init = 0;
glibtop_entry *cpuinfo = NULL;
FILE *f;
if (init) return;
init = TRUE;
glibtop_init_s (&server, GLIBTOP_SYSDEPS_CPU, 0);
memset (&sysinfo, 0, sizeof (glibtop_sysinfo));
g_return_if_fail (f = fopen ("/proc/cpuinfo", "r"));
while (fgets (buffer, BUFSIZ, f)) {
char *p, *start, *key, *value;
if (cpuinfo == NULL) {
cpuinfo = &sysinfo.cpuinfo [sysinfo.ncpu++];
cpuinfo->labels = g_ptr_array_new ();
cpuinfo->values = g_hash_table_new (NULL, NULL);
if (sysinfo.ncpu > GLIBTOP_NCPU)
sysinfo.ncpu = GLIBTOP_NCPU;
}
p = strchr (buffer, ':');
if (!p) continue;
/* Remove leading spaces from `p'. */
*p = '\0'; start = p; p++;
while (isspace (*p)) p++;
/* Remove trailing spaces from `buffer'. */
while ((start > buffer) && (*start) && isspace (*start))
*start-- = '\0';
key = g_strdup (buffer);
value = g_strdup (p);
g_ptr_array_add (cpuinfo->labels, key);
g_hash_table_insert (cpuinfo->values, key, value);
}
fclose (f);
sysinfo.flags = _glibtop_sysdeps_sysinfo;
}
glibtop_sysinfo *
glibtop_get_sysinfo_s (glibtop *server)
{
init_sysinfo (server);
return &sysinfo;
}

View File

@@ -1,3 +1,8 @@
1999-07-29 Martin Baulig <martin@home-of-linux.org>
* proctime.c (glibtop_get_proctime_s): Don't provide `rtime'
any longer since we must not use `rtime = utime + stime'.
1999-02-20 Martin Baulig <martin@home-of-linux.org> 1999-02-20 Martin Baulig <martin@home-of-linux.org>
* netload.c: Don't include <linux/ip_fw.h> for libc5 systems * netload.c: Don't include <linux/ip_fw.h> for libc5 systems

View File

@@ -26,14 +26,14 @@
#include <glibtop/cpu.h> #include <glibtop/cpu.h>
static const unsigned long _glibtop_sysdeps_cpu = static const unsigned long _glibtop_sysdeps_cpu =
(1 << GLIBTOP_CPU_TOTAL) + (1 << GLIBTOP_CPU_USER) + (1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_USER) +
(1 << GLIBTOP_CPU_NICE) + (1 << GLIBTOP_CPU_SYS) + (1L << GLIBTOP_CPU_NICE) + (1L << GLIBTOP_CPU_SYS) +
(1 << GLIBTOP_CPU_IDLE) + (1 << GLIBTOP_CPU_FREQUENCY); (1L << GLIBTOP_CPU_IDLE) + (1L << GLIBTOP_CPU_FREQUENCY);
static const unsigned long _glibtop_sysdeps_cpu_smp = static const unsigned long _glibtop_sysdeps_cpu_smp =
(1 << GLIBTOP_XCPU_TOTAL) + (1 << GLIBTOP_XCPU_USER) + (1L << GLIBTOP_XCPU_TOTAL) + (1L << GLIBTOP_XCPU_USER) +
(1 << GLIBTOP_XCPU_NICE) + (1 << GLIBTOP_XCPU_SYS) + (1L << GLIBTOP_XCPU_NICE) + (1L << GLIBTOP_XCPU_SYS) +
(1 << GLIBTOP_XCPU_IDLE); (1L << GLIBTOP_XCPU_IDLE);
/* Init function. */ /* Init function. */
@@ -55,6 +55,7 @@ glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf)
{ {
char buffer [BUFSIZ], *p; char buffer [BUFSIZ], *p;
int fd, len, i; int fd, len, i;
u_int64_t total;
glibtop_init_s (&server, GLIBTOP_SYSDEPS_CPU, 0); glibtop_init_s (&server, GLIBTOP_SYSDEPS_CPU, 0);
@@ -79,7 +80,11 @@ glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf)
buf->sys = strtoul (p, &p, 0); buf->sys = strtoul (p, &p, 0);
buf->idle = strtoul (p, &p, 0); buf->idle = strtoul (p, &p, 0);
buf->total = buf->user + buf->nice + buf->sys + buf->idle; total = buf->user;
total += buf->nice;
total += buf->sys;
total += buf->idle;
buf->total = total;
buf->frequency = 100; buf->frequency = 100;
buf->flags = _glibtop_sysdeps_cpu; buf->flags = _glibtop_sysdeps_cpu;
@@ -94,8 +99,12 @@ glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf)
buf->xcpu_sys [i] = strtoul (p, &p, 0); buf->xcpu_sys [i] = strtoul (p, &p, 0);
buf->xcpu_idle [i] = strtoul (p, &p, 0); buf->xcpu_idle [i] = strtoul (p, &p, 0);
buf->xcpu_total [i] = buf->xcpu_user [i] + buf->xcpu_nice [i] + total = buf->xcpu_user [i];
buf->xcpu_sys [i] + buf->xcpu_idle [i]; total += buf->xcpu_nice [i];
total += buf->xcpu_sys [i];
total += buf->xcpu_idle [i];
buf->xcpu_total [i] = total;
} }
buf->flags |= _glibtop_sysdeps_cpu_smp; buf->flags |= _glibtop_sysdeps_cpu_smp;

View File

@@ -26,12 +26,12 @@
#include <glibtop/loadavg.h> #include <glibtop/loadavg.h>
static const unsigned long _glibtop_sysdeps_loadavg = static const unsigned long _glibtop_sysdeps_loadavg =
(1 << GLIBTOP_LOADAVG_LOADAVG); (1L << GLIBTOP_LOADAVG_LOADAVG);
static const unsigned long _glibtop_sysdeps_loadavg_tasks = static const unsigned long _glibtop_sysdeps_loadavg_tasks =
(1 << GLIBTOP_LOADAVG_NR_RUNNING) + (1L << GLIBTOP_LOADAVG_NR_RUNNING) +
(1 << GLIBTOP_LOADAVG_NR_TASKS) + (1L << GLIBTOP_LOADAVG_NR_TASKS) +
(1 << GLIBTOP_LOADAVG_LAST_PID); (1L << GLIBTOP_LOADAVG_LAST_PID);
/* Init function. */ /* Init function. */

View File

@@ -26,10 +26,10 @@
#include <glibtop/mem.h> #include <glibtop/mem.h>
static const unsigned long _glibtop_sysdeps_mem = static const unsigned long _glibtop_sysdeps_mem =
(1 << GLIBTOP_MEM_TOTAL) + (1 << GLIBTOP_MEM_USED) + (1L << GLIBTOP_MEM_TOTAL) + (1L << GLIBTOP_MEM_USED) +
(1 << GLIBTOP_MEM_FREE) + (1 << GLIBTOP_MEM_SHARED) + (1L << GLIBTOP_MEM_FREE) + (1L << GLIBTOP_MEM_SHARED) +
(1 << GLIBTOP_MEM_BUFFER) + (1 << GLIBTOP_MEM_CACHED) + (1L << GLIBTOP_MEM_BUFFER) + (1L << GLIBTOP_MEM_CACHED) +
(1 << GLIBTOP_MEM_USER); (1L << GLIBTOP_MEM_USER);
/* Init function. */ /* Init function. */

View File

@@ -27,10 +27,10 @@
#include <sys/msg.h> #include <sys/msg.h>
static const unsigned long _glibtop_sysdeps_msg_limits = static const unsigned long _glibtop_sysdeps_msg_limits =
(1 << GLIBTOP_IPC_MSGPOOL) + (1 << GLIBTOP_IPC_MSGMAP) + (1L << GLIBTOP_IPC_MSGPOOL) + (1L << GLIBTOP_IPC_MSGMAP) +
(1 << GLIBTOP_IPC_MSGMAX) + (1 << GLIBTOP_IPC_MSGMNB) + (1L << GLIBTOP_IPC_MSGMAX) + (1L << GLIBTOP_IPC_MSGMNB) +
(1 << GLIBTOP_IPC_MSGMNI) + (1 << GLIBTOP_IPC_MSGSSZ) + (1L << GLIBTOP_IPC_MSGMNI) + (1L << GLIBTOP_IPC_MSGSSZ) +
(1 << GLIBTOP_IPC_MSGTQL); (1L << GLIBTOP_IPC_MSGTQL);
/* Init function. */ /* Init function. */

View File

@@ -51,40 +51,40 @@
#define _GLIBTOP_IP_FW_ACCTOUT 0x2000 /* Account outgoing packets only. */ #define _GLIBTOP_IP_FW_ACCTOUT 0x2000 /* Account outgoing packets only. */
static const unsigned long _glibtop_sysdeps_netload = static const unsigned long _glibtop_sysdeps_netload =
(1 << GLIBTOP_NETLOAD_ERRORS_IN) + (1L << GLIBTOP_NETLOAD_ERRORS_IN) +
(1 << GLIBTOP_NETLOAD_ERRORS_OUT) + (1L << GLIBTOP_NETLOAD_ERRORS_OUT) +
(1 << GLIBTOP_NETLOAD_COLLISIONS); (1L << GLIBTOP_NETLOAD_COLLISIONS);
static const unsigned long _glibtop_sysdeps_netload_data = static const unsigned long _glibtop_sysdeps_netload_data =
(1 << GLIBTOP_NETLOAD_ADDRESS) + (1L << GLIBTOP_NETLOAD_ADDRESS) +
(1 << GLIBTOP_NETLOAD_SUBNET) + (1L << GLIBTOP_NETLOAD_SUBNET) +
(1 << GLIBTOP_NETLOAD_MTU); (1L << GLIBTOP_NETLOAD_MTU);
static const unsigned long _glibtop_sysdeps_netload_bytes = static const unsigned long _glibtop_sysdeps_netload_bytes =
(1 << GLIBTOP_NETLOAD_BYTES_IN) + (1L << GLIBTOP_NETLOAD_BYTES_IN) +
(1 << GLIBTOP_NETLOAD_BYTES_OUT) + (1L << GLIBTOP_NETLOAD_BYTES_OUT) +
(1 << GLIBTOP_NETLOAD_BYTES_TOTAL); (1L << GLIBTOP_NETLOAD_BYTES_TOTAL);
static const unsigned long _glibtop_sysdeps_netload_packets = static const unsigned long _glibtop_sysdeps_netload_packets =
(1 << GLIBTOP_NETLOAD_PACKETS_IN) + (1L << GLIBTOP_NETLOAD_PACKETS_IN) +
(1 << GLIBTOP_NETLOAD_PACKETS_OUT) + (1L << GLIBTOP_NETLOAD_PACKETS_OUT) +
(1 << GLIBTOP_NETLOAD_PACKETS_TOTAL); (1L << GLIBTOP_NETLOAD_PACKETS_TOTAL);
static const unsigned long _glibtop_sysdeps_netload_total = static const unsigned long _glibtop_sysdeps_netload_total =
(1 << GLIBTOP_NETLOAD_PACKETS_TOTAL) + (1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) +
(1 << GLIBTOP_NETLOAD_BYTES_TOTAL); (1L << GLIBTOP_NETLOAD_BYTES_TOTAL);
static const unsigned long _glibtop_sysdeps_netload_in = static const unsigned long _glibtop_sysdeps_netload_in =
(1 << GLIBTOP_NETLOAD_PACKETS_TOTAL) + (1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) +
(1 << GLIBTOP_NETLOAD_BYTES_TOTAL) + (1L << GLIBTOP_NETLOAD_BYTES_TOTAL) +
(1 << GLIBTOP_NETLOAD_PACKETS_IN) + (1L << GLIBTOP_NETLOAD_PACKETS_IN) +
(1 << GLIBTOP_NETLOAD_BYTES_IN); (1L << GLIBTOP_NETLOAD_BYTES_IN);
static const unsigned long _glibtop_sysdeps_netload_out = static const unsigned long _glibtop_sysdeps_netload_out =
(1 << GLIBTOP_NETLOAD_PACKETS_TOTAL) + (1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) +
(1 << GLIBTOP_NETLOAD_BYTES_TOTAL) + (1L << GLIBTOP_NETLOAD_BYTES_TOTAL) +
(1 << GLIBTOP_NETLOAD_PACKETS_OUT) + (1L << GLIBTOP_NETLOAD_PACKETS_OUT) +
(1 << GLIBTOP_NETLOAD_BYTES_OUT); (1L << GLIBTOP_NETLOAD_BYTES_OUT);
/* Init function. */ /* Init function. */
@@ -112,53 +112,51 @@ glibtop_get_netload_s (glibtop *server, glibtop_netload *buf,
skfd = socket (AF_INET, SOCK_DGRAM, 0); skfd = socket (AF_INET, SOCK_DGRAM, 0);
if (skfd) { if (skfd) {
struct ifreq ifr; struct ifreq ifr;
struct sockaddr_in addr;
char *address;
unsigned flags; unsigned flags;
strcpy (ifr.ifr_name, interface); strcpy (ifr.ifr_name, interface);
if (!ioctl (skfd, SIOCGIFFLAGS, &ifr)) { if (!ioctl (skfd, SIOCGIFFLAGS, &ifr)) {
buf->flags |= (1 << GLIBTOP_NETLOAD_IF_FLAGS); buf->flags |= (1L << GLIBTOP_NETLOAD_IF_FLAGS);
flags = ifr.ifr_flags; flags = ifr.ifr_flags;
} else } else
flags = 0; flags = 0;
if (flags & IFF_UP) if (flags & IFF_UP)
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_UP); buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_UP);
if (flags & IFF_BROADCAST) if (flags & IFF_BROADCAST)
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_BROADCAST); buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_BROADCAST);
if (flags & IFF_DEBUG) if (flags & IFF_DEBUG)
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_DEBUG); buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_DEBUG);
if (flags & IFF_LOOPBACK) if (flags & IFF_LOOPBACK)
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_LOOPBACK); buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LOOPBACK);
if (flags & IFF_POINTOPOINT) if (flags & IFF_POINTOPOINT)
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_POINTOPOINT); buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_POINTOPOINT);
if (flags & IFF_RUNNING) if (flags & IFF_RUNNING)
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_RUNNING); buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_RUNNING);
if (flags & IFF_NOARP) if (flags & IFF_NOARP)
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_NOARP); buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_NOARP);
if (flags & IFF_PROMISC) if (flags & IFF_PROMISC)
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_PROMISC); buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_PROMISC);
if (flags & IFF_ALLMULTI) if (flags & IFF_ALLMULTI)
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_ALLMULTI); buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_ALLMULTI);
if (flags & IFF_MULTICAST) if (flags & IFF_MULTICAST)
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_MULTICAST); buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_MULTICAST);
strcpy (ifr.ifr_name, interface); strcpy (ifr.ifr_name, interface);
if (!ioctl (skfd, SIOCGIFADDR, &ifr)) { if (!ioctl (skfd, SIOCGIFADDR, &ifr)) {
struct sockaddr_in addr = struct sockaddr_in addr =
*(struct sockaddr_in *) &ifr.ifr_addr; *(struct sockaddr_in *) &ifr.ifr_addr;
buf->address = addr.sin_addr.s_addr; buf->address = addr.sin_addr.s_addr;
buf->flags |= (1 << GLIBTOP_NETLOAD_ADDRESS); buf->flags |= (1L << GLIBTOP_NETLOAD_ADDRESS);
} }
strcpy (ifr.ifr_name, interface); strcpy (ifr.ifr_name, interface);
@@ -166,13 +164,13 @@ glibtop_get_netload_s (glibtop *server, glibtop_netload *buf,
struct sockaddr_in addr = struct sockaddr_in addr =
*(struct sockaddr_in *) &ifr.ifr_addr; *(struct sockaddr_in *) &ifr.ifr_addr;
buf->subnet = addr.sin_addr.s_addr; buf->subnet = addr.sin_addr.s_addr;
buf->flags |= (1 << GLIBTOP_NETLOAD_SUBNET); buf->flags |= (1L << GLIBTOP_NETLOAD_SUBNET);
} }
strcpy (ifr.ifr_name, interface); strcpy (ifr.ifr_name, interface);
if (!ioctl (skfd, SIOCGIFMTU, &ifr)) { if (!ioctl (skfd, SIOCGIFMTU, &ifr)) {
buf->mtu = ifr.ifr_mtu; buf->mtu = ifr.ifr_mtu;
buf->flags |= (1 << GLIBTOP_NETLOAD_MTU); buf->flags |= (1L << GLIBTOP_NETLOAD_MTU);
} }
close (skfd); close (skfd);

View File

@@ -31,11 +31,13 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#include <ctype.h>
#include <glib.h> #include <glib.h>
static const unsigned long _glibtop_sysdeps_ppp = static const unsigned long _glibtop_sysdeps_ppp =
(1 << GLIBTOP_PPP_STATE) + (1 << GLIBTOP_PPP_BYTES_IN) + (1L << GLIBTOP_PPP_STATE) + (1L << GLIBTOP_PPP_BYTES_IN) +
(1 << GLIBTOP_PPP_BYTES_OUT); (1L << GLIBTOP_PPP_BYTES_OUT);
/* Init function. */ /* Init function. */
@@ -187,13 +189,13 @@ glibtop_get_ppp_s (glibtop *server, glibtop_ppp *buf, unsigned short device)
if (is_ISDN_on (server, &online)) { if (is_ISDN_on (server, &online)) {
buf->state = online ? GLIBTOP_PPP_STATE_ONLINE : buf->state = online ? GLIBTOP_PPP_STATE_ONLINE :
GLIBTOP_PPP_STATE_HANGUP; GLIBTOP_PPP_STATE_HANGUP;
buf->flags |= (1 << GLIBTOP_PPP_STATE); buf->flags |= (1L << GLIBTOP_PPP_STATE);
} }
if (get_ISDN_stats (server, &in, &out)) { if (get_ISDN_stats (server, &in, &out)) {
buf->bytes_in = in; buf->bytes_in = in;
buf->bytes_out = out; buf->bytes_out = out;
buf->flags |= (1 << GLIBTOP_PPP_BYTES_IN) | buf->flags |= (1L << GLIBTOP_PPP_BYTES_IN) |
(1 << GLIBTOP_PPP_BYTES_OUT); (1L << GLIBTOP_PPP_BYTES_OUT);
} }
} }

View File

@@ -27,7 +27,7 @@
#include <glibtop/procargs.h> #include <glibtop/procargs.h>
static const unsigned long _glibtop_sysdeps_proc_args = static const unsigned long _glibtop_sysdeps_proc_args =
(1 << GLIBTOP_PROC_ARGS_SIZE); (1L << GLIBTOP_PROC_ARGS_SIZE);
/* Init function. */ /* Init function. */

View File

@@ -26,10 +26,10 @@
#include <glibtop/prockernel.h> #include <glibtop/prockernel.h>
static const unsigned long _glibtop_sysdeps_proc_kernel = static const unsigned long _glibtop_sysdeps_proc_kernel =
(1 << GLIBTOP_PROC_KERNEL_K_FLAGS) + (1 << GLIBTOP_PROC_KERNEL_MIN_FLT) + (1L << GLIBTOP_PROC_KERNEL_K_FLAGS) + (1L << GLIBTOP_PROC_KERNEL_MIN_FLT) +
(1 << GLIBTOP_PROC_KERNEL_MAJ_FLT) + (1 << GLIBTOP_PROC_KERNEL_CMIN_FLT) + (1L << GLIBTOP_PROC_KERNEL_MAJ_FLT) + (1L << GLIBTOP_PROC_KERNEL_CMIN_FLT) +
(1 << GLIBTOP_PROC_KERNEL_CMAJ_FLT) + (1 << GLIBTOP_PROC_KERNEL_KSTK_ESP) + (1L << GLIBTOP_PROC_KERNEL_CMAJ_FLT) + (1L << GLIBTOP_PROC_KERNEL_KSTK_ESP) +
(1 << GLIBTOP_PROC_KERNEL_KSTK_EIP) + (1 << GLIBTOP_PROC_KERNEL_WCHAN); (1L << GLIBTOP_PROC_KERNEL_KSTK_EIP) + (1L << GLIBTOP_PROC_KERNEL_WCHAN);
/* Init function. */ /* Init function. */

View File

@@ -34,8 +34,8 @@
#include <ctype.h> #include <ctype.h>
static const unsigned long _glibtop_sysdeps_proclist = static const unsigned long _glibtop_sysdeps_proclist =
(1 << GLIBTOP_PROCLIST_TOTAL) + (1 << GLIBTOP_PROCLIST_NUMBER) + (1L << GLIBTOP_PROCLIST_TOTAL) + (1L << GLIBTOP_PROCLIST_NUMBER) +
(1 << GLIBTOP_PROCLIST_SIZE); (1L << GLIBTOP_PROCLIST_SIZE);
/* Init function. */ /* Init function. */
@@ -122,28 +122,28 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
case GLIBTOP_KERN_PROC_PGRP: case GLIBTOP_KERN_PROC_PGRP:
/* Do you really, really need this ? */ /* Do you really, really need this ? */
glibtop_get_proc_uid_s (server, &procuid, pid); glibtop_get_proc_uid_s (server, &procuid, pid);
if (procuid.flags & (1 << GLIBTOP_PROC_UID_PGRP)) if (procuid.flags & (1L << GLIBTOP_PROC_UID_PGRP))
if ((int) arg != procuid.pgrp) if ((int) arg != procuid.pgrp)
continue; continue;
break; break;
case GLIBTOP_KERN_PROC_SESSION: case GLIBTOP_KERN_PROC_SESSION:
/* Do you really, really need this ? */ /* Do you really, really need this ? */
glibtop_get_proc_uid_s (server, &procuid, pid); glibtop_get_proc_uid_s (server, &procuid, pid);
if (procuid.flags & (1 << GLIBTOP_PROC_UID_SESSION)) if (procuid.flags & (1L << GLIBTOP_PROC_UID_SESSION))
if ((int) arg != procuid.session) if ((int) arg != procuid.session)
continue; continue;
break; break;
case GLIBTOP_KERN_PROC_TTY: case GLIBTOP_KERN_PROC_TTY:
/* Do you really, really need this ? */ /* Do you really, really need this ? */
glibtop_get_proc_uid_s (server, &procuid, pid); glibtop_get_proc_uid_s (server, &procuid, pid);
if (procuid.flags & (1 << GLIBTOP_PROC_UID_TTY)) if (procuid.flags & (1L << GLIBTOP_PROC_UID_TTY))
if ((int) arg != procuid.tty) if ((int) arg != procuid.tty)
continue; continue;
break; break;
case GLIBTOP_KERN_PROC_RUID: case GLIBTOP_KERN_PROC_RUID:
/* Do you really, really need this ? */ /* Do you really, really need this ? */
glibtop_get_proc_uid_s (server, &procuid, pid); glibtop_get_proc_uid_s (server, &procuid, pid);
if (procuid.flags & (1 << GLIBTOP_PROC_UID_EUID)) if (procuid.flags & (1L << GLIBTOP_PROC_UID_EUID))
if ((int) arg != procuid.euid) if ((int) arg != procuid.euid)
continue; continue;
break; break;
@@ -151,19 +151,19 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
if (which & GLIBTOP_EXCLUDE_NOTTY) { if (which & GLIBTOP_EXCLUDE_NOTTY) {
glibtop_get_proc_uid_s (server, &procuid, pid); glibtop_get_proc_uid_s (server, &procuid, pid);
if (procuid.flags & (1 << GLIBTOP_PROC_UID_TTY)) if (procuid.flags & (1L << GLIBTOP_PROC_UID_TTY))
if (procuid.tty == -1) continue; if (procuid.tty == -1) continue;
} }
if (which & GLIBTOP_EXCLUDE_IDLE) { if (which & GLIBTOP_EXCLUDE_IDLE) {
glibtop_get_proc_state_s (server, &procstate, pid); glibtop_get_proc_state_s (server, &procstate, pid);
if (procstate.flags & (1 << GLIBTOP_PROC_STATE_STATE)) if (procstate.flags & (1L << GLIBTOP_PROC_STATE_STATE))
if (procstate.state != 'R') continue; if (procstate.state != 'R') continue;
} }
if (which & GLIBTOP_EXCLUDE_SYSTEM) { if (which & GLIBTOP_EXCLUDE_SYSTEM) {
glibtop_get_proc_uid_s (server, &procuid, pid); glibtop_get_proc_uid_s (server, &procuid, pid);
if (procuid.flags & (1 << GLIBTOP_PROC_UID_UID)) if (procuid.flags & (1L << GLIBTOP_PROC_UID_UID))
if (procuid.uid == 0) continue; if (procuid.uid == 0) continue;
} }

View File

@@ -27,14 +27,14 @@
#include <glibtop/procmap.h> #include <glibtop/procmap.h>
static const unsigned long _glibtop_sysdeps_proc_map = static const unsigned long _glibtop_sysdeps_proc_map =
(1 << GLIBTOP_PROC_MAP_NUMBER) + (1 << GLIBTOP_PROC_MAP_TOTAL) + (1L << GLIBTOP_PROC_MAP_NUMBER) + (1L << GLIBTOP_PROC_MAP_TOTAL) +
(1 << GLIBTOP_PROC_MAP_SIZE); (1L << GLIBTOP_PROC_MAP_SIZE);
static const unsigned long _glibtop_sysdeps_map_entry = static const unsigned long _glibtop_sysdeps_map_entry =
(1 << GLIBTOP_MAP_ENTRY_START) + (1 << GLIBTOP_MAP_ENTRY_END) + (1L << GLIBTOP_MAP_ENTRY_START) + (1L << GLIBTOP_MAP_ENTRY_END) +
(1 << GLIBTOP_MAP_ENTRY_OFFSET) + (1 << GLIBTOP_MAP_ENTRY_PERM) + (1L << GLIBTOP_MAP_ENTRY_OFFSET) + (1L << GLIBTOP_MAP_ENTRY_PERM) +
(1 << GLIBTOP_MAP_ENTRY_INODE) + (1 << GLIBTOP_MAP_ENTRY_DEVICE) + (1L << GLIBTOP_MAP_ENTRY_INODE) + (1L << GLIBTOP_MAP_ENTRY_DEVICE) +
(1 << GLIBTOP_MAP_ENTRY_FILENAME); (1L << GLIBTOP_MAP_ENTRY_FILENAME);
/* Init function. */ /* Init function. */
@@ -66,11 +66,15 @@ glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid)
do { do {
short dev_major, dev_minor; short dev_major, dev_minor;
unsigned long start, end, offset, inode, perm; unsigned long start, end, offset, inode, perm;
char flags [5]; char flags [5], *format;
size_t size; size_t size;
rv = fscanf (maps, if (sizeof (void*) == 8)
"%08lx-%08lx %4c\n %08lx %02hx:%02hx %ld", format = "%16lx-%16lx %4c\n %16lx %02hx:%02hx %ld";
else
format = "%08lx-%08lx %4c\n %08lx %02hx:%02hx %ld";
rv = fscanf (maps, format,
&start, &end, flags, &offset, &start, &end, flags, &offset,
&dev_major, &dev_minor, &inode); &dev_major, &dev_minor, &inode);

View File

@@ -26,12 +26,12 @@
#include <glibtop/procmem.h> #include <glibtop/procmem.h>
static const unsigned long _glibtop_sysdeps_proc_mem = static const unsigned long _glibtop_sysdeps_proc_mem =
(1 << GLIBTOP_PROC_MEM_VSIZE) + (1 << GLIBTOP_PROC_MEM_RSS) + (1L << GLIBTOP_PROC_MEM_VSIZE) + (1L << GLIBTOP_PROC_MEM_RSS) +
(1 << GLIBTOP_PROC_MEM_RSS_RLIM); (1L << GLIBTOP_PROC_MEM_RSS_RLIM);
static const unsigned long _glibtop_sysdeps_proc_mem_statm = static const unsigned long _glibtop_sysdeps_proc_mem_statm =
(1 << GLIBTOP_PROC_MEM_SIZE) + (1 << GLIBTOP_PROC_MEM_RESIDENT) + (1L << GLIBTOP_PROC_MEM_SIZE) + (1L << GLIBTOP_PROC_MEM_RESIDENT) +
(1 << GLIBTOP_PROC_MEM_SHARE); (1L << GLIBTOP_PROC_MEM_SHARE);
#ifndef LOG1024 #ifndef LOG1024
#define LOG1024 10 #define LOG1024 10

View File

@@ -26,16 +26,16 @@
#include <glibtop/procsegment.h> #include <glibtop/procsegment.h>
static const unsigned long _glibtop_sysdeps_proc_segment = static const unsigned long _glibtop_sysdeps_proc_segment =
(1 << GLIBTOP_PROC_SEGMENT_START_CODE) + (1L << GLIBTOP_PROC_SEGMENT_START_CODE) +
(1 << GLIBTOP_PROC_SEGMENT_END_CODE) + (1L << GLIBTOP_PROC_SEGMENT_END_CODE) +
(1 << GLIBTOP_PROC_SEGMENT_START_STACK); (1L << GLIBTOP_PROC_SEGMENT_START_STACK);
static const unsigned long _glibtop_sysdeps_proc_segment_statm = static const unsigned long _glibtop_sysdeps_proc_segment_statm =
(1 << GLIBTOP_PROC_SEGMENT_TEXT_RSS) + (1L << GLIBTOP_PROC_SEGMENT_TEXT_RSS) +
/* Disabled due to bug in the Linux Kernel. */ /* Disabled due to bug in the Linux Kernel. */
/* (1 << GLIBTOP_PROC_SEGMENT_SHLIB_RSS) + */ /* (1L << GLIBTOP_PROC_SEGMENT_SHLIB_RSS) + */
(1 << GLIBTOP_PROC_SEGMENT_DATA_RSS) + (1L << GLIBTOP_PROC_SEGMENT_DATA_RSS) +
(1 << GLIBTOP_PROC_SEGMENT_DIRTY_SIZE); (1L << GLIBTOP_PROC_SEGMENT_DIRTY_SIZE);
#ifndef LOG1024 #ifndef LOG1024
#define LOG1024 10 #define LOG1024 10

View File

@@ -26,8 +26,8 @@
#include <glibtop/procsignal.h> #include <glibtop/procsignal.h>
static const unsigned long _glibtop_sysdeps_proc_signal = static const unsigned long _glibtop_sysdeps_proc_signal =
(1 << GLIBTOP_PROC_SIGNAL_SIGNAL) + (1 << GLIBTOP_PROC_SIGNAL_BLOCKED) + (1L << GLIBTOP_PROC_SIGNAL_SIGNAL) + (1L << GLIBTOP_PROC_SIGNAL_BLOCKED) +
(1 << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + (1 << GLIBTOP_PROC_SIGNAL_SIGCATCH); (1L << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + (1L << GLIBTOP_PROC_SIGNAL_SIGCATCH);
/* Init function. */ /* Init function. */

View File

@@ -28,10 +28,10 @@
#include <sys/stat.h> #include <sys/stat.h>
static const unsigned long _glibtop_sysdeps_proc_state = static const unsigned long _glibtop_sysdeps_proc_state =
(1 << GLIBTOP_PROC_STATE_CMD) + (1 << GLIBTOP_PROC_STATE_STATE); (1L << GLIBTOP_PROC_STATE_CMD) + (1L << GLIBTOP_PROC_STATE_STATE);
static const unsigned long _glibtop_sysdeps_proc_state_uid = static const unsigned long _glibtop_sysdeps_proc_state_uid =
(1 << GLIBTOP_PROC_STATE_UID) + (1 << GLIBTOP_PROC_STATE_GID); (1L << GLIBTOP_PROC_STATE_UID) + (1L << GLIBTOP_PROC_STATE_GID);
/* Init function. */ /* Init function. */

View File

@@ -26,14 +26,13 @@
#include <glibtop/proctime.h> #include <glibtop/proctime.h>
static const unsigned long _glibtop_sysdeps_proc_time = static const unsigned long _glibtop_sysdeps_proc_time =
(1 << GLIBTOP_PROC_TIME_UTIME) + (1 << GLIBTOP_PROC_TIME_CUTIME) + (1L << GLIBTOP_PROC_TIME_UTIME) + (1L << GLIBTOP_PROC_TIME_CUTIME) +
(1 << GLIBTOP_PROC_TIME_STIME) + (1 << GLIBTOP_PROC_TIME_CSTIME) + (1L << GLIBTOP_PROC_TIME_STIME) + (1L << GLIBTOP_PROC_TIME_CSTIME) +
(1 << GLIBTOP_PROC_TIME_RTIME) + (1 << GLIBTOP_PROC_TIME_FREQUENCY) + (1L << GLIBTOP_PROC_TIME_FREQUENCY) + (1L << GLIBTOP_PROC_TIME_TIMEOUT) +
(1 << GLIBTOP_PROC_TIME_TIMEOUT) + (1 << GLIBTOP_PROC_TIME_IT_REAL_VALUE) + (1L << GLIBTOP_PROC_TIME_IT_REAL_VALUE) + (1L << GLIBTOP_PROC_TIME_START_TIME);
(1 << GLIBTOP_PROC_TIME_START_TIME);
static const unsigned long _glibtop_sysdeps_proc_time_smp = static const unsigned long _glibtop_sysdeps_proc_time_smp =
(1 << GLIBTOP_PROC_TIME_XCPU_UTIME) + (1 << GLIBTOP_PROC_TIME_XCPU_STIME); (1L << GLIBTOP_PROC_TIME_XCPU_UTIME) + (1L << GLIBTOP_PROC_TIME_XCPU_STIME);
/* Init function. */ /* Init function. */
@@ -71,8 +70,6 @@ glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, pid_t pid)
buf->cutime = strtoul (p, &p, 0); buf->cutime = strtoul (p, &p, 0);
buf->cstime = strtoul (p, &p, 0); buf->cstime = strtoul (p, &p, 0);
buf->rtime = buf->utime + buf->stime;
p = skip_multiple_token (p, 2); p = skip_multiple_token (p, 2);
buf->timeout = strtoul (p, &p, 0); buf->timeout = strtoul (p, &p, 0);

View File

@@ -26,14 +26,14 @@
#include <glibtop/procuid.h> #include <glibtop/procuid.h>
static const unsigned long _glibtop_sysdeps_proc_uid = static const unsigned long _glibtop_sysdeps_proc_uid =
(1 << GLIBTOP_PROC_UID_UID) + (1 << GLIBTOP_PROC_UID_EUID) + (1L << GLIBTOP_PROC_UID_UID) + (1L << GLIBTOP_PROC_UID_EUID) +
(1 << GLIBTOP_PROC_UID_GID) + (1 << GLIBTOP_PROC_UID_EGID); (1L << GLIBTOP_PROC_UID_GID) + (1L << GLIBTOP_PROC_UID_EGID);
static const unsigned long _glibtop_sysdeps_proc_uid_stat = static const unsigned long _glibtop_sysdeps_proc_uid_stat =
(1 << GLIBTOP_PROC_UID_PID) + (1 << GLIBTOP_PROC_UID_PPID) + (1L << GLIBTOP_PROC_UID_PID) + (1L << GLIBTOP_PROC_UID_PPID) +
(1 << GLIBTOP_PROC_UID_PGRP) + (1 << GLIBTOP_PROC_UID_SESSION) + (1L << GLIBTOP_PROC_UID_PGRP) + (1L << GLIBTOP_PROC_UID_SESSION) +
(1 << GLIBTOP_PROC_UID_TTY) + (1 << GLIBTOP_PROC_UID_TPGID) + (1L << GLIBTOP_PROC_UID_TTY) + (1L << GLIBTOP_PROC_UID_TPGID) +
(1 << GLIBTOP_PROC_UID_PRIORITY) + (1 << GLIBTOP_PROC_UID_NICE); (1L << GLIBTOP_PROC_UID_PRIORITY) + (1L << GLIBTOP_PROC_UID_NICE);
#define LINUX_VERSION(x,y,z) (0x10000*(x) + 0x100*(y) + z) #define LINUX_VERSION(x,y,z) (0x10000*(x) + 0x100*(y) + z)

View File

@@ -42,11 +42,11 @@ union semun
#endif #endif
static unsigned long _glibtop_sysdeps_sem_limits = static unsigned long _glibtop_sysdeps_sem_limits =
(1 << GLIBTOP_IPC_SEMMAP) + (1 << GLIBTOP_IPC_SEMMNI) + (1L << GLIBTOP_IPC_SEMMAP) + (1L << GLIBTOP_IPC_SEMMNI) +
(1 << GLIBTOP_IPC_SEMMNS) + (1 << GLIBTOP_IPC_SEMMNU) + (1L << GLIBTOP_IPC_SEMMNS) + (1L << GLIBTOP_IPC_SEMMNU) +
(1 << GLIBTOP_IPC_SEMMSL) + (1 << GLIBTOP_IPC_SEMOPM) + (1L << GLIBTOP_IPC_SEMMSL) + (1L << GLIBTOP_IPC_SEMOPM) +
(1 << GLIBTOP_IPC_SEMUME) + (1 << GLIBTOP_IPC_SEMUSZ) + (1L << GLIBTOP_IPC_SEMUME) + (1L << GLIBTOP_IPC_SEMUSZ) +
(1 << GLIBTOP_IPC_SEMVMX) + (1 << GLIBTOP_IPC_SEMAEM); (1L << GLIBTOP_IPC_SEMVMX) + (1L << GLIBTOP_IPC_SEMAEM);
/* Init function. */ /* Init function. */

Some files were not shown because too many files have changed in this diff Show More