Compare commits
38 Commits
gnome-2-20
...
LIBGTOP_1_
Author | SHA1 | Date | |
---|---|---|---|
|
d8871029eb | ||
|
6799ce187b | ||
|
2b6b2578be | ||
|
1b0a9fd291 | ||
|
43e070dd8b | ||
|
b0d18119ff | ||
|
be05f8163a | ||
|
d6cdf95d83 | ||
|
2256a9127f | ||
|
e6507a80be | ||
|
8411e566b4 | ||
|
40854f4179 | ||
|
41062d0262 | ||
|
58c882a860 | ||
|
789d156972 | ||
|
19c24da036 | ||
|
929a025f53 | ||
|
6a7c289305 | ||
|
b65a4a7dcb | ||
|
39b2fffe83 | ||
|
efb913acff | ||
|
79e756a2f7 | ||
|
b08968e644 | ||
|
dff497d2fa | ||
|
38de742ca4 | ||
|
e0d3401bc4 | ||
|
aae2b5a94d | ||
|
a5bd38fc19 | ||
|
931b8f065e | ||
|
f7885e488f | ||
|
8122db69ee | ||
|
ab13d4919d | ||
|
1d955fbf1f | ||
|
8af25a2003 | ||
|
12eb6a25ec | ||
|
77ced087a1 | ||
|
983475d0c1 | ||
|
70b65c05e5 |
2
AUTHORS
2
AUTHORS
@@ -1,2 +1,2 @@
|
||||
Martin Baulig (martin@home-of-linux.org)
|
||||
Josh Sled <jsled@scam.XCF.Berkeley.EDU>
|
||||
Drazen Kacar (dave@srce.hr)
|
||||
|
35
ChangeLog
35
ChangeLog
@@ -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>
|
||||
|
||||
Released LibGTop 1.0.1.
|
||||
|
@@ -8,10 +8,10 @@
|
||||
#
|
||||
LIBGTOP_MAJOR_VERSION=1
|
||||
LIBGTOP_MINOR_VERSION=0
|
||||
LIBGTOP_MICRO_VERSION=1
|
||||
LIBGTOP_MICRO_VERSION=3
|
||||
|
||||
LIBGTOP_INTERFACE_AGE=0
|
||||
LIBGTOP_BINARY_AGE=0
|
||||
LIBGTOP_INTERFACE_AGE=2
|
||||
LIBGTOP_BINARY_AGE=2
|
||||
|
||||
# Increase each time you change the client/server protocol.
|
||||
LIBGTOP_SERVER_VERSION=5
|
||||
|
@@ -11,7 +11,7 @@ support = support
|
||||
endif
|
||||
|
||||
SUBDIRS = po intl $(support) macros misc include sysdeps lib src \
|
||||
$(examples_SUBDIRS)
|
||||
$(examples_SUBDIRS) doc
|
||||
|
||||
include_HEADERS = glibtop.h
|
||||
|
||||
@@ -31,6 +31,8 @@ confexecdir = $(libdir)
|
||||
confexec_DATA = $(top_builddir)/libgtopConf.sh \
|
||||
$(top_builddir)/libgtop-features.def
|
||||
|
||||
CLEANFILES=libgtopConf.sh
|
||||
|
||||
bin_SCRIPTS = $(top_builddir)/libgtop-config
|
||||
|
||||
## to automatically rebuild aclocal.m4 if any of the macros in
|
||||
|
16
configure.in
16
configure.in
@@ -13,6 +13,12 @@ AC_MSG_ERROR([
|
||||
*** The "dc" utility was not found on your system.
|
||||
***
|
||||
*** 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
|
||||
|
||||
@@ -147,11 +153,14 @@ else
|
||||
fi
|
||||
|
||||
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
|
||||
static_targets=""
|
||||
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(smp_examples)
|
||||
AC_SUBST(guile_examples)
|
||||
@@ -220,7 +229,7 @@ AC_FUNC_STRFTIME
|
||||
AC_CHECK_FUNCS(getcwd gettimeofday getwd putenv strdup strtoul uname)
|
||||
|
||||
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
|
||||
|
||||
AC_PATH_XTRA
|
||||
@@ -354,7 +363,7 @@ else
|
||||
guile_def=""
|
||||
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)
|
||||
|
||||
@@ -406,5 +415,6 @@ src/daemon/Makefile
|
||||
src/inodedb/Makefile
|
||||
lib/Makefile
|
||||
examples/Makefile
|
||||
doc/Makefile
|
||||
support/Makefile
|
||||
macros/Makefile])
|
||||
|
@@ -11,4 +11,6 @@ third_linux
|
||||
third_static
|
||||
second_static
|
||||
second_linux
|
||||
smp_static sysdeps_static netload_static procmap_static mountlist_static
|
||||
smp sysdeps netload procmap mountlist
|
||||
timings timings_static
|
||||
|
@@ -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>
|
||||
|
||||
* netload.c: Call inet_ntoa () to get address and subnet
|
||||
|
@@ -12,13 +12,14 @@ DEFS = @DEFS@
|
||||
libgtopdir = $(libexecdir)/libgtop
|
||||
|
||||
libgtop_PROGRAMS = first second\
|
||||
mountlist procmap netload sysdeps\
|
||||
mountlist procmap netload sysdeps timings \
|
||||
@static_targets@ @guile_examples@ @smp_examples@
|
||||
|
||||
EXTRA_PROGRAMS = first_static second_static \
|
||||
mountlist_static procmap_static \
|
||||
third third_static smp smp_static \
|
||||
netload_static sysdeps_static
|
||||
netload_static sysdeps_static \
|
||||
timings_static
|
||||
|
||||
first_SOURCES = first.c
|
||||
first_LDADD = $(top_builddir)/lib/libgtop.la \
|
||||
@@ -108,3 +109,13 @@ smp_static_SOURCES = $(smp_SOURCES)
|
||||
smp_static_LDADD = $(smp_LDADD)
|
||||
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
|
||||
|
||||
|
250
examples/first.c
250
examples/first.c
@@ -116,9 +116,16 @@ main (int argc, char *argv [])
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
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",
|
||||
(unsigned long) data.uptime.flags,
|
||||
data.uptime.uptime, data.uptime.idletime);
|
||||
#endif
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_loadavg (&data.loadavg);
|
||||
@@ -242,15 +249,52 @@ main (int argc, char *argv [])
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
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",
|
||||
(int) pid, (unsigned long) data.proc_state.flags,
|
||||
data.proc_state.cmd, data.proc_state.state,
|
||||
(unsigned long) data.proc_state.uid,
|
||||
(unsigned long) data.proc_state.gid);
|
||||
#endif
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
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): "
|
||||
"%d %d %d %d %d %d %d %d %d %d %d %d\n", (int) pid,
|
||||
(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.tty, data.proc_uid.tpgid,
|
||||
data.proc_uid.priority, data.proc_uid.nice);
|
||||
#endif
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_mem (&data.proc_mem, pid);
|
||||
@@ -277,6 +322,30 @@ main (int argc, char *argv [])
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
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): "
|
||||
"%lu %lu %lu %lu %lu %lu %lu %lu\n", (int) pid,
|
||||
(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.end_code,
|
||||
(unsigned long) data.proc_segment.start_stack);
|
||||
#endif
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_time (&data.proc_time, pid);
|
||||
@@ -308,6 +378,19 @@ main (int argc, char *argv [])
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
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): "
|
||||
"%lu %lu %lu %lu\n", (int) pid,
|
||||
(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.sigignore,
|
||||
(unsigned long) data.proc_signal.sigcatch);
|
||||
#endif
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_kernel (&data.proc_kernel, pid);
|
||||
|
||||
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.k_flags,
|
||||
(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,
|
||||
(unsigned long) data.proc_args.flags,
|
||||
(unsigned long) data.proc_args.size,
|
||||
args);
|
||||
args ? args : "");
|
||||
|
||||
glibtop_free (args);
|
||||
|
||||
@@ -353,15 +437,52 @@ main (int argc, char *argv [])
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
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",
|
||||
(int) ppid, (unsigned long) data.proc_state.flags,
|
||||
data.proc_state.cmd, data.proc_state.state,
|
||||
(unsigned long) data.proc_state.uid,
|
||||
(unsigned long) data.proc_state.gid);
|
||||
#endif
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
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): "
|
||||
"%d %d %d %d %d %d %d %d %d %d %d %d\n", (int) ppid,
|
||||
(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.tty, data.proc_uid.tpgid,
|
||||
data.proc_uid.priority, data.proc_uid.nice);
|
||||
#endif
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_mem (&data.proc_mem, ppid);
|
||||
@@ -388,6 +510,30 @@ main (int argc, char *argv [])
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
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): "
|
||||
"%lu %lu %lu %lu %lu %lu %lu %lu\n", (int) ppid,
|
||||
(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.end_code,
|
||||
(unsigned long) data.proc_segment.start_stack);
|
||||
#endif
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_time (&data.proc_time, ppid);
|
||||
@@ -419,18 +566,32 @@ main (int argc, char *argv [])
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
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",
|
||||
(int) ppid, (unsigned long) data.proc_signal.flags,
|
||||
(unsigned long) data.proc_signal.signal,
|
||||
(unsigned long) data.proc_signal.blocked,
|
||||
(unsigned long) data.proc_signal.sigignore,
|
||||
(unsigned long) data.proc_signal.sigcatch);
|
||||
#endif
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_kernel (&data.proc_kernel, ppid);
|
||||
|
||||
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.k_flags,
|
||||
(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,
|
||||
(unsigned long) data.proc_args.flags,
|
||||
(unsigned long) data.proc_args.size,
|
||||
args);
|
||||
args ? args : "");
|
||||
|
||||
glibtop_free (args);
|
||||
|
||||
@@ -463,15 +624,52 @@ main (int argc, char *argv [])
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
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,
|
||||
(unsigned long) data.proc_state.flags,
|
||||
data.proc_state.cmd, data.proc_state.state,
|
||||
(unsigned long) data.proc_state.uid,
|
||||
(unsigned long) data.proc_state.gid);
|
||||
#endif
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
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): "
|
||||
"%d %d %d %d %d %d %d %d %d %d %d %d\n", 1,
|
||||
(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.tty, data.proc_uid.tpgid,
|
||||
data.proc_uid.priority, data.proc_uid.nice);
|
||||
#endif
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_mem (&data.proc_mem, 1);
|
||||
@@ -498,6 +697,30 @@ main (int argc, char *argv [])
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
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): "
|
||||
"%lu %lu %lu %lu %lu %lu %lu %lu\n", 1,
|
||||
(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.end_code,
|
||||
(unsigned long) data.proc_segment.start_stack);
|
||||
#endif
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_time (&data.proc_time, 1);
|
||||
@@ -529,6 +753,19 @@ main (int argc, char *argv [])
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
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): "
|
||||
"%lu %lu %lu %lu\n", 1,
|
||||
(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.sigignore,
|
||||
(unsigned long) data.proc_signal.sigcatch);
|
||||
#endif
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++)
|
||||
glibtop_get_proc_kernel (&data.proc_kernel, 1);
|
||||
|
||||
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.k_flags,
|
||||
(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,
|
||||
(unsigned long) data.proc_args.flags,
|
||||
(unsigned long) data.proc_args.size,
|
||||
args);
|
||||
args ? args : "");
|
||||
|
||||
glibtop_free (args);
|
||||
|
||||
|
@@ -43,7 +43,7 @@ int
|
||||
main (int argc, char *argv [])
|
||||
{
|
||||
glibtop_netload netload;
|
||||
unsigned method, count, port, i;
|
||||
unsigned method, count, port;
|
||||
struct in_addr addr, subnet;
|
||||
char *address_string, *subnet_string;
|
||||
char buffer [BUFSIZ];
|
||||
|
@@ -97,7 +97,7 @@ main (int argc, char *argv [])
|
||||
unsigned device, device_major, device_minor;
|
||||
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;
|
||||
|
||||
#ifdef GLIBTOP_INODEDB
|
||||
@@ -116,24 +116,41 @@ main (int argc, char *argv [])
|
||||
device_minor = (device & 255);
|
||||
device_major = ((device >> 8) & 255);
|
||||
|
||||
if (filename)
|
||||
fprintf (stderr, "%08lx-%08lx %08lx - "
|
||||
"%02x:%02x %08lu - %4s - %s\n",
|
||||
if (filename) {
|
||||
char *format;
|
||||
|
||||
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].end,
|
||||
(unsigned long) maps [i].offset,
|
||||
device_major, device_minor,
|
||||
(unsigned long) maps [i].inode,
|
||||
perm, filename);
|
||||
else
|
||||
fprintf (stderr, "%08lx-%08lx %08lx - "
|
||||
"%02x:%02x %08lu - %4s\n",
|
||||
} else {
|
||||
char * format;
|
||||
|
||||
if (sizeof (void*) == 8)
|
||||
format = "%016lx-%016lx %016lx - "
|
||||
"%02x:%02x %08lu - %4s\n";
|
||||
else
|
||||
format = "%08lx-%08lx %08lx - "
|
||||
"%02x:%02x %08lu - %4s\n";
|
||||
|
||||
fprintf (stderr, format,
|
||||
(unsigned long) maps [i].start,
|
||||
(unsigned long) maps [i].end,
|
||||
(unsigned long) maps [i].offset,
|
||||
device_major, device_minor,
|
||||
(unsigned long) maps [i].inode,
|
||||
perm);
|
||||
}
|
||||
|
||||
if (filename && (filename != maps [i].filename))
|
||||
glibtop_free (filename);
|
||||
|
@@ -31,8 +31,6 @@
|
||||
#include <glibtop/union.h>
|
||||
#include <glibtop/sysdeps.h>
|
||||
|
||||
#include <math.h>
|
||||
|
||||
static void
|
||||
output (pid_t pid)
|
||||
{
|
||||
@@ -53,15 +51,52 @@ output (pid_t 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", (int) pid,
|
||||
(unsigned long) data.proc_state.flags,
|
||||
data.proc_state.cmd, data.proc_state.state,
|
||||
(unsigned long) data.proc_state.uid,
|
||||
(unsigned long) data.proc_state.gid);
|
||||
#endif
|
||||
|
||||
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): "
|
||||
"%d %d %d %d %d %d %d %d %d %d %d %d\n", (int) pid,
|
||||
(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.tty, data.proc_uid.tpgid,
|
||||
data.proc_uid.priority, data.proc_uid.nice);
|
||||
#endif
|
||||
|
||||
glibtop_get_proc_mem (&data.proc_mem, pid);
|
||||
|
||||
@@ -86,6 +122,30 @@ output (pid_t 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): "
|
||||
"%lu %lu %lu %lu %lu %lu %lu %lu\n", (int) pid,
|
||||
(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.end_code,
|
||||
(unsigned long) data.proc_segment.start_stack);
|
||||
#endif
|
||||
|
||||
glibtop_get_proc_time (&data.proc_time, pid);
|
||||
|
||||
@@ -115,6 +176,19 @@ output (pid_t 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): "
|
||||
"%lu %lu %lu %lu\n", (int) pid,
|
||||
(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.sigignore,
|
||||
(unsigned long) data.proc_signal.sigcatch);
|
||||
#endif
|
||||
|
||||
glibtop_get_proc_kernel (&data.proc_kernel, pid);
|
||||
|
||||
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.k_flags,
|
||||
(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,
|
||||
(unsigned long) data.proc_args.flags,
|
||||
(unsigned long) data.proc_args.size,
|
||||
args);
|
||||
args ? args : "");
|
||||
|
||||
glibtop_free (args);
|
||||
|
||||
|
@@ -27,8 +27,6 @@
|
||||
#include <glibtop/cpu.h>
|
||||
#include <glibtop/xmalloc.h>
|
||||
|
||||
#include <math.h>
|
||||
|
||||
int
|
||||
main (int argc, char *argv [])
|
||||
{
|
||||
@@ -67,7 +65,7 @@ main (int argc, char *argv [])
|
||||
memset (separator, '-', 91);
|
||||
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,
|
||||
_("Total"), _("User"), _("Nice"), _("Sys"), _("Idle"), separator);
|
||||
|
@@ -38,7 +38,7 @@ int
|
||||
main (int argc, char *argv [])
|
||||
{
|
||||
glibtop_sysdeps sysdeps;
|
||||
unsigned method, count, port, i;
|
||||
unsigned method, count, port;
|
||||
char buffer [BUFSIZ];
|
||||
|
||||
count = PROFILE_COUNT;
|
||||
@@ -69,10 +69,13 @@ main (int argc, char *argv [])
|
||||
|
||||
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"
|
||||
"\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"
|
||||
"\tmem:\t\t%d\t0x%08lx\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",
|
||||
(unsigned long) sysdeps.flags,
|
||||
(unsigned long) sysdeps.features,
|
||||
#if LIBGTOP_VERSION_CODE > 1001000
|
||||
(unsigned long) sysdeps.pointer_size,
|
||||
#endif
|
||||
FEATURE_CHECK(CPU),
|
||||
(unsigned long) sysdeps.cpu,
|
||||
FEATURE_CHECK(MEM),
|
||||
|
357
examples/timings.c
Normal file
357
examples/timings.c
Normal 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);
|
||||
}
|
@@ -28,13 +28,22 @@
|
||||
|
||||
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_warn_vr (glibtop *server, char *format, 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);
|
||||
|
||||
static void
|
||||
static void G_GNUC_UNUSED
|
||||
glibtop_error_r (glibtop *server, char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
@@ -44,7 +53,7 @@ glibtop_error_r (glibtop *server, char *format, ...)
|
||||
va_end (args);
|
||||
}
|
||||
|
||||
static void
|
||||
static void G_GNUC_UNUSED
|
||||
glibtop_warn_r (glibtop *server, char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
@@ -54,7 +63,7 @@ glibtop_warn_r (glibtop *server, char *format, ...)
|
||||
va_end (args);
|
||||
}
|
||||
|
||||
static void
|
||||
static void G_GNUC_UNUSED
|
||||
glibtop_error_io_r (glibtop *server, char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
@@ -64,7 +73,7 @@ glibtop_error_io_r (glibtop *server, char *format, ...)
|
||||
va_end (args);
|
||||
}
|
||||
|
||||
static void
|
||||
static void G_GNUC_UNUSED
|
||||
glibtop_warn_io_r (glibtop *server, char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
38
include/glibtop/limits.h
Normal file
38
include/glibtop/limits.h
Normal 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
1
kernel/sysctl/.cvsignore
Normal file
@@ -0,0 +1 @@
|
||||
*.flags
|
22
kernel/sysctl/Makefile
Normal file
22
kernel/sysctl/Makefile
Normal 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
1268
kernel/sysctl/libgtop.c
Normal file
File diff suppressed because it is too large
Load Diff
242
kernel/sysctl/libgtop.h
Normal file
242
kernel/sysctl/libgtop.h
Normal 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
|
30
kernel/sysctl/libgtop_syms.c
Normal file
30
kernel/sysctl/libgtop_syms.c
Normal 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
4
kernel/sysctl/main.c
Normal file
@@ -0,0 +1,4 @@
|
||||
/*
|
||||
* linux/libgtop/main.c
|
||||
* Copyright (C) 1999 Martin Baulig
|
||||
*/
|
81
kernel/sysctl/patch-2.2.1
Normal file
81
kernel/sysctl/patch-2.2.1
Normal 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}
|
||||
};
|
||||
|
14
lib/lib.pl
14
lib/lib.pl
@@ -36,20 +36,26 @@ print 'static void';
|
||||
print '_glibtop_missing_feature (glibtop *server, const char *feature,';
|
||||
print "\t\t\t const u_int64_t present, u_int64_t *required)";
|
||||
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 "\tcase GLIBTOP_ERROR_METHOD_WARN_ONCE:";
|
||||
print "\t\t*required &= present;";
|
||||
print "\tcase GLIBTOP_ERROR_METHOD_WARN:";
|
||||
print "\t\tglibtop_warn_r (server,";
|
||||
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 feature, required, present);";
|
||||
print "\t\t\t\t \"field mask %05lx, but only have %05lx.\"),";
|
||||
print "\t\t\t\t feature, (unsigned long) old_required,";
|
||||
print "\t\t\t\t (unsigned long) present);";
|
||||
print "\t\tbreak;";
|
||||
print "\tcase GLIBTOP_ERROR_METHOD_ABORT:";
|
||||
print "\t\tglibtop_error_r (server,";
|
||||
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 feature, required, present);";
|
||||
print "\t\t\t\t \"field mask %05lx, but only have %05lx.\"),";
|
||||
print "\t\t\t\t feature, (unsigned long) old_required,";
|
||||
print "\t\t\t\t (unsigned long) present);";
|
||||
print "\t\tbreak;";
|
||||
print "\t}";
|
||||
print '}';
|
||||
|
@@ -30,6 +30,7 @@ do_read (int s, void *ptr, size_t total_size)
|
||||
{
|
||||
int nread;
|
||||
size_t already_read = 0, remaining = total_size;
|
||||
char *tmp_ptr;
|
||||
|
||||
while (already_read < total_size) {
|
||||
nread = recv (s, ptr, remaining, 0);
|
||||
@@ -46,7 +47,10 @@ do_read (int s, void *ptr, size_t total_size)
|
||||
|
||||
already_read += nread;
|
||||
remaining -= nread;
|
||||
(char *) ptr += nread;
|
||||
/* (char *) ptr += nread; */
|
||||
tmp_ptr = ptr;
|
||||
tmp_ptr += nread;
|
||||
ptr = tmp_ptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -40,6 +40,7 @@ GLIBTOP_SUID_PROC_TIME +
|
||||
GLIBTOP_SUID_PROC_SIGNAL +
|
||||
GLIBTOP_SUID_PROC_KERNEL +
|
||||
GLIBTOP_SUID_PROC_SEGMENT +
|
||||
GLIBTOP_SUID_PROC_ARGS +
|
||||
GLIBTOP_SUID_PROC_MAP +
|
||||
GLIBTOP_SUID_NETLOAD +
|
||||
GLIBTOP_SUID_PPP;
|
||||
|
@@ -118,7 +118,7 @@ AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[
|
||||
fi
|
||||
libgtop_need_server=no
|
||||
;;
|
||||
freebsd*|netbsd*|openbsd*)
|
||||
freebsd*|netbsd*|openbsd*|bsdi*)
|
||||
libgtop_sysdeps_dir=freebsd
|
||||
libgtop_use_machine_h=yes
|
||||
libgtop_need_server=yes
|
||||
@@ -177,7 +177,7 @@ AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[
|
||||
#include <net/netisr.h>
|
||||
#include <net/route.h>
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#if (defined __FreeBSD__) || (defined __NetBSD__)
|
||||
#include <net/if_sppp.h>
|
||||
#else
|
||||
#include <i4b/sppp/if_sppp.h>
|
||||
@@ -203,7 +203,7 @@ AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[
|
||||
#include <net/netisr.h>
|
||||
#include <net/route.h>
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__)
|
||||
#include <net/if_sppp.h>
|
||||
#else
|
||||
#include <i4b/sppp/if_sppp.h>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
# Note that this is NOT a relocatable package
|
||||
%define ver @VERSION@
|
||||
%define rel SNAP
|
||||
%define RELEASE SNAP
|
||||
%define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE}
|
||||
%define prefix /usr
|
||||
|
||||
Summary: LibGTop library
|
||||
@@ -118,8 +119,9 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{prefix}/lib/*.sh
|
||||
%{prefix}/lib/*.def
|
||||
%{prefix}/include/*
|
||||
%{prefix}/lib/libgtop
|
||||
|
||||
%files examples
|
||||
%defattr(-,root,root)
|
||||
|
||||
%{prefix}/libexec/libgtop/*
|
||||
%{prefix}/libexec/libgtop
|
||||
|
26
misc/timings/timings.linux-proc
Normal file
26
misc/timings/timings.linux-proc
Normal 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).
|
||||
|
27
misc/timings/timings.linux-sysctl
Normal file
27
misc/timings/timings.linux-sysctl
Normal 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).
|
||||
|
12
po/ChangeLog
12
po/ChangeLog
@@ -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>
|
||||
|
||||
* no.po: Updated translation
|
||||
|
281
po/de.po
281
po/de.po
@@ -1,12 +1,11 @@
|
||||
# libgtop de.po
|
||||
# Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
# Martin Baulig <martin@home-of-linux.org>, 1998.
|
||||
#
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR Free Software Foundation, Inc.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libgtop VERSION\n"
|
||||
"POT-Creation-Date: 1999-02-27 22:24+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"POT-Creation-Date: 1999-09-16 23:16+0200\n"
|
||||
"PO-Revision-Date: 1999-07-11 12:44+02:00\n"
|
||||
"Last-Translator: Martin Baulig <martin@home-of-linux.org>\n"
|
||||
"Language-Team: Martin Baulig <martin@home-of-linux.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -297,6 +296,17 @@ msgid ""
|
||||
"\n"
|
||||
"The math bit should be a decimal 4, and the traced bit is decimal 10."
|
||||
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
|
||||
#: sysdeps/names/prockernel.c:59
|
||||
@@ -396,8 +406,8 @@ msgid "Number of pages of virtual memory"
|
||||
msgstr "Anzahl virtueller Speicherseiten"
|
||||
|
||||
#: sysdeps/names/procmem.c:55
|
||||
msgid "Number of residnet set (non-swapped) pages"
|
||||
msgstr "Anzahl nichtausgelagerter Speicherseiten"
|
||||
msgid "Number of resident set (non-swapped) pages"
|
||||
msgstr "Anzahl residenter (nicht ausgelagerter) Speicherseiten"
|
||||
|
||||
#: sysdeps/names/procmem.c:56
|
||||
msgid "Number of pages of shared (mmap'd) memory"
|
||||
@@ -544,11 +554,11 @@ msgstr "Prozessstatus (S=schl
|
||||
|
||||
#: sysdeps/names/procstate.c:47
|
||||
msgid "UID of process"
|
||||
msgstr "UID des Prozesses"
|
||||
msgstr "echte UID des Prozesses"
|
||||
|
||||
#: sysdeps/names/procstate.c:48
|
||||
msgid "GID of process"
|
||||
msgstr "GID des Prozesses"
|
||||
msgstr "echte GID des Prozesses"
|
||||
|
||||
#: sysdeps/names/proctime.c:44
|
||||
msgid "Start_Time"
|
||||
@@ -588,11 +598,11 @@ msgstr "Frequenz"
|
||||
|
||||
#: sysdeps/names/proctime.c:46
|
||||
msgid "XCPU_UTime"
|
||||
msgstr ""
|
||||
msgstr "XCPU_UTime"
|
||||
|
||||
#: sysdeps/names/proctime.c:46
|
||||
msgid "XCPU_STime"
|
||||
msgstr ""
|
||||
msgstr "XCPU_STime"
|
||||
|
||||
#: sysdeps/names/proctime.c:51
|
||||
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
|
||||
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
|
||||
msgid "Max number of arrays"
|
||||
msgstr ""
|
||||
msgstr "Maximale Anzahl Arrays"
|
||||
|
||||
#: sysdeps/names/sem_limits.c:44 sysdeps/names/sem_limits.c:58
|
||||
msgid "Max semaphores system wide"
|
||||
msgstr ""
|
||||
msgstr "Maximale Anzahl Semaphore im System"
|
||||
|
||||
#: sysdeps/names/sem_limits.c:45 sysdeps/names/sem_limits.c:59
|
||||
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
|
||||
msgid "Max semaphores per array"
|
||||
msgstr ""
|
||||
msgstr "Maximale Anzahl Semaphore pro Array"
|
||||
|
||||
#: sysdeps/names/sem_limits.c:47 sysdeps/names/sem_limits.c:61
|
||||
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
|
||||
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
|
||||
msgid "sizeof struct sem_undo"
|
||||
msgstr ""
|
||||
msgstr "sizeof struct sem_undo"
|
||||
|
||||
#: sysdeps/names/sem_limits.c:50 sysdeps/names/sem_limits.c:64
|
||||
msgid "Semaphore max value"
|
||||
msgstr ""
|
||||
msgstr "Semaphor-Maximalwert"
|
||||
|
||||
#: sysdeps/names/sem_limits.c:51 sysdeps/names/sem_limits.c:65
|
||||
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
|
||||
msgid "Max segment size"
|
||||
msgstr ""
|
||||
msgstr "Maximale Segmentgr<67><72>e"
|
||||
|
||||
#: sysdeps/names/shm_limits.c:40 sysdeps/names/shm_limits.c:49
|
||||
msgid "Min segment size"
|
||||
msgstr ""
|
||||
msgstr "Minimale Segmentgr<67><72>e"
|
||||
|
||||
#: sysdeps/names/shm_limits.c:41 sysdeps/names/shm_limits.c:50
|
||||
msgid "Max number of segments"
|
||||
msgstr ""
|
||||
msgstr "Maximale Anzahl Segmente"
|
||||
|
||||
#: sysdeps/names/shm_limits.c:42 sysdeps/names/shm_limits.c:51
|
||||
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
|
||||
msgid "Max total shared memory"
|
||||
msgstr ""
|
||||
msgstr "Maximaler gesamter gemeinsamer Speicher"
|
||||
|
||||
#: sysdeps/names/swap.c:39 sysdeps/names/swap.c:48
|
||||
msgid "Total Swap Space"
|
||||
@@ -869,7 +879,7 @@ msgstr "Limits f
|
||||
|
||||
#: sysdeps/names/sysdeps.c:57 sysdeps/names/sysdeps.c:84
|
||||
msgid "Semaphore Set Limits"
|
||||
msgstr ""
|
||||
msgstr "Semaphor-Setzbegrenzungen"
|
||||
|
||||
#: sysdeps/names/sysdeps.c:58 sysdeps/names/sysdeps.c:85
|
||||
msgid "List of running Processes"
|
||||
@@ -889,36 +899,35 @@ msgstr "Speicherbelegung des Prozesses"
|
||||
|
||||
#: sysdeps/names/sysdeps.c:62 sysdeps/names/sysdeps.c:89
|
||||
msgid "Process Time information"
|
||||
msgstr ""
|
||||
msgstr "Prozess-Zeitinformation"
|
||||
|
||||
#: sysdeps/names/sysdeps.c:63 sysdeps/names/sysdeps.c:90
|
||||
msgid "Process Signal information"
|
||||
msgstr ""
|
||||
msgstr "Prozess-Signalinformation"
|
||||
|
||||
#: sysdeps/names/sysdeps.c:64 sysdeps/names/sysdeps.c:91
|
||||
msgid "Process Kernel Data information"
|
||||
msgstr ""
|
||||
msgstr "Prozess-Kerneldateninformation"
|
||||
|
||||
#: sysdeps/names/sysdeps.c:65 sysdeps/names/sysdeps.c:92
|
||||
msgid "Process Segment information"
|
||||
msgstr ""
|
||||
msgstr "Prozess-Segmentinformation"
|
||||
|
||||
#: sysdeps/names/sysdeps.c:66
|
||||
#, fuzzy
|
||||
msgid "Process Arguments"
|
||||
msgstr "Prozessgruppen-ID"
|
||||
msgstr "Prozessargumente"
|
||||
|
||||
#: sysdeps/names/sysdeps.c:67 sysdeps/names/sysdeps.c:94
|
||||
msgid "Process Memory Map"
|
||||
msgstr ""
|
||||
msgstr "Prozess-Speicherplan"
|
||||
|
||||
#: sysdeps/names/sysdeps.c:68
|
||||
msgid "Mount List"
|
||||
msgstr ""
|
||||
msgstr "Mountliste"
|
||||
|
||||
#: sysdeps/names/sysdeps.c:69 sysdeps/names/sysdeps.c:96
|
||||
msgid "File System Usage"
|
||||
msgstr ""
|
||||
msgstr "Dateisystemnutzung"
|
||||
|
||||
#: sysdeps/names/sysdeps.c:70 sysdeps/names/sysdeps.c:97
|
||||
msgid "Network Load"
|
||||
@@ -938,7 +947,7 @@ msgstr "Liste gegenw
|
||||
|
||||
#: sysdeps/names/uptime.c:38
|
||||
msgid "Uptime"
|
||||
msgstr ""
|
||||
msgstr "Uptime"
|
||||
|
||||
#: sysdeps/names/uptime.c:39
|
||||
msgid "Idletime"
|
||||
@@ -951,6 +960,7 @@ msgstr "Zeit in Sekunden seit System-Boot"
|
||||
#: sysdeps/names/uptime.c:45
|
||||
msgid "Time in seconds the system spent in the idle task since system boot"
|
||||
msgstr ""
|
||||
"Zeit in Sekunden, die das System seit dem Booten im Leerlauf verbracht hat"
|
||||
|
||||
#: support/error.c:109
|
||||
msgid "Unknown system error"
|
||||
@@ -959,116 +969,245 @@ msgstr "Unbekannter Systemfehler"
|
||||
#: support/getopt.c:669
|
||||
#, c-format
|
||||
msgid "%s: option `%s' is ambiguous\n"
|
||||
msgstr ""
|
||||
msgstr "%s: option `%s' ist mehrdeutig\n"
|
||||
|
||||
#: support/getopt.c:693
|
||||
#, c-format
|
||||
msgid "%s: option `--%s' doesn't allow an argument\n"
|
||||
msgstr ""
|
||||
msgstr "%s: option `--%s' erlaubt kein Argument\n"
|
||||
|
||||
#: support/getopt.c:698
|
||||
#, c-format
|
||||
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
|
||||
#, c-format
|
||||
msgid "%s: option `%s' requires an argument\n"
|
||||
msgstr ""
|
||||
msgstr "%s: option `%s' ben<65>tigt ein Argument\n"
|
||||
|
||||
#. --option
|
||||
#: support/getopt.c:744
|
||||
#, c-format
|
||||
msgid "%s: unrecognized option `--%s'\n"
|
||||
msgstr ""
|
||||
msgstr "%s: unbekannte Option: `--%s'\n"
|
||||
|
||||
#. +option or -option
|
||||
#: support/getopt.c:748
|
||||
#, c-format
|
||||
msgid "%s: unrecognized option `%c%s'\n"
|
||||
msgstr ""
|
||||
msgstr "%s: unbekannte Option: `%c%s'\n"
|
||||
|
||||
#. 1003.2 specifies the format of this message.
|
||||
#: support/getopt.c:774
|
||||
#, c-format
|
||||
msgid "%s: illegal option -- %c\n"
|
||||
msgstr ""
|
||||
msgstr "%s: illegale Option -- %c\n"
|
||||
|
||||
#: support/getopt.c:777
|
||||
#, c-format
|
||||
msgid "%s: invalid option -- %c\n"
|
||||
msgstr ""
|
||||
msgstr "%s: ung<6E>ltige Option -- %c\n"
|
||||
|
||||
#. 1003.2 specifies the format of this message.
|
||||
#: support/getopt.c:807 support/getopt.c:937
|
||||
#, c-format
|
||||
msgid "%s: option requires an argument -- %c\n"
|
||||
msgstr ""
|
||||
msgstr "%s: option ben<65>tigt ein Argument -- %c\n"
|
||||
|
||||
#: support/getopt.c:854
|
||||
#, c-format
|
||||
msgid "%s: option `-W %s' is ambiguous\n"
|
||||
msgstr ""
|
||||
msgstr "%s: Option `-W %s' ist mehrdeutig\n"
|
||||
|
||||
#: support/getopt.c:872
|
||||
#, c-format
|
||||
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
|
||||
msgid "read %d bytes"
|
||||
msgstr ""
|
||||
msgstr "%d bytes gelesen"
|
||||
|
||||
#: lib/read_data.c:49
|
||||
msgid "read data size"
|
||||
msgstr ""
|
||||
msgstr "lese Datenmenge"
|
||||
|
||||
#: lib/read_data.c:66
|
||||
#, c-format
|
||||
msgid "read data %d bytes"
|
||||
msgstr ""
|
||||
msgstr "%d Datenbytes gelesen"
|
||||
|
||||
#: lib/write.c:48
|
||||
#, c-format
|
||||
msgid "write %d bytes"
|
||||
msgstr ""
|
||||
msgstr "schreibe %d bytes"
|
||||
|
||||
#: src/daemon/gnuserv.c:445
|
||||
#: src/daemon/gnuserv.c:446
|
||||
msgid "Enable debugging"
|
||||
msgstr ""
|
||||
msgstr "Fehlerdiagnose einschalten"
|
||||
|
||||
#: src/daemon/gnuserv.c:445
|
||||
#: src/daemon/gnuserv.c:446
|
||||
msgid "DEBUG"
|
||||
msgstr ""
|
||||
msgstr "DIAGNOSE"
|
||||
|
||||
#: src/daemon/gnuserv.c:447
|
||||
#: src/daemon/gnuserv.c:448
|
||||
msgid "Enable verbose output"
|
||||
msgstr ""
|
||||
msgstr "Gespr<EFBFBD>chige Ausgabe einschalten"
|
||||
|
||||
#: src/daemon/gnuserv.c:447
|
||||
#: src/daemon/gnuserv.c:448
|
||||
msgid "VERBOSE"
|
||||
msgstr ""
|
||||
msgstr "GESPRAECHIG"
|
||||
|
||||
#: src/daemon/gnuserv.c:449
|
||||
#: src/daemon/gnuserv.c:450
|
||||
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"
|
||||
msgstr ""
|
||||
msgstr "KEIN-D<>MON"
|
||||
|
||||
#: src/daemon/gnuserv.c:451
|
||||
#: src/daemon/gnuserv.c:452
|
||||
msgid "Invoked from inetd"
|
||||
msgstr ""
|
||||
msgstr "Durch inetd aufgerufen"
|
||||
|
||||
#: src/daemon/gnuserv.c:451
|
||||
#: src/daemon/gnuserv.c:452
|
||||
msgid "INETD"
|
||||
msgstr ""
|
||||
msgstr "INETD"
|
||||
|
||||
#: src/daemon/gnuserv.c:485
|
||||
#: src/daemon/gnuserv.c:486
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Error on option %s: %s.\n"
|
||||
"Run '%s --help' to see a full list of available command line options.\n"
|
||||
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)"
|
||||
|
25
po/es.po
25
po/es.po
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"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"
|
||||
"Last-Translator: 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"
|
||||
|
||||
#: 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)"
|
||||
|
||||
#: sysdeps/names/procmem.c:56
|
||||
@@ -1057,7 +1058,7 @@ msgstr "%s: la opci
|
||||
msgid "%s: option `-W %s' doesn't allow an argument\n"
|
||||
msgstr "%s: la opci<63>n `-W %s' no admite argumentos\n"
|
||||
|
||||
#: lib/read.c:71
|
||||
#: lib/read.c:75
|
||||
#, c-format
|
||||
msgid "read %d bytes"
|
||||
msgstr "le<6C>dos %d bytes"
|
||||
@@ -1076,39 +1077,39 @@ msgstr "le
|
||||
msgid "write %d bytes"
|
||||
msgstr "escritos %d bytes"
|
||||
|
||||
#: src/daemon/gnuserv.c:445
|
||||
#: src/daemon/gnuserv.c:446
|
||||
msgid "Enable debugging"
|
||||
msgstr "Activar depuraci<63>n"
|
||||
|
||||
#: src/daemon/gnuserv.c:445
|
||||
#: src/daemon/gnuserv.c:446
|
||||
msgid "DEBUG"
|
||||
msgstr "DEPURACI<43>N"
|
||||
|
||||
#: src/daemon/gnuserv.c:447
|
||||
#: src/daemon/gnuserv.c:448
|
||||
msgid "Enable verbose output"
|
||||
msgstr "Activa salida detallada"
|
||||
|
||||
#: src/daemon/gnuserv.c:447
|
||||
#: src/daemon/gnuserv.c:448
|
||||
msgid "VERBOSE"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:449
|
||||
#: src/daemon/gnuserv.c:450
|
||||
msgid "Don't fork into background"
|
||||
msgstr "No abrir un proceso de fondo"
|
||||
|
||||
#: src/daemon/gnuserv.c:449
|
||||
#: src/daemon/gnuserv.c:450
|
||||
msgid "NO-DAEMON"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:451
|
||||
#: src/daemon/gnuserv.c:452
|
||||
msgid "Invoked from inetd"
|
||||
msgstr "Invocado desde inetd"
|
||||
|
||||
#: src/daemon/gnuserv.c:451
|
||||
#: src/daemon/gnuserv.c:452
|
||||
msgid "INETD"
|
||||
msgstr "INETD"
|
||||
|
||||
#: src/daemon/gnuserv.c:485
|
||||
#: src/daemon/gnuserv.c:486
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Error on option %s: %s.\n"
|
||||
|
24
po/es_DO.po
24
po/es_DO.po
@@ -6,7 +6,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"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"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -380,7 +380,7 @@ msgid "Number of pages of virtual memory"
|
||||
msgstr ""
|
||||
|
||||
#: sysdeps/names/procmem.c:55
|
||||
msgid "Number of residnet set (non-swapped) pages"
|
||||
msgid "Number of resident set (non-swapped) pages"
|
||||
msgstr ""
|
||||
|
||||
#: sysdeps/names/procmem.c:56
|
||||
@@ -992,7 +992,7 @@ msgstr ""
|
||||
msgid "%s: option `-W %s' doesn't allow an argument\n"
|
||||
msgstr ""
|
||||
|
||||
#: lib/read.c:71
|
||||
#: lib/read.c:75
|
||||
#, c-format
|
||||
msgid "read %d bytes"
|
||||
msgstr ""
|
||||
@@ -1011,39 +1011,39 @@ msgstr ""
|
||||
msgid "write %d bytes"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:445
|
||||
#: src/daemon/gnuserv.c:446
|
||||
msgid "Enable debugging"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:445
|
||||
#: src/daemon/gnuserv.c:446
|
||||
msgid "DEBUG"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:447
|
||||
#: src/daemon/gnuserv.c:448
|
||||
msgid "Enable verbose output"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:447
|
||||
#: src/daemon/gnuserv.c:448
|
||||
msgid "VERBOSE"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:449
|
||||
#: src/daemon/gnuserv.c:450
|
||||
msgid "Don't fork into background"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:449
|
||||
#: src/daemon/gnuserv.c:450
|
||||
msgid "NO-DAEMON"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:451
|
||||
#: src/daemon/gnuserv.c:452
|
||||
msgid "Invoked from inetd"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:451
|
||||
#: src/daemon/gnuserv.c:452
|
||||
msgid "INETD"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:485
|
||||
#: src/daemon/gnuserv.c:486
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Error on option %s: %s.\n"
|
||||
|
24
po/es_GT.po
24
po/es_GT.po
@@ -6,7 +6,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"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"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -380,7 +380,7 @@ msgid "Number of pages of virtual memory"
|
||||
msgstr ""
|
||||
|
||||
#: sysdeps/names/procmem.c:55
|
||||
msgid "Number of residnet set (non-swapped) pages"
|
||||
msgid "Number of resident set (non-swapped) pages"
|
||||
msgstr ""
|
||||
|
||||
#: sysdeps/names/procmem.c:56
|
||||
@@ -992,7 +992,7 @@ msgstr ""
|
||||
msgid "%s: option `-W %s' doesn't allow an argument\n"
|
||||
msgstr ""
|
||||
|
||||
#: lib/read.c:71
|
||||
#: lib/read.c:75
|
||||
#, c-format
|
||||
msgid "read %d bytes"
|
||||
msgstr ""
|
||||
@@ -1011,39 +1011,39 @@ msgstr ""
|
||||
msgid "write %d bytes"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:445
|
||||
#: src/daemon/gnuserv.c:446
|
||||
msgid "Enable debugging"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:445
|
||||
#: src/daemon/gnuserv.c:446
|
||||
msgid "DEBUG"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:447
|
||||
#: src/daemon/gnuserv.c:448
|
||||
msgid "Enable verbose output"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:447
|
||||
#: src/daemon/gnuserv.c:448
|
||||
msgid "VERBOSE"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:449
|
||||
#: src/daemon/gnuserv.c:450
|
||||
msgid "Don't fork into background"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:449
|
||||
#: src/daemon/gnuserv.c:450
|
||||
msgid "NO-DAEMON"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:451
|
||||
#: src/daemon/gnuserv.c:452
|
||||
msgid "Invoked from inetd"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:451
|
||||
#: src/daemon/gnuserv.c:452
|
||||
msgid "INETD"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:485
|
||||
#: src/daemon/gnuserv.c:486
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Error on option %s: %s.\n"
|
||||
|
24
po/es_HN.po
24
po/es_HN.po
@@ -6,7 +6,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"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"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -380,7 +380,7 @@ msgid "Number of pages of virtual memory"
|
||||
msgstr ""
|
||||
|
||||
#: sysdeps/names/procmem.c:55
|
||||
msgid "Number of residnet set (non-swapped) pages"
|
||||
msgid "Number of resident set (non-swapped) pages"
|
||||
msgstr ""
|
||||
|
||||
#: sysdeps/names/procmem.c:56
|
||||
@@ -992,7 +992,7 @@ msgstr ""
|
||||
msgid "%s: option `-W %s' doesn't allow an argument\n"
|
||||
msgstr ""
|
||||
|
||||
#: lib/read.c:71
|
||||
#: lib/read.c:75
|
||||
#, c-format
|
||||
msgid "read %d bytes"
|
||||
msgstr ""
|
||||
@@ -1011,39 +1011,39 @@ msgstr ""
|
||||
msgid "write %d bytes"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:445
|
||||
#: src/daemon/gnuserv.c:446
|
||||
msgid "Enable debugging"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:445
|
||||
#: src/daemon/gnuserv.c:446
|
||||
msgid "DEBUG"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:447
|
||||
#: src/daemon/gnuserv.c:448
|
||||
msgid "Enable verbose output"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:447
|
||||
#: src/daemon/gnuserv.c:448
|
||||
msgid "VERBOSE"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:449
|
||||
#: src/daemon/gnuserv.c:450
|
||||
msgid "Don't fork into background"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:449
|
||||
#: src/daemon/gnuserv.c:450
|
||||
msgid "NO-DAEMON"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:451
|
||||
#: src/daemon/gnuserv.c:452
|
||||
msgid "Invoked from inetd"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:451
|
||||
#: src/daemon/gnuserv.c:452
|
||||
msgid "INETD"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:485
|
||||
#: src/daemon/gnuserv.c:486
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Error on option %s: %s.\n"
|
||||
|
24
po/es_MX.po
24
po/es_MX.po
@@ -6,7 +6,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"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"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -380,7 +380,7 @@ msgid "Number of pages of virtual memory"
|
||||
msgstr ""
|
||||
|
||||
#: sysdeps/names/procmem.c:55
|
||||
msgid "Number of residnet set (non-swapped) pages"
|
||||
msgid "Number of resident set (non-swapped) pages"
|
||||
msgstr ""
|
||||
|
||||
#: sysdeps/names/procmem.c:56
|
||||
@@ -992,7 +992,7 @@ msgstr ""
|
||||
msgid "%s: option `-W %s' doesn't allow an argument\n"
|
||||
msgstr ""
|
||||
|
||||
#: lib/read.c:71
|
||||
#: lib/read.c:75
|
||||
#, c-format
|
||||
msgid "read %d bytes"
|
||||
msgstr ""
|
||||
@@ -1011,39 +1011,39 @@ msgstr ""
|
||||
msgid "write %d bytes"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:445
|
||||
#: src/daemon/gnuserv.c:446
|
||||
msgid "Enable debugging"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:445
|
||||
#: src/daemon/gnuserv.c:446
|
||||
msgid "DEBUG"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:447
|
||||
#: src/daemon/gnuserv.c:448
|
||||
msgid "Enable verbose output"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:447
|
||||
#: src/daemon/gnuserv.c:448
|
||||
msgid "VERBOSE"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:449
|
||||
#: src/daemon/gnuserv.c:450
|
||||
msgid "Don't fork into background"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:449
|
||||
#: src/daemon/gnuserv.c:450
|
||||
msgid "NO-DAEMON"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:451
|
||||
#: src/daemon/gnuserv.c:452
|
||||
msgid "Invoked from inetd"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:451
|
||||
#: src/daemon/gnuserv.c:452
|
||||
msgid "INETD"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:485
|
||||
#: src/daemon/gnuserv.c:486
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Error on option %s: %s.\n"
|
||||
|
24
po/es_PA.po
24
po/es_PA.po
@@ -6,7 +6,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"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"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -380,7 +380,7 @@ msgid "Number of pages of virtual memory"
|
||||
msgstr ""
|
||||
|
||||
#: sysdeps/names/procmem.c:55
|
||||
msgid "Number of residnet set (non-swapped) pages"
|
||||
msgid "Number of resident set (non-swapped) pages"
|
||||
msgstr ""
|
||||
|
||||
#: sysdeps/names/procmem.c:56
|
||||
@@ -992,7 +992,7 @@ msgstr ""
|
||||
msgid "%s: option `-W %s' doesn't allow an argument\n"
|
||||
msgstr ""
|
||||
|
||||
#: lib/read.c:71
|
||||
#: lib/read.c:75
|
||||
#, c-format
|
||||
msgid "read %d bytes"
|
||||
msgstr ""
|
||||
@@ -1011,39 +1011,39 @@ msgstr ""
|
||||
msgid "write %d bytes"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:445
|
||||
#: src/daemon/gnuserv.c:446
|
||||
msgid "Enable debugging"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:445
|
||||
#: src/daemon/gnuserv.c:446
|
||||
msgid "DEBUG"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:447
|
||||
#: src/daemon/gnuserv.c:448
|
||||
msgid "Enable verbose output"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:447
|
||||
#: src/daemon/gnuserv.c:448
|
||||
msgid "VERBOSE"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:449
|
||||
#: src/daemon/gnuserv.c:450
|
||||
msgid "Don't fork into background"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:449
|
||||
#: src/daemon/gnuserv.c:450
|
||||
msgid "NO-DAEMON"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:451
|
||||
#: src/daemon/gnuserv.c:452
|
||||
msgid "Invoked from inetd"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:451
|
||||
#: src/daemon/gnuserv.c:452
|
||||
msgid "INETD"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:485
|
||||
#: src/daemon/gnuserv.c:486
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Error on option %s: %s.\n"
|
||||
|
24
po/es_PE.po
24
po/es_PE.po
@@ -6,7 +6,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"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"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -380,7 +380,7 @@ msgid "Number of pages of virtual memory"
|
||||
msgstr ""
|
||||
|
||||
#: sysdeps/names/procmem.c:55
|
||||
msgid "Number of residnet set (non-swapped) pages"
|
||||
msgid "Number of resident set (non-swapped) pages"
|
||||
msgstr ""
|
||||
|
||||
#: sysdeps/names/procmem.c:56
|
||||
@@ -992,7 +992,7 @@ msgstr ""
|
||||
msgid "%s: option `-W %s' doesn't allow an argument\n"
|
||||
msgstr ""
|
||||
|
||||
#: lib/read.c:71
|
||||
#: lib/read.c:75
|
||||
#, c-format
|
||||
msgid "read %d bytes"
|
||||
msgstr ""
|
||||
@@ -1011,39 +1011,39 @@ msgstr ""
|
||||
msgid "write %d bytes"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:445
|
||||
#: src/daemon/gnuserv.c:446
|
||||
msgid "Enable debugging"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:445
|
||||
#: src/daemon/gnuserv.c:446
|
||||
msgid "DEBUG"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:447
|
||||
#: src/daemon/gnuserv.c:448
|
||||
msgid "Enable verbose output"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:447
|
||||
#: src/daemon/gnuserv.c:448
|
||||
msgid "VERBOSE"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:449
|
||||
#: src/daemon/gnuserv.c:450
|
||||
msgid "Don't fork into background"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:449
|
||||
#: src/daemon/gnuserv.c:450
|
||||
msgid "NO-DAEMON"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:451
|
||||
#: src/daemon/gnuserv.c:452
|
||||
msgid "Invoked from inetd"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:451
|
||||
#: src/daemon/gnuserv.c:452
|
||||
msgid "INETD"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:485
|
||||
#: src/daemon/gnuserv.c:486
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Error on option %s: %s.\n"
|
||||
|
24
po/es_SV.po
24
po/es_SV.po
@@ -6,7 +6,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"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"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -380,7 +380,7 @@ msgid "Number of pages of virtual memory"
|
||||
msgstr ""
|
||||
|
||||
#: sysdeps/names/procmem.c:55
|
||||
msgid "Number of residnet set (non-swapped) pages"
|
||||
msgid "Number of resident set (non-swapped) pages"
|
||||
msgstr ""
|
||||
|
||||
#: sysdeps/names/procmem.c:56
|
||||
@@ -992,7 +992,7 @@ msgstr ""
|
||||
msgid "%s: option `-W %s' doesn't allow an argument\n"
|
||||
msgstr ""
|
||||
|
||||
#: lib/read.c:71
|
||||
#: lib/read.c:75
|
||||
#, c-format
|
||||
msgid "read %d bytes"
|
||||
msgstr ""
|
||||
@@ -1011,39 +1011,39 @@ msgstr ""
|
||||
msgid "write %d bytes"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:445
|
||||
#: src/daemon/gnuserv.c:446
|
||||
msgid "Enable debugging"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:445
|
||||
#: src/daemon/gnuserv.c:446
|
||||
msgid "DEBUG"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:447
|
||||
#: src/daemon/gnuserv.c:448
|
||||
msgid "Enable verbose output"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:447
|
||||
#: src/daemon/gnuserv.c:448
|
||||
msgid "VERBOSE"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:449
|
||||
#: src/daemon/gnuserv.c:450
|
||||
msgid "Don't fork into background"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:449
|
||||
#: src/daemon/gnuserv.c:450
|
||||
msgid "NO-DAEMON"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:451
|
||||
#: src/daemon/gnuserv.c:452
|
||||
msgid "Invoked from inetd"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:451
|
||||
#: src/daemon/gnuserv.c:452
|
||||
msgid "INETD"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:485
|
||||
#: src/daemon/gnuserv.c:486
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Error on option %s: %s.\n"
|
||||
|
25
po/ja.po
25
po/ja.po
@@ -4,7 +4,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"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"
|
||||
"Last-Translator: Eiichiro ITANI <emu@ceres.dti.ne.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>"
|
||||
|
||||
#: 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>"
|
||||
|
||||
#: sysdeps/names/procmem.c:56
|
||||
@@ -1004,7 +1005,7 @@ msgstr ""
|
||||
msgid "%s: option `-W %s' doesn't allow an argument\n"
|
||||
msgstr ""
|
||||
|
||||
#: lib/read.c:71
|
||||
#: lib/read.c:75
|
||||
#, c-format
|
||||
msgid "read %d bytes"
|
||||
msgstr ""
|
||||
@@ -1023,39 +1024,39 @@ msgstr ""
|
||||
msgid "write %d bytes"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:445
|
||||
#: src/daemon/gnuserv.c:446
|
||||
msgid "Enable debugging"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:445
|
||||
#: src/daemon/gnuserv.c:446
|
||||
msgid "DEBUG"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:447
|
||||
#: src/daemon/gnuserv.c:448
|
||||
msgid "Enable verbose output"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:447
|
||||
#: src/daemon/gnuserv.c:448
|
||||
msgid "VERBOSE"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:449
|
||||
#: src/daemon/gnuserv.c:450
|
||||
msgid "Don't fork into background"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:449
|
||||
#: src/daemon/gnuserv.c:450
|
||||
msgid "NO-DAEMON"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:451
|
||||
#: src/daemon/gnuserv.c:452
|
||||
msgid "Invoked from inetd"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:451
|
||||
#: src/daemon/gnuserv.c:452
|
||||
msgid "INETD"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:485
|
||||
#: src/daemon/gnuserv.c:486
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Error on option %s: %s.\n"
|
||||
|
24
po/ko.po
24
po/ko.po
@@ -5,7 +5,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"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"
|
||||
"Last-Translator: Sung-Hyun Nam <namsh@lgic.co.kr>\n"
|
||||
"Language-Team: Korean <ko@li.org>\n"
|
||||
@@ -379,7 +379,7 @@ msgid "Number of pages of virtual memory"
|
||||
msgstr ""
|
||||
|
||||
#: sysdeps/names/procmem.c:55
|
||||
msgid "Number of residnet set (non-swapped) pages"
|
||||
msgid "Number of resident set (non-swapped) pages"
|
||||
msgstr ""
|
||||
|
||||
#: sysdeps/names/procmem.c:56
|
||||
@@ -980,7 +980,7 @@ msgstr "%s: `-W %s'
|
||||
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"
|
||||
|
||||
#: lib/read.c:71
|
||||
#: lib/read.c:75
|
||||
#, c-format
|
||||
msgid "read %d bytes"
|
||||
msgstr ""
|
||||
@@ -999,39 +999,39 @@ msgstr ""
|
||||
msgid "write %d bytes"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:445
|
||||
#: src/daemon/gnuserv.c:446
|
||||
msgid "Enable debugging"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:445
|
||||
#: src/daemon/gnuserv.c:446
|
||||
msgid "DEBUG"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:447
|
||||
#: src/daemon/gnuserv.c:448
|
||||
msgid "Enable verbose output"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:447
|
||||
#: src/daemon/gnuserv.c:448
|
||||
msgid "VERBOSE"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:449
|
||||
#: src/daemon/gnuserv.c:450
|
||||
msgid "Don't fork into background"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:449
|
||||
#: src/daemon/gnuserv.c:450
|
||||
msgid "NO-DAEMON"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:451
|
||||
#: src/daemon/gnuserv.c:452
|
||||
msgid "Invoked from inetd"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:451
|
||||
#: src/daemon/gnuserv.c:452
|
||||
msgid "INETD"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:485
|
||||
#: src/daemon/gnuserv.c:486
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Error on option %s: %s.\n"
|
||||
|
30
po/no.po
30
po/no.po
@@ -1,13 +1,13 @@
|
||||
# Norwegian translation for Libgtop (bokm<6B>l dialect)
|
||||
# Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
# Kjartan Maraas <kmaraas@fib.hl.no>, 1998,1999.
|
||||
# Kjartan Maraas <kmaraas@online.no>, 1998,1999.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libgtop 0.99.3\n"
|
||||
"POT-Creation-Date: 1999-02-27 22:24+0100\n"
|
||||
"PO-Revision-Date: 1999-01-27 23:22+0100\n"
|
||||
"Last-Translator: Kjartan Maraas <kmaraas@fib.hl.no>\n"
|
||||
"POT-Creation-Date: 1999-09-16 23:16+0200\n"
|
||||
"PO-Revision-Date: 1999-07-11 14:25+0200\n"
|
||||
"Last-Translator: Kjartan Maraas <kmaraas@online.no>\n"
|
||||
"Language-Team: Norwegian <no@li.org>\n"
|
||||
"MIME-Version: 1.0\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"
|
||||
|
||||
#: 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"
|
||||
|
||||
#: 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"
|
||||
msgstr "%s: flagget `-W %s' tar ikke argumenter\n"
|
||||
|
||||
#: lib/read.c:71
|
||||
#: lib/read.c:75
|
||||
#, c-format
|
||||
msgid "read %d bytes"
|
||||
msgstr "les %d bytes"
|
||||
@@ -1023,39 +1023,39 @@ msgstr "les data %d bytes"
|
||||
msgid "write %d bytes"
|
||||
msgstr "skriv %d bytes"
|
||||
|
||||
#: src/daemon/gnuserv.c:445
|
||||
#: src/daemon/gnuserv.c:446
|
||||
msgid "Enable debugging"
|
||||
msgstr "Sl<53> p<> avlusing"
|
||||
|
||||
#: src/daemon/gnuserv.c:445
|
||||
#: src/daemon/gnuserv.c:446
|
||||
msgid "DEBUG"
|
||||
msgstr "DEBUG"
|
||||
|
||||
#: src/daemon/gnuserv.c:447
|
||||
#: src/daemon/gnuserv.c:448
|
||||
msgid "Enable verbose output"
|
||||
msgstr "Sl<53> p<> utfyllende utskrift"
|
||||
|
||||
#: src/daemon/gnuserv.c:447
|
||||
#: src/daemon/gnuserv.c:448
|
||||
msgid "VERBOSE"
|
||||
msgstr "VERBOSE"
|
||||
|
||||
#: src/daemon/gnuserv.c:449
|
||||
#: src/daemon/gnuserv.c:450
|
||||
msgid "Don't fork into background"
|
||||
msgstr "Ikke forgren til bakgrunnen"
|
||||
|
||||
#: src/daemon/gnuserv.c:449
|
||||
#: src/daemon/gnuserv.c:450
|
||||
msgid "NO-DAEMON"
|
||||
msgstr "NO-DAEMON"
|
||||
|
||||
#: src/daemon/gnuserv.c:451
|
||||
#: src/daemon/gnuserv.c:452
|
||||
msgid "Invoked from inetd"
|
||||
msgstr "Kalt fra inetd"
|
||||
|
||||
#: src/daemon/gnuserv.c:451
|
||||
#: src/daemon/gnuserv.c:452
|
||||
msgid "INETD"
|
||||
msgstr "INETD"
|
||||
|
||||
#: src/daemon/gnuserv.c:485
|
||||
#: src/daemon/gnuserv.c:486
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Error on option %s: %s.\n"
|
||||
|
@@ -1,6 +1,7 @@
|
||||
Makefile.in
|
||||
Makefile
|
||||
libgtop_daemon
|
||||
libgtop_server
|
||||
server.conf
|
||||
.libs
|
||||
.deps
|
||||
|
@@ -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>
|
||||
|
||||
* Makefile.am (LIBGTOP_COMPILE_SYSTEM): Hardcoded system name.
|
||||
|
@@ -41,11 +41,19 @@ libgtop_daemon_LDADD = $(top_builddir)/lib/libgtop.la \
|
||||
$(GLIB_LIBS)\
|
||||
@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_LDADD = $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps_suid.la \
|
||||
$(top_builddir)/sysdeps/common/libgtop_suid_common.la \
|
||||
@LIBSUPPORT@
|
||||
|
||||
if ENABLE_STATIC
|
||||
libgtop_server_LDFLAGS = -static
|
||||
endif
|
||||
|
||||
EXTRA_DIST = server_config.h.in server_config.pl
|
||||
|
||||
install-exec-hook:
|
||||
|
@@ -219,7 +219,7 @@ permitted (u_long host_addr, int fd)
|
||||
* GNU_SECURE protocol....
|
||||
*/
|
||||
|
||||
if (verbose_output)
|
||||
if (verbose_output) {
|
||||
if (changed_uid || invoked_from_inetd)
|
||||
syslog_message (LOG_WARNING,
|
||||
"Xauth authentication not allowed, "
|
||||
@@ -228,6 +228,7 @@ permitted (u_long host_addr, int fd)
|
||||
syslog_message (LOG_WARNING,
|
||||
"Xauth authentication failed, "
|
||||
"trying GNU_SECURE auth...");
|
||||
}
|
||||
}
|
||||
|
||||
/* Other auth protocols go here, and should execute only if
|
||||
@@ -243,7 +244,7 @@ permitted (u_long host_addr, int fd)
|
||||
if (enable_debug)
|
||||
syslog_message (LOG_DEBUG, "Trying %lx - %lx",
|
||||
host_addr, permitted_hosts [i]);
|
||||
if (permitted_hosts [i] == NULL)
|
||||
if (permitted_hosts [i] == 0L)
|
||||
return (FALSE);
|
||||
if (host_addr == permitted_hosts [i])
|
||||
return (TRUE);
|
||||
|
@@ -62,6 +62,7 @@ int
|
||||
do_read (int s, void *ptr, size_t total_size)
|
||||
{
|
||||
int nread;
|
||||
char *tmp_ptr;
|
||||
size_t already_read = 0, remaining = total_size;
|
||||
|
||||
while (already_read < total_size) {
|
||||
@@ -82,7 +83,10 @@ do_read (int s, void *ptr, size_t total_size)
|
||||
|
||||
already_read += nread;
|
||||
remaining -= nread;
|
||||
(char *) ptr += nread;
|
||||
/* (char *) ptr += nread; */
|
||||
tmp_ptr = ptr;
|
||||
tmp_ptr += nread;
|
||||
ptr = tmp_ptr;
|
||||
|
||||
#ifdef REAL_DEBUG
|
||||
fprintf (stderr, "READ (%d): %d - %d - %d\n",
|
||||
|
@@ -68,7 +68,7 @@ main(int argc, char *argv[])
|
||||
uid = getuid (); euid = geteuid ();
|
||||
gid = getgid (); egid = getegid ();
|
||||
|
||||
if (uname (&uts)) _exit (1);
|
||||
if (uname (&uts) < 0) _exit (1);
|
||||
|
||||
if (strcmp (uts.sysname, LIBGTOP_COMPILE_SYSTEM) ||
|
||||
strcmp (uts.release, LIBGTOP_COMPILE_RELEASE) ||
|
||||
|
@@ -26,12 +26,12 @@
|
||||
void
|
||||
handle_slave_connection (int input, int output)
|
||||
{
|
||||
glibtop *server = glibtop_global_server;
|
||||
int64_t *param_ptr;
|
||||
const void *ptr;
|
||||
glibtop *server G_GNUC_UNUSED = glibtop_global_server;
|
||||
int64_t *param_ptr G_GNUC_UNUSED;
|
||||
const void *ptr G_GNUC_UNUSED;
|
||||
|
||||
unsigned short max_len;
|
||||
pid_t pid;
|
||||
unsigned short max_len G_GNUC_UNUSED;
|
||||
pid_t pid G_GNUC_UNUSED;
|
||||
|
||||
glibtop_response _resp, *resp = &_resp;
|
||||
glibtop_command _cmnd, *cmnd = &_cmnd;
|
||||
@@ -119,8 +119,8 @@ handle_slave_command (glibtop_command *cmnd, glibtop_response *resp,
|
||||
const void *parameter)
|
||||
{
|
||||
glibtop *server = glibtop_global_server;
|
||||
unsigned device;
|
||||
pid_t pid;
|
||||
unsigned device G_GNUC_UNUSED;
|
||||
pid_t pid G_GNUC_UNUSED;
|
||||
|
||||
switch (cmnd->command) {
|
||||
case GLIBTOP_CMND_SYSDEPS:
|
||||
@@ -128,7 +128,7 @@ handle_slave_command (glibtop_command *cmnd, glibtop_response *resp,
|
||||
sizeof (glibtop_sysdeps));
|
||||
resp->u.sysdeps.features = glibtop_server_features;
|
||||
resp->u.sysdeps.flags = glibtop_server_features |
|
||||
(1 << GLIBTOP_SYSDEPS_FEATURES);
|
||||
(1L << GLIBTOP_SYSDEPS_FEATURES);
|
||||
resp->offset = _offset_union (sysdeps);
|
||||
break;
|
||||
#if GLIBTOP_SUID_CPU
|
||||
|
@@ -2,24 +2,5 @@
|
||||
.libs
|
||||
Makefile
|
||||
Makefile.in
|
||||
close.lo
|
||||
cpu.lo
|
||||
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
|
||||
*.lo
|
||||
*.la
|
||||
|
@@ -1 +1,2 @@
|
||||
Josh Sled <jsled@scam.XCF.Berkeley.EDU>
|
||||
Martin Baulig (martin@home-of-linux.org)
|
||||
Josh Sled (jsled@scam.XCF.Berkeley.EDU)
|
||||
|
@@ -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>
|
||||
|
||||
* prockernel.c, proctime.c: Applied patch Stanislav Grozev for
|
||||
|
@@ -28,13 +28,17 @@
|
||||
#include <glibtop_suid.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_cpu =
|
||||
(1 << GLIBTOP_CPU_TOTAL) + (1 << GLIBTOP_CPU_USER) +
|
||||
(1 << GLIBTOP_CPU_NICE) + (1 << GLIBTOP_CPU_SYS) +
|
||||
(1 << GLIBTOP_CPU_IDLE) + (1 << GLIBTOP_CPU_FREQUENCY);
|
||||
(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_USER) +
|
||||
(1L << GLIBTOP_CPU_NICE) + (1L << GLIBTOP_CPU_SYS) +
|
||||
(1L << GLIBTOP_CPU_IDLE) + (1L << GLIBTOP_CPU_FREQUENCY);
|
||||
|
||||
/* nlist structure for kernel access */
|
||||
static struct nlist nlst [] = {
|
||||
#ifdef __bsdi__
|
||||
{ "_cpustats" },
|
||||
#else
|
||||
{ "_cp_time" },
|
||||
#endif
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
@@ -66,7 +70,7 @@ glibtop_get_cpu_p (glibtop *server, glibtop_cpu *buf)
|
||||
struct clockinfo ci;
|
||||
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));
|
||||
|
||||
|
@@ -26,6 +26,10 @@
|
||||
|
||||
BEGIN_LIBGTOP_DECLS
|
||||
|
||||
#if _IN_LIBGTOP
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#define KI_PROC(ki) (&(ki))->kp_proc)
|
||||
#define KI_EPROC(ki) (&(ki))->kp_eproc)
|
||||
|
||||
|
@@ -28,7 +28,7 @@
|
||||
#include <glibtop_suid.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_loadavg =
|
||||
(1 << GLIBTOP_LOADAVG_LOADAVG);
|
||||
(1L << GLIBTOP_LOADAVG_LOADAVG);
|
||||
|
||||
/* Init function. */
|
||||
|
||||
@@ -46,7 +46,7 @@ glibtop_get_loadavg_p (glibtop *server, glibtop_loadavg *buf)
|
||||
double ldavg[3];
|
||||
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));
|
||||
|
||||
|
@@ -31,14 +31,19 @@
|
||||
#include <sys/vmmeter.h>
|
||||
#include <vm/vm_param.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_mem =
|
||||
(1 << GLIBTOP_MEM_TOTAL) + (1 << GLIBTOP_MEM_USED) +
|
||||
(1 << GLIBTOP_MEM_FREE) + (1 << GLIBTOP_MEM_SHARED) +
|
||||
(1 << GLIBTOP_MEM_BUFFER) +
|
||||
#ifdef __FreeBSD__
|
||||
(1 << GLIBTOP_MEM_CACHED) +
|
||||
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
|
||||
#include <uvm/uvm_extern.h>
|
||||
#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
|
||||
#define LOG1024 10
|
||||
@@ -52,18 +57,33 @@ static int pageshift; /* log base 2 of the pagesize */
|
||||
|
||||
/* nlist structure for kernel access */
|
||||
static struct nlist nlst [] = {
|
||||
{ "_cnt" },
|
||||
#ifdef __FreeBSD__
|
||||
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
|
||||
{ "_bufpages" },
|
||||
{ 0 }
|
||||
#else
|
||||
#if defined(__bsdi__)
|
||||
{ "_bufcachemem" },
|
||||
#elif defined(__FreeBSD__)
|
||||
{ "_bufspace" },
|
||||
#else
|
||||
{ "_bufpages" },
|
||||
#endif
|
||||
{ "_cnt" },
|
||||
{ 0 }
|
||||
#endif
|
||||
};
|
||||
|
||||
/* 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 };
|
||||
#endif
|
||||
|
||||
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
|
||||
static int mib_uvmexp [] = { CTL_VM, VM_UVMEXP };
|
||||
#endif
|
||||
|
||||
/* Init function. */
|
||||
|
||||
@@ -97,12 +117,18 @@ glibtop_get_mem_p (glibtop *server, glibtop_mem *buf)
|
||||
{
|
||||
struct vmtotal vmt;
|
||||
size_t length_vmt;
|
||||
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
|
||||
struct uvmexp uvmexp;
|
||||
size_t length_uvmexp;
|
||||
#else
|
||||
struct vmmeter vmm;
|
||||
#endif
|
||||
u_int v_used_count;
|
||||
u_int v_total_count;
|
||||
u_int v_free_count;
|
||||
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));
|
||||
|
||||
@@ -116,18 +142,26 @@ glibtop_get_mem_p (glibtop *server, glibtop_mem *buf)
|
||||
/* Get the data from sysctl */
|
||||
length_vmt = sizeof (vmt);
|
||||
if (sysctl (mib, 2, &vmt, &length_vmt, NULL, 0)) {
|
||||
glibtop_warn_io_r (server, "sysctl");
|
||||
glibtop_warn_io_r (server, "sysctl (vmt)");
|
||||
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_* */
|
||||
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)) {
|
||||
glibtop_warn_io_r (server, "kvm_read (cnt)");
|
||||
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)) {
|
||||
glibtop_warn_io_r (server, "kvm_read (bufspace)");
|
||||
return;
|
||||
@@ -135,25 +169,43 @@ glibtop_get_mem_p (glibtop *server, glibtop_mem *buf)
|
||||
|
||||
/* convert memory stats to Kbytes */
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#if defined(__FreeBSD__)
|
||||
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
|
||||
v_total_count = vmm.v_kernel_pages +
|
||||
vmm.v_free_count + vmm.v_wire_count +
|
||||
vmm.v_active_count + vmm.v_inactive_count;
|
||||
#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_free_count = vmm.v_free_count;
|
||||
#endif
|
||||
|
||||
buf->total = (u_int64_t) pagetok (v_total_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__
|
||||
buf->cached = (u_int64_t) pagetok (vmm.v_cache_count) << LOG1024;
|
||||
#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;
|
||||
#endif
|
||||
|
||||
buf->shared = (u_int64_t) pagetok (vmt.t_rmshr) << LOG1024;
|
||||
|
||||
#if __FreeBSD__
|
||||
|
@@ -27,9 +27,26 @@
|
||||
|
||||
#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'. */
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#if (defined __FreeBSD__) || (defined __bsdi__)
|
||||
#define KERNEL 1
|
||||
#else
|
||||
#define _KERNEL 1
|
||||
@@ -39,9 +56,9 @@
|
||||
#include <sys/msg.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_msg_limits =
|
||||
(1 << GLIBTOP_IPC_MSGMAX) + (1 << GLIBTOP_IPC_MSGMNI) +
|
||||
(1 << GLIBTOP_IPC_MSGMNB) + (1 << GLIBTOP_IPC_MSGTQL) +
|
||||
(1 << GLIBTOP_IPC_MSGSSZ);
|
||||
(1L << GLIBTOP_IPC_MSGMAX) + (1L << GLIBTOP_IPC_MSGMNI) +
|
||||
(1L << GLIBTOP_IPC_MSGMNB) + (1L << GLIBTOP_IPC_MSGTQL) +
|
||||
(1L << GLIBTOP_IPC_MSGSSZ);
|
||||
|
||||
/* The values in this structure never change at runtime, so we only
|
||||
* read it once during initialization. We have to use the name `_msginfo'
|
||||
@@ -78,7 +95,7 @@ glibtop_init_msg_limits_p (glibtop *server)
|
||||
void
|
||||
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));
|
||||
|
||||
@@ -93,3 +110,6 @@ glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf)
|
||||
|
||||
buf->flags = _glibtop_sysdeps_msg_limits;
|
||||
}
|
||||
|
||||
#endif /* either a newer BSDI or no BSDI at all. */
|
||||
|
||||
|
@@ -39,20 +39,20 @@
|
||||
#include <netinet/in_var.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_netload =
|
||||
(1 << GLIBTOP_NETLOAD_IF_FLAGS) +
|
||||
(1 << GLIBTOP_NETLOAD_MTU) +
|
||||
(1 << GLIBTOP_NETLOAD_SUBNET) +
|
||||
(1 << GLIBTOP_NETLOAD_ADDRESS) +
|
||||
(1 << GLIBTOP_NETLOAD_PACKETS_IN) +
|
||||
(1 << GLIBTOP_NETLOAD_PACKETS_OUT) +
|
||||
(1 << GLIBTOP_NETLOAD_PACKETS_TOTAL) +
|
||||
(1 << GLIBTOP_NETLOAD_BYTES_IN) +
|
||||
(1 << GLIBTOP_NETLOAD_BYTES_OUT) +
|
||||
(1 << GLIBTOP_NETLOAD_BYTES_TOTAL) +
|
||||
(1 << GLIBTOP_NETLOAD_ERRORS_IN) +
|
||||
(1 << GLIBTOP_NETLOAD_ERRORS_OUT) +
|
||||
(1 << GLIBTOP_NETLOAD_ERRORS_TOTAL) +
|
||||
(1 << GLIBTOP_NETLOAD_COLLISIONS);
|
||||
(1L << GLIBTOP_NETLOAD_IF_FLAGS) +
|
||||
(1L << GLIBTOP_NETLOAD_MTU) +
|
||||
(1L << GLIBTOP_NETLOAD_SUBNET) +
|
||||
(1L << GLIBTOP_NETLOAD_ADDRESS) +
|
||||
(1L << GLIBTOP_NETLOAD_PACKETS_IN) +
|
||||
(1L << GLIBTOP_NETLOAD_PACKETS_OUT) +
|
||||
(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) +
|
||||
(1L << GLIBTOP_NETLOAD_BYTES_IN) +
|
||||
(1L << GLIBTOP_NETLOAD_BYTES_OUT) +
|
||||
(1L << GLIBTOP_NETLOAD_BYTES_TOTAL) +
|
||||
(1L << GLIBTOP_NETLOAD_ERRORS_IN) +
|
||||
(1L << GLIBTOP_NETLOAD_ERRORS_OUT) +
|
||||
(1L << GLIBTOP_NETLOAD_ERRORS_TOTAL) +
|
||||
(1L << GLIBTOP_NETLOAD_COLLISIONS);
|
||||
|
||||
/* nlist structure for kernel access */
|
||||
static struct nlist nlst [] = {
|
||||
@@ -87,7 +87,7 @@ glibtop_get_netload_p (glibtop *server, glibtop_netload *buf,
|
||||
struct in_ifaddr in;
|
||||
} 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));
|
||||
|
||||
@@ -107,7 +107,7 @@ glibtop_get_netload_p (glibtop *server, glibtop_netload *buf,
|
||||
sizeof (ifnet)) != sizeof (ifnet))
|
||||
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,
|
||||
tname, 16) != 16)
|
||||
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;
|
||||
#endif
|
||||
|
||||
#if (defined __FreeBSD__) && (__FreeBSD_version >= 300000)
|
||||
#if defined(__FreeBSD__) && (__FreeBSD_version >= 300000)
|
||||
ifaddraddr = (u_long) ifnet.if_addrhead.tqh_first;
|
||||
#elif (defined __FreeBSD__)
|
||||
#elif defined(__FreeBSD__) || defined(__bsdi__)
|
||||
ifaddraddr = (u_long) ifnet.if_addrlist;
|
||||
#else
|
||||
ifaddraddr = (u_long) ifnet.if_addrlist.tqh_first;
|
||||
@@ -194,18 +194,18 @@ glibtop_get_netload_p (glibtop *server, glibtop_netload *buf,
|
||||
return;
|
||||
}
|
||||
|
||||
#if (defined __FreeBSD__) && (__FreeBSD_version >= 300000)
|
||||
#if defined(__FreeBSD__) && (__FreeBSD_version >= 300000)
|
||||
ifaddraddr = (u_long)ifaddr.ifa.ifa_link.tqe_next;
|
||||
#elif (defined __FreeBSD__)
|
||||
#elif defined(__FreeBSD__) || defined(__bsdi__)
|
||||
ifaddraddr = (u_long)ifaddr.ifa.ifa_next;
|
||||
#else
|
||||
ifaddraddr = (u_long)ifaddr.ifa.ifa_list.tqe_next;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if (defined __FreeBSD__) && (__FreeBSD_version >= 300000)
|
||||
#if defined(__FreeBSD__) && (__FreeBSD_version >= 300000)
|
||||
ifnetaddr = (u_long) ifnet.if_link.tqe_next;
|
||||
#elif (defined __FreeBSD__)
|
||||
#elif defined(__FreeBSD__) || defined(__bsdi__)
|
||||
ifnetaddr = (u_long) ifnet.if_next;
|
||||
#else
|
||||
ifnetaddr = (u_long) ifnet.if_list.tqe_next;
|
||||
|
@@ -39,7 +39,7 @@
|
||||
#include <net/netisr.h>
|
||||
#include <net/route.h>
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__)
|
||||
#include <net/if_sppp.h>
|
||||
#else
|
||||
#include <i4b/sppp/if_sppp.h>
|
||||
@@ -51,11 +51,11 @@
|
||||
#endif
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_ppp =
|
||||
(1 << GLIBTOP_PPP_STATE);
|
||||
(1L << GLIBTOP_PPP_STATE);
|
||||
|
||||
#ifdef HAVE_I4B_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 /* HAVE_I4B */
|
||||
@@ -99,7 +99,7 @@ glibtop_get_ppp_p (glibtop *server, glibtop_ppp *buf, unsigned short device)
|
||||
#endif
|
||||
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));
|
||||
|
||||
@@ -110,10 +110,15 @@ glibtop_get_ppp_p (glibtop *server, glibtop_ppp *buf, unsigned short device)
|
||||
#ifdef HAVE_I4B_ACCT
|
||||
phase = data.sc_if_un.scu_sp.pp_phase;
|
||||
#else
|
||||
/* FIXME: Which FreeBSD version have this field and
|
||||
* which not. */
|
||||
#if 0
|
||||
phase = data.pp_phase;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
switch (phase) {
|
||||
#ifdef HAVE_I4B_ACCT
|
||||
case PHASE_DEAD:
|
||||
case PHASE_TERMINATE:
|
||||
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:
|
||||
buf->state = GLIBTOP_PPP_STATE_ONLINE;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
buf->state = GLIBTOP_PPP_STATE_UNKNOWN;
|
||||
break;
|
||||
|
@@ -33,7 +33,7 @@
|
||||
#include <sys/proc.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_proc_args =
|
||||
(1 << GLIBTOP_PROC_ARGS_SIZE);
|
||||
(1L << GLIBTOP_PROC_ARGS_SIZE);
|
||||
|
||||
/* Init function. */
|
||||
|
||||
@@ -54,18 +54,22 @@ glibtop_get_proc_args_p (glibtop *server, glibtop_proc_args *buf,
|
||||
unsigned size = 0, pos = 0;
|
||||
int count;
|
||||
|
||||
#ifndef __bsdi__
|
||||
char filename [BUFSIZ];
|
||||
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));
|
||||
|
||||
/* swapper, init, pagedaemon, vmdaemon, update - this doen't work. */
|
||||
if (pid < 5) return NULL;
|
||||
|
||||
#ifndef __bsdi__
|
||||
sprintf (filename, "/proc/%d/mem", pid);
|
||||
if (stat (filename, &statb)) return NULL;
|
||||
#endif
|
||||
|
||||
glibtop_suid_enter (server);
|
||||
|
||||
|
@@ -28,7 +28,7 @@
|
||||
|
||||
#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 =
|
||||
BIT_SHIFT(GLIBTOP_PROCDATA_CMD) +
|
||||
|
@@ -31,10 +31,12 @@
|
||||
#include <sys/param.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/proc.h>
|
||||
#ifndef __OpenBSD__
|
||||
#if (!defined __OpenBSD__) && (!defined __bsdi__)
|
||||
#include <sys/user.h>
|
||||
#endif
|
||||
#ifndef __bsdi__
|
||||
#include <machine/pcb.h>
|
||||
#endif
|
||||
#ifdef __FreeBSD__
|
||||
#include <machine/tss.h>
|
||||
#endif
|
||||
@@ -47,18 +49,18 @@
|
||||
#endif
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_proc_kernel_pstats =
|
||||
(1 << GLIBTOP_PROC_KERNEL_MIN_FLT) +
|
||||
(1 << GLIBTOP_PROC_KERNEL_MAJ_FLT) +
|
||||
(1 << GLIBTOP_PROC_KERNEL_CMIN_FLT) +
|
||||
(1 << GLIBTOP_PROC_KERNEL_CMAJ_FLT);
|
||||
(1L << GLIBTOP_PROC_KERNEL_MIN_FLT) +
|
||||
(1L << GLIBTOP_PROC_KERNEL_MAJ_FLT) +
|
||||
(1L << GLIBTOP_PROC_KERNEL_CMIN_FLT) +
|
||||
(1L << GLIBTOP_PROC_KERNEL_CMAJ_FLT);
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_proc_kernel_pcb =
|
||||
(1 << GLIBTOP_PROC_KERNEL_KSTK_EIP) +
|
||||
(1 << GLIBTOP_PROC_KERNEL_KSTK_ESP);
|
||||
(1L << GLIBTOP_PROC_KERNEL_KSTK_EIP) +
|
||||
(1L << GLIBTOP_PROC_KERNEL_KSTK_ESP);
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_proc_kernel_wchan =
|
||||
(1 << GLIBTOP_PROC_KERNEL_NWCHAN) +
|
||||
(1 << GLIBTOP_PROC_KERNEL_WCHAN);
|
||||
(1L << GLIBTOP_PROC_KERNEL_NWCHAN) +
|
||||
(1L << GLIBTOP_PROC_KERNEL_WCHAN);
|
||||
|
||||
/* Init function. */
|
||||
|
||||
@@ -84,7 +86,7 @@ glibtop_get_proc_kernel_p (glibtop *server,
|
||||
char filename [BUFSIZ];
|
||||
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));
|
||||
|
||||
@@ -100,13 +102,13 @@ glibtop_get_proc_kernel_p (glibtop *server,
|
||||
glibtop_error_io_r (server, "kvm_getprocs (%d)", pid);
|
||||
|
||||
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) {
|
||||
strncpy (buf->wchan, pinfo [0].kp_eproc.e_wmesg,
|
||||
sizeof (buf->wchan) - 1);
|
||||
buf->wchan [sizeof (buf->wchan) - 1] = 0;
|
||||
buf->flags |= (1 << GLIBTOP_PROC_KERNEL_WCHAN);
|
||||
buf->flags |= (1L << GLIBTOP_PROC_KERNEL_WCHAN);
|
||||
} else {
|
||||
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
|
||||
* `kvm_uread' work. */
|
||||
|
||||
sprintf (filename, "/proc/%d/mem", pid);
|
||||
sprintf (filename, "/proc/%d/mem", (int) pid);
|
||||
if (stat (filename, &statb)) return;
|
||||
|
||||
glibtop_suid_enter (server);
|
||||
@@ -162,7 +164,11 @@ glibtop_get_proc_kernel_p (glibtop *server,
|
||||
#endif
|
||||
#else
|
||||
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;
|
||||
#endif
|
||||
|
||||
buf->flags |= _glibtop_sysdeps_proc_kernel_pcb;
|
||||
#endif
|
||||
|
@@ -29,8 +29,8 @@
|
||||
#include <glibtop_suid.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_proclist =
|
||||
(1 << GLIBTOP_PROCLIST_TOTAL) + (1 << GLIBTOP_PROCLIST_NUMBER) +
|
||||
(1 << GLIBTOP_PROCLIST_SIZE);
|
||||
(1L << GLIBTOP_PROCLIST_TOTAL) + (1L << GLIBTOP_PROCLIST_NUMBER) +
|
||||
(1L << GLIBTOP_PROCLIST_SIZE);
|
||||
|
||||
/* Fetch list of currently running processes.
|
||||
* 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 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));
|
||||
|
||||
|
@@ -42,20 +42,28 @@
|
||||
#include <ufs/ufs/inode.h>
|
||||
|
||||
#include <sys/ucred.h>
|
||||
#ifndef __OpenBSD__
|
||||
#if (!defined __OpenBSD__) && (!defined __bsdi__)
|
||||
#include <sys/user.h>
|
||||
#endif
|
||||
#include <sys/sysctl.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 =
|
||||
(1 << GLIBTOP_PROC_MAP_TOTAL) + (1 << GLIBTOP_PROC_MAP_NUMBER) +
|
||||
(1 << GLIBTOP_PROC_MAP_SIZE);
|
||||
(1L << GLIBTOP_PROC_MAP_TOTAL) + (1L << GLIBTOP_PROC_MAP_NUMBER) +
|
||||
(1L << GLIBTOP_PROC_MAP_SIZE);
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_map_entry =
|
||||
(1 << GLIBTOP_MAP_ENTRY_START) + (1 << GLIBTOP_MAP_ENTRY_END) +
|
||||
(1 << GLIBTOP_MAP_ENTRY_OFFSET) + (1 << GLIBTOP_MAP_ENTRY_PERM) +
|
||||
(1 << GLIBTOP_MAP_ENTRY_INODE) + (1 << GLIBTOP_MAP_ENTRY_DEVICE);
|
||||
(1L << GLIBTOP_MAP_ENTRY_START) + (1L << GLIBTOP_MAP_ENTRY_END) +
|
||||
(1L << GLIBTOP_MAP_ENTRY_OFFSET) + (1L << GLIBTOP_MAP_ENTRY_PERM) +
|
||||
(1L << GLIBTOP_MAP_ENTRY_INODE) + (1L << GLIBTOP_MAP_ENTRY_DEVICE);
|
||||
|
||||
/* Init function. */
|
||||
|
||||
@@ -74,15 +82,22 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf,
|
||||
struct kinfo_proc *pinfo;
|
||||
struct vm_map_entry entry, *first;
|
||||
struct vmspace vmspace;
|
||||
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
|
||||
struct vnode vnode;
|
||||
struct inode inode;
|
||||
#else
|
||||
struct vm_object object;
|
||||
#endif
|
||||
glibtop_map_entry *maps;
|
||||
#if defined __FreeBSD__
|
||||
struct vnode vnode;
|
||||
struct inode inode;
|
||||
struct mount mount;
|
||||
#endif
|
||||
int count, i = 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));
|
||||
|
||||
@@ -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))
|
||||
continue;
|
||||
#endif
|
||||
#else
|
||||
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
|
||||
if (UVM_ET_ISSUBMAP (&entry))
|
||||
continue;
|
||||
#else
|
||||
if (entry.is_a_map || entry.is_sub_map)
|
||||
continue;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
maps [i].flags = _glibtop_sysdeps_map_entry;
|
||||
@@ -169,6 +189,19 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf,
|
||||
|
||||
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)
|
||||
continue;
|
||||
|
||||
@@ -178,6 +211,24 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf,
|
||||
(unsigned long) entry.object.vm_object,
|
||||
&object, sizeof (object)) != sizeof (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__
|
||||
/* If the object is of type vnode, add its size */
|
||||
|
@@ -39,19 +39,35 @@
|
||||
#include <ufs/ufs/inode.h>
|
||||
|
||||
#include <sys/ucred.h>
|
||||
#ifndef __OpenBSD__
|
||||
#if (!defined __OpenBSD__) && (!defined __bsdi__)
|
||||
#include <sys/user.h>
|
||||
#endif
|
||||
#include <sys/sysctl.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 =
|
||||
(1 << GLIBTOP_PROC_MEM_SIZE) +
|
||||
(1 << GLIBTOP_PROC_MEM_VSIZE) +
|
||||
(1 << GLIBTOP_PROC_MEM_SHARE) +
|
||||
(1 << GLIBTOP_PROC_MEM_RESIDENT) +
|
||||
(1 << GLIBTOP_PROC_MEM_RSS) +
|
||||
(1 << GLIBTOP_PROC_MEM_RSS_RLIM);
|
||||
(1L << GLIBTOP_PROC_MEM_SIZE) +
|
||||
(1L << GLIBTOP_PROC_MEM_VSIZE) +
|
||||
(1L << GLIBTOP_PROC_MEM_RESIDENT) +
|
||||
(1L << GLIBTOP_PROC_MEM_RSS) +
|
||||
(1L << 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
|
||||
#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 */
|
||||
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. */
|
||||
@@ -94,11 +111,16 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf,
|
||||
struct kinfo_proc *pinfo;
|
||||
struct vm_map_entry entry, *first;
|
||||
struct vmspace *vms, vmspace;
|
||||
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
|
||||
struct vnode vnode;
|
||||
struct inode inode;
|
||||
#else
|
||||
struct vm_object object;
|
||||
#endif
|
||||
struct plimit plimit;
|
||||
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));
|
||||
|
||||
@@ -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))
|
||||
continue;
|
||||
#endif
|
||||
#else
|
||||
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
|
||||
if (UVM_ET_ISSUBMAP (&entry))
|
||||
continue;
|
||||
#else
|
||||
if (entry.is_a_map || entry.is_sub_map)
|
||||
continue;
|
||||
#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)
|
||||
continue;
|
||||
|
||||
@@ -189,18 +229,31 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf,
|
||||
glibtop_warn_io_r (server, "kvm_read (object)");
|
||||
return;
|
||||
}
|
||||
|
||||
#endif
|
||||
/* 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__
|
||||
if (object.type != OBJT_VNODE)
|
||||
continue;
|
||||
|
||||
buf->share += object.un_pager.vnp.vnp_size;
|
||||
#else
|
||||
buf->share += object.size;
|
||||
#endif
|
||||
}
|
||||
|
||||
buf->flags = _glibtop_sysdeps_proc_mem;
|
||||
buf->flags = _glibtop_sysdeps_proc_mem |
|
||||
_glibtop_sysdeps_proc_mem_share;
|
||||
}
|
||||
|
@@ -48,7 +48,7 @@ glibtop_get_proc_segment_p (glibtop *server,
|
||||
glibtop_proc_segment *buf,
|
||||
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));
|
||||
|
||||
|
@@ -28,10 +28,10 @@
|
||||
#include <glibtop_suid.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_proc_signal =
|
||||
(1 << GLIBTOP_PROC_SIGNAL_SIGNAL) +
|
||||
(1 << GLIBTOP_PROC_SIGNAL_BLOCKED) +
|
||||
(1 << GLIBTOP_PROC_SIGNAL_SIGIGNORE) +
|
||||
(1 << GLIBTOP_PROC_SIGNAL_SIGCATCH);
|
||||
(1L << GLIBTOP_PROC_SIGNAL_SIGNAL) +
|
||||
(1L << GLIBTOP_PROC_SIGNAL_BLOCKED) +
|
||||
(1L << GLIBTOP_PROC_SIGNAL_SIGIGNORE) +
|
||||
(1L << GLIBTOP_PROC_SIGNAL_SIGCATCH);
|
||||
|
||||
/* Init function. */
|
||||
|
||||
@@ -49,7 +49,7 @@ glibtop_get_proc_signal_p (glibtop *server,
|
||||
struct kinfo_proc *pinfo;
|
||||
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));
|
||||
|
||||
|
@@ -27,20 +27,29 @@
|
||||
|
||||
#include <glibtop_suid.h>
|
||||
|
||||
#ifndef __OpenBSD__
|
||||
#if !defined(__OpenBSD__)
|
||||
//&& (!defined __bsdi__)
|
||||
#include <sys/user.h>
|
||||
#endif
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_proc_state =
|
||||
(1 << GLIBTOP_PROC_STATE_CMD) + (1 << GLIBTOP_PROC_STATE_STATE) +
|
||||
(1 << GLIBTOP_PROC_STATE_UID) + (1 << GLIBTOP_PROC_STATE_GID);
|
||||
(1L << GLIBTOP_PROC_STATE_CMD) + (1L << GLIBTOP_PROC_STATE_UID) +
|
||||
(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. */
|
||||
|
||||
void
|
||||
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. */
|
||||
@@ -53,7 +62,7 @@ glibtop_get_proc_state_p (glibtop *server,
|
||||
struct kinfo_proc *pinfo;
|
||||
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));
|
||||
|
||||
@@ -73,27 +82,34 @@ glibtop_get_proc_state_p (glibtop *server,
|
||||
buf->uid = pinfo [0].kp_eproc.e_pcred.p_svuid;
|
||||
buf->gid = pinfo [0].kp_eproc.e_pcred.p_svgid;
|
||||
|
||||
switch (pinfo [0].kp_proc.p_stat) {
|
||||
case SIDL:
|
||||
buf->state = 'I';
|
||||
break;
|
||||
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;
|
||||
}
|
||||
#if LIBGTOP_VERSION_CODE >= 1001000
|
||||
buf->ruid = pinfo [0].kp_eproc.e_pcred.p_ruid;
|
||||
buf->rgid = pinfo [0].kp_eproc.e_pcred.p_rgid;
|
||||
#endif
|
||||
|
||||
/* 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);
|
||||
}
|
||||
|
@@ -32,11 +32,12 @@
|
||||
#endif
|
||||
|
||||
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 =
|
||||
(1 << GLIBTOP_PROC_TIME_UTIME) + (1 << GLIBTOP_PROC_TIME_STIME) +
|
||||
(1 << GLIBTOP_PROC_TIME_CUTIME) + (1 << GLIBTOP_PROC_TIME_CSTIME);
|
||||
(1L << GLIBTOP_PROC_TIME_UTIME) + (1L << GLIBTOP_PROC_TIME_STIME) +
|
||||
(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)
|
||||
|
||||
@@ -123,31 +124,74 @@ glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf,
|
||||
pid_t pid)
|
||||
{
|
||||
struct kinfo_proc *pinfo;
|
||||
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
|
||||
register struct rusage *rup;
|
||||
#else
|
||||
struct user *u_addr = (struct user *)USRSTACK;
|
||||
#endif
|
||||
struct pstats pstats;
|
||||
int count;
|
||||
|
||||
char filename [BUFSIZ];
|
||||
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));
|
||||
|
||||
if (server->sysdeps.proc_time == 0)
|
||||
return;
|
||||
|
||||
/* It does not work for the swapper task. */
|
||||
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;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Get the process information */
|
||||
pinfo = kvm_getprocs (server->machine.kd, KERN_PROC_PID, pid, &count);
|
||||
if ((pinfo == NULL) || (count != 1))
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
#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;
|
||||
}
|
||||
|
||||
|
@@ -28,18 +28,30 @@
|
||||
#include <glibtop_suid.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_proc_uid =
|
||||
(1 << GLIBTOP_PROC_UID_UID) + (1 << GLIBTOP_PROC_UID_EUID) +
|
||||
(1 << GLIBTOP_PROC_UID_EGID) + (1 << GLIBTOP_PROC_UID_PID) +
|
||||
(1 << GLIBTOP_PROC_UID_PPID) + (1 << GLIBTOP_PROC_UID_PGRP) +
|
||||
(1 << GLIBTOP_PROC_UID_TPGID) + (1 << GLIBTOP_PROC_UID_PRIORITY) +
|
||||
(1 << GLIBTOP_PROC_UID_NICE);
|
||||
(1L << GLIBTOP_PROC_UID_UID) + (1L << GLIBTOP_PROC_UID_EUID) +
|
||||
(1L << GLIBTOP_PROC_UID_EGID) + (1L << GLIBTOP_PROC_UID_PID) +
|
||||
(1L << GLIBTOP_PROC_UID_PPID) + (1L << GLIBTOP_PROC_UID_PGRP) +
|
||||
(1L << GLIBTOP_PROC_UID_TPGID) + (1L << GLIBTOP_PROC_UID_PRIORITY) +
|
||||
(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. */
|
||||
|
||||
void
|
||||
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. */
|
||||
@@ -51,7 +63,14 @@ glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf,
|
||||
struct kinfo_proc *pinfo;
|
||||
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));
|
||||
|
||||
@@ -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*/
|
||||
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
|
||||
}
|
||||
|
@@ -27,9 +27,26 @@
|
||||
|
||||
#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'. */
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#if defined(__FreeBSD__) || defined(__bsdi__)
|
||||
#define KERNEL 1
|
||||
#else
|
||||
#define _KERNEL 1
|
||||
@@ -39,11 +56,11 @@
|
||||
#include <sys/sem.h>
|
||||
|
||||
static unsigned long _glibtop_sysdeps_sem_limits =
|
||||
(1 << GLIBTOP_IPC_SEMMAP) + (1 << GLIBTOP_IPC_SEMMNI) +
|
||||
(1 << GLIBTOP_IPC_SEMMNS) + (1 << GLIBTOP_IPC_SEMMNU) +
|
||||
(1 << GLIBTOP_IPC_SEMMSL) + (1 << GLIBTOP_IPC_SEMOPM) +
|
||||
(1 << GLIBTOP_IPC_SEMUME) + (1 << GLIBTOP_IPC_SEMUSZ) +
|
||||
(1 << GLIBTOP_IPC_SEMVMX) + (1 << GLIBTOP_IPC_SEMAEM);
|
||||
(1L << GLIBTOP_IPC_SEMMAP) + (1L << GLIBTOP_IPC_SEMMNI) +
|
||||
(1L << GLIBTOP_IPC_SEMMNS) + (1L << GLIBTOP_IPC_SEMMNU) +
|
||||
(1L << GLIBTOP_IPC_SEMMSL) + (1L << GLIBTOP_IPC_SEMOPM) +
|
||||
(1L << GLIBTOP_IPC_SEMUME) + (1L << GLIBTOP_IPC_SEMUSZ) +
|
||||
(1L << GLIBTOP_IPC_SEMVMX) + (1L << GLIBTOP_IPC_SEMAEM);
|
||||
|
||||
/* The values in this structure never change at runtime, so we only
|
||||
* read it once during initialization. We have to use the name `_seminfo'
|
||||
@@ -80,7 +97,7 @@ glibtop_init_sem_limits_p (glibtop *server)
|
||||
void
|
||||
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));
|
||||
|
||||
@@ -98,3 +115,6 @@ glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf)
|
||||
|
||||
buf->flags = _glibtop_sysdeps_sem_limits;
|
||||
}
|
||||
|
||||
#endif /* either a newer BSDI or no BSDI at all. */
|
||||
|
||||
|
@@ -27,9 +27,26 @@
|
||||
|
||||
#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'. */
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#if defined(__FreeBSD__) || defined(__bsdi__)
|
||||
#define KERNEL 1
|
||||
#else
|
||||
#define _KERNEL 1
|
||||
@@ -39,9 +56,9 @@
|
||||
#include <sys/shm.h>
|
||||
|
||||
static unsigned long _glibtop_sysdeps_shm_limits =
|
||||
(1 << GLIBTOP_IPC_SHMMAX) + (1 << GLIBTOP_IPC_SHMMIN) +
|
||||
(1 << GLIBTOP_IPC_SHMMNI) + (1 << GLIBTOP_IPC_SHMSEG) +
|
||||
(1 << GLIBTOP_IPC_SHMALL);
|
||||
(1L << GLIBTOP_IPC_SHMMAX) + (1L << GLIBTOP_IPC_SHMMIN) +
|
||||
(1L << GLIBTOP_IPC_SHMMNI) + (1L << GLIBTOP_IPC_SHMSEG) +
|
||||
(1L << GLIBTOP_IPC_SHMALL);
|
||||
|
||||
/* The values in this structure never change at runtime, so we only
|
||||
* read it once during initialization. We have to use the name `_shminfo'
|
||||
@@ -78,7 +95,7 @@ glibtop_init_shm_limits_p (glibtop *server)
|
||||
void
|
||||
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));
|
||||
|
||||
@@ -93,3 +110,6 @@ glibtop_get_shm_limits_p (glibtop *server, glibtop_shm_limits *buf)
|
||||
|
||||
buf->flags = _glibtop_sysdeps_shm_limits;
|
||||
}
|
||||
|
||||
#endif /* either a newer BSDI or no BSDI at all. */
|
||||
|
||||
|
@@ -30,19 +30,28 @@
|
||||
#include <glibtop_suid.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_swap =
|
||||
(1 << GLIBTOP_SWAP_TOTAL) + (1 << GLIBTOP_SWAP_USED) +
|
||||
(1 << GLIBTOP_SWAP_FREE) + (1 << GLIBTOP_SWAP_PAGEIN) +
|
||||
(1 << GLIBTOP_SWAP_PAGEOUT);
|
||||
(1L << GLIBTOP_SWAP_TOTAL) + (1L << GLIBTOP_SWAP_USED) +
|
||||
(1L << GLIBTOP_SWAP_FREE) + (1L << GLIBTOP_SWAP_PAGEIN) +
|
||||
(1L << GLIBTOP_SWAP_PAGEOUT);
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#if defined(__FreeBSD__) || defined(__bsdi__)
|
||||
|
||||
#include <sys/conf.h>
|
||||
#ifdef __bsdi__
|
||||
#include <vm/swap_pager.h>
|
||||
#else
|
||||
#include <sys/rlist.h>
|
||||
#endif
|
||||
#include <sys/vmmeter.h>
|
||||
|
||||
#if __FreeBSD__ < 4
|
||||
|
||||
/* nlist structure for kernel access */
|
||||
|
||||
#if defined(__bsdi__)
|
||||
static struct nlist nlst [] = {
|
||||
{ "_swapstats" }, /* general swap info */
|
||||
{ 0 }
|
||||
};
|
||||
#elif __FreeBSD__ < 4
|
||||
static struct nlist nlst [] = {
|
||||
#define VM_SWAPLIST 0
|
||||
{ "_swaplist" },/* list of free swap areas */
|
||||
@@ -56,28 +65,36 @@ static struct nlist nlst [] = {
|
||||
{ "_dmmax" }, /* maximum size of a swap block */
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
#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>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
|
||||
static int mib_uvmexp [] = { CTL_VM, VM_UVMEXP };
|
||||
#else
|
||||
/* nlist structure for kernel access */
|
||||
static struct nlist nlst2 [] = {
|
||||
{ "_cnt" },
|
||||
{ 0 }
|
||||
};
|
||||
#endif
|
||||
|
||||
/* Init function. */
|
||||
|
||||
void
|
||||
glibtop_init_swap_p (glibtop *server)
|
||||
{
|
||||
#ifdef __FreeBSD__
|
||||
#if __FreeBSD__ < 4
|
||||
#if defined(__FreeBSD__) || defined(__bsdi__)
|
||||
#if __FreeBSD__ < 4 || defined(__bsdi__)
|
||||
if (kvm_nlist (server->machine.kd, nlst) != 0) {
|
||||
glibtop_warn_io_r (server, "kvm_nlist (swap)");
|
||||
return;
|
||||
@@ -86,16 +103,18 @@ glibtop_init_swap_p (glibtop *server)
|
||||
struct kvm_swap dummy;
|
||||
|
||||
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;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !(defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000))
|
||||
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;
|
||||
}
|
||||
#endif
|
||||
|
||||
server->sysdeps.swap = _glibtop_sysdeps_swap;
|
||||
}
|
||||
@@ -110,8 +129,9 @@ glibtop_init_swap_p (glibtop *server)
|
||||
void
|
||||
glibtop_get_swap_p (glibtop *server, glibtop_swap *buf)
|
||||
{
|
||||
#ifdef __FreeBSD__
|
||||
#if __FreeBSD__ < 4
|
||||
#if defined(__FreeBSD__)
|
||||
|
||||
# if __FreeBSD__ < 4
|
||||
char *header;
|
||||
int hlen, nswdev, dmmax;
|
||||
int div, nfree, npfree;
|
||||
@@ -122,29 +142,44 @@ glibtop_get_swap_p (glibtop *server, glibtop_swap *buf)
|
||||
struct rlist *swapptr;
|
||||
size_t sw_size;
|
||||
u_long ptr;
|
||||
#else
|
||||
# else
|
||||
int nswdev;
|
||||
struct kvm_swap kvmsw[16];
|
||||
#endif
|
||||
#elif (defined __NetBSD__)
|
||||
# endif
|
||||
|
||||
#elif defined(__bsdi__)
|
||||
struct swapstats swap;
|
||||
#elif defined(__NetBSD__)
|
||||
struct swapent *swaplist;
|
||||
#endif
|
||||
|
||||
int nswap, i;
|
||||
int avail = 0, inuse = 0;
|
||||
|
||||
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
|
||||
struct uvmexp uvmexp;
|
||||
size_t length_uvmexp;
|
||||
#else
|
||||
/* To get `pagein' and `pageout'. */
|
||||
struct vmmeter vmm;
|
||||
#endif
|
||||
static int swappgsin = -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));
|
||||
|
||||
if (server->sysdeps.swap == 0)
|
||||
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. */
|
||||
|
||||
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)");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (swappgsin < 0) {
|
||||
buf->pagein = 0;
|
||||
@@ -160,21 +196,31 @@ glibtop_get_swap_p (glibtop *server, glibtop_swap *buf)
|
||||
#ifdef __FreeBSD__
|
||||
buf->pagein = vmm.v_swappgsin - swappgsin;
|
||||
buf->pageout = vmm.v_swappgsout - swappgsout;
|
||||
#else
|
||||
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
|
||||
buf->pagein = uvmexp.swapins - swappgsin;
|
||||
buf->pageout = uvmexp.swapouts - swappgsout;
|
||||
#else
|
||||
buf->pagein = vmm.v_swpin - swappgsin;
|
||||
buf->pageout = vmm.v_swpout - swappgsout;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
swappgsin = vmm.v_swappgsin;
|
||||
swappgsout = vmm.v_swappgsout;
|
||||
#else
|
||||
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
|
||||
swappgsin = uvmexp.swapins;
|
||||
swappgsout = uvmexp.swapouts;
|
||||
#else
|
||||
swappgsin = vmm.v_swpin;
|
||||
swappgsout = vmm.v_swpout;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#if defined(__FreeBSD__)
|
||||
|
||||
#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,
|
||||
&ptr, sizeof (ptr)) != sizeof (ptr)) {
|
||||
glibtop_warn_io_r (server, "kvm_read (swaplist)");
|
||||
glibtop_warn_io_r (server, "kvm_read (swdevt)");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -328,7 +374,24 @@ glibtop_get_swap_p (glibtop *server, glibtop_swap *buf)
|
||||
|
||||
#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);
|
||||
if (nswap < 0) {
|
||||
|
@@ -30,11 +30,11 @@
|
||||
#include <glibtop_suid.h>
|
||||
|
||||
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 =
|
||||
(1 << GLIBTOP_CPU_TOTAL) + (1 << GLIBTOP_CPU_IDLE) +
|
||||
(1 << GLIBTOP_CPU_FREQUENCY);
|
||||
(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_IDLE) +
|
||||
(1L << GLIBTOP_CPU_FREQUENCY);
|
||||
|
||||
/* Init function. */
|
||||
|
||||
@@ -51,7 +51,7 @@ glibtop_get_uptime_p (glibtop *server, glibtop_uptime *buf)
|
||||
{
|
||||
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));
|
||||
|
||||
|
@@ -113,7 +113,6 @@ sub output {
|
||||
print 'static SCM';
|
||||
print 'glibtop_guile_types_' . $feature . ' (void)';
|
||||
print '{';
|
||||
print "\tint i;";
|
||||
print "\tSCM list;";
|
||||
print '';
|
||||
|
||||
|
89
sysdeps/kernel/glibtop_private.h
Normal file
89
sysdeps/kernel/glibtop_private.h
Normal 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
94
sysdeps/kernel/sysinfo.c
Normal 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;
|
||||
}
|
@@ -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>
|
||||
|
||||
* netload.c: Don't include <linux/ip_fw.h> for libc5 systems
|
||||
|
@@ -26,14 +26,14 @@
|
||||
#include <glibtop/cpu.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_cpu =
|
||||
(1 << GLIBTOP_CPU_TOTAL) + (1 << GLIBTOP_CPU_USER) +
|
||||
(1 << GLIBTOP_CPU_NICE) + (1 << GLIBTOP_CPU_SYS) +
|
||||
(1 << GLIBTOP_CPU_IDLE) + (1 << GLIBTOP_CPU_FREQUENCY);
|
||||
(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_USER) +
|
||||
(1L << GLIBTOP_CPU_NICE) + (1L << GLIBTOP_CPU_SYS) +
|
||||
(1L << GLIBTOP_CPU_IDLE) + (1L << GLIBTOP_CPU_FREQUENCY);
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_cpu_smp =
|
||||
(1 << GLIBTOP_XCPU_TOTAL) + (1 << GLIBTOP_XCPU_USER) +
|
||||
(1 << GLIBTOP_XCPU_NICE) + (1 << GLIBTOP_XCPU_SYS) +
|
||||
(1 << GLIBTOP_XCPU_IDLE);
|
||||
(1L << GLIBTOP_XCPU_TOTAL) + (1L << GLIBTOP_XCPU_USER) +
|
||||
(1L << GLIBTOP_XCPU_NICE) + (1L << GLIBTOP_XCPU_SYS) +
|
||||
(1L << GLIBTOP_XCPU_IDLE);
|
||||
|
||||
/* Init function. */
|
||||
|
||||
@@ -55,6 +55,7 @@ glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf)
|
||||
{
|
||||
char buffer [BUFSIZ], *p;
|
||||
int fd, len, i;
|
||||
u_int64_t total;
|
||||
|
||||
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->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->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_idle [i] = strtoul (p, &p, 0);
|
||||
|
||||
buf->xcpu_total [i] = buf->xcpu_user [i] + buf->xcpu_nice [i] +
|
||||
buf->xcpu_sys [i] + buf->xcpu_idle [i];
|
||||
total = buf->xcpu_user [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;
|
||||
|
@@ -26,12 +26,12 @@
|
||||
#include <glibtop/loadavg.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_loadavg =
|
||||
(1 << GLIBTOP_LOADAVG_LOADAVG);
|
||||
(1L << GLIBTOP_LOADAVG_LOADAVG);
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_loadavg_tasks =
|
||||
(1 << GLIBTOP_LOADAVG_NR_RUNNING) +
|
||||
(1 << GLIBTOP_LOADAVG_NR_TASKS) +
|
||||
(1 << GLIBTOP_LOADAVG_LAST_PID);
|
||||
(1L << GLIBTOP_LOADAVG_NR_RUNNING) +
|
||||
(1L << GLIBTOP_LOADAVG_NR_TASKS) +
|
||||
(1L << GLIBTOP_LOADAVG_LAST_PID);
|
||||
|
||||
/* Init function. */
|
||||
|
||||
|
@@ -26,10 +26,10 @@
|
||||
#include <glibtop/mem.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_mem =
|
||||
(1 << GLIBTOP_MEM_TOTAL) + (1 << GLIBTOP_MEM_USED) +
|
||||
(1 << GLIBTOP_MEM_FREE) + (1 << GLIBTOP_MEM_SHARED) +
|
||||
(1 << GLIBTOP_MEM_BUFFER) + (1 << GLIBTOP_MEM_CACHED) +
|
||||
(1 << GLIBTOP_MEM_USER);
|
||||
(1L << GLIBTOP_MEM_TOTAL) + (1L << GLIBTOP_MEM_USED) +
|
||||
(1L << GLIBTOP_MEM_FREE) + (1L << GLIBTOP_MEM_SHARED) +
|
||||
(1L << GLIBTOP_MEM_BUFFER) + (1L << GLIBTOP_MEM_CACHED) +
|
||||
(1L << GLIBTOP_MEM_USER);
|
||||
|
||||
/* Init function. */
|
||||
|
||||
|
@@ -27,10 +27,10 @@
|
||||
#include <sys/msg.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_msg_limits =
|
||||
(1 << GLIBTOP_IPC_MSGPOOL) + (1 << GLIBTOP_IPC_MSGMAP) +
|
||||
(1 << GLIBTOP_IPC_MSGMAX) + (1 << GLIBTOP_IPC_MSGMNB) +
|
||||
(1 << GLIBTOP_IPC_MSGMNI) + (1 << GLIBTOP_IPC_MSGSSZ) +
|
||||
(1 << GLIBTOP_IPC_MSGTQL);
|
||||
(1L << GLIBTOP_IPC_MSGPOOL) + (1L << GLIBTOP_IPC_MSGMAP) +
|
||||
(1L << GLIBTOP_IPC_MSGMAX) + (1L << GLIBTOP_IPC_MSGMNB) +
|
||||
(1L << GLIBTOP_IPC_MSGMNI) + (1L << GLIBTOP_IPC_MSGSSZ) +
|
||||
(1L << GLIBTOP_IPC_MSGTQL);
|
||||
|
||||
/* Init function. */
|
||||
|
||||
|
@@ -51,40 +51,40 @@
|
||||
#define _GLIBTOP_IP_FW_ACCTOUT 0x2000 /* Account outgoing packets only. */
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_netload =
|
||||
(1 << GLIBTOP_NETLOAD_ERRORS_IN) +
|
||||
(1 << GLIBTOP_NETLOAD_ERRORS_OUT) +
|
||||
(1 << GLIBTOP_NETLOAD_COLLISIONS);
|
||||
(1L << GLIBTOP_NETLOAD_ERRORS_IN) +
|
||||
(1L << GLIBTOP_NETLOAD_ERRORS_OUT) +
|
||||
(1L << GLIBTOP_NETLOAD_COLLISIONS);
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_netload_data =
|
||||
(1 << GLIBTOP_NETLOAD_ADDRESS) +
|
||||
(1 << GLIBTOP_NETLOAD_SUBNET) +
|
||||
(1 << GLIBTOP_NETLOAD_MTU);
|
||||
(1L << GLIBTOP_NETLOAD_ADDRESS) +
|
||||
(1L << GLIBTOP_NETLOAD_SUBNET) +
|
||||
(1L << GLIBTOP_NETLOAD_MTU);
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_netload_bytes =
|
||||
(1 << GLIBTOP_NETLOAD_BYTES_IN) +
|
||||
(1 << GLIBTOP_NETLOAD_BYTES_OUT) +
|
||||
(1 << GLIBTOP_NETLOAD_BYTES_TOTAL);
|
||||
(1L << GLIBTOP_NETLOAD_BYTES_IN) +
|
||||
(1L << GLIBTOP_NETLOAD_BYTES_OUT) +
|
||||
(1L << GLIBTOP_NETLOAD_BYTES_TOTAL);
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_netload_packets =
|
||||
(1 << GLIBTOP_NETLOAD_PACKETS_IN) +
|
||||
(1 << GLIBTOP_NETLOAD_PACKETS_OUT) +
|
||||
(1 << GLIBTOP_NETLOAD_PACKETS_TOTAL);
|
||||
(1L << GLIBTOP_NETLOAD_PACKETS_IN) +
|
||||
(1L << GLIBTOP_NETLOAD_PACKETS_OUT) +
|
||||
(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL);
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_netload_total =
|
||||
(1 << GLIBTOP_NETLOAD_PACKETS_TOTAL) +
|
||||
(1 << GLIBTOP_NETLOAD_BYTES_TOTAL);
|
||||
(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) +
|
||||
(1L << GLIBTOP_NETLOAD_BYTES_TOTAL);
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_netload_in =
|
||||
(1 << GLIBTOP_NETLOAD_PACKETS_TOTAL) +
|
||||
(1 << GLIBTOP_NETLOAD_BYTES_TOTAL) +
|
||||
(1 << GLIBTOP_NETLOAD_PACKETS_IN) +
|
||||
(1 << GLIBTOP_NETLOAD_BYTES_IN);
|
||||
(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) +
|
||||
(1L << GLIBTOP_NETLOAD_BYTES_TOTAL) +
|
||||
(1L << GLIBTOP_NETLOAD_PACKETS_IN) +
|
||||
(1L << GLIBTOP_NETLOAD_BYTES_IN);
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_netload_out =
|
||||
(1 << GLIBTOP_NETLOAD_PACKETS_TOTAL) +
|
||||
(1 << GLIBTOP_NETLOAD_BYTES_TOTAL) +
|
||||
(1 << GLIBTOP_NETLOAD_PACKETS_OUT) +
|
||||
(1 << GLIBTOP_NETLOAD_BYTES_OUT);
|
||||
(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) +
|
||||
(1L << GLIBTOP_NETLOAD_BYTES_TOTAL) +
|
||||
(1L << GLIBTOP_NETLOAD_PACKETS_OUT) +
|
||||
(1L << GLIBTOP_NETLOAD_BYTES_OUT);
|
||||
|
||||
/* Init function. */
|
||||
|
||||
@@ -112,53 +112,51 @@ glibtop_get_netload_s (glibtop *server, glibtop_netload *buf,
|
||||
skfd = socket (AF_INET, SOCK_DGRAM, 0);
|
||||
if (skfd) {
|
||||
struct ifreq ifr;
|
||||
struct sockaddr_in addr;
|
||||
char *address;
|
||||
unsigned flags;
|
||||
|
||||
strcpy (ifr.ifr_name, interface);
|
||||
if (!ioctl (skfd, SIOCGIFFLAGS, &ifr)) {
|
||||
buf->flags |= (1 << GLIBTOP_NETLOAD_IF_FLAGS);
|
||||
buf->flags |= (1L << GLIBTOP_NETLOAD_IF_FLAGS);
|
||||
flags = ifr.ifr_flags;
|
||||
} else
|
||||
flags = 0;
|
||||
|
||||
if (flags & IFF_UP)
|
||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_UP);
|
||||
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_UP);
|
||||
|
||||
if (flags & IFF_BROADCAST)
|
||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_BROADCAST);
|
||||
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_BROADCAST);
|
||||
|
||||
if (flags & IFF_DEBUG)
|
||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_DEBUG);
|
||||
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_DEBUG);
|
||||
|
||||
if (flags & IFF_LOOPBACK)
|
||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_LOOPBACK);
|
||||
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LOOPBACK);
|
||||
|
||||
if (flags & IFF_POINTOPOINT)
|
||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_POINTOPOINT);
|
||||
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_POINTOPOINT);
|
||||
|
||||
if (flags & IFF_RUNNING)
|
||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_RUNNING);
|
||||
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_RUNNING);
|
||||
|
||||
if (flags & IFF_NOARP)
|
||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_NOARP);
|
||||
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_NOARP);
|
||||
|
||||
if (flags & IFF_PROMISC)
|
||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_PROMISC);
|
||||
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_PROMISC);
|
||||
|
||||
if (flags & IFF_ALLMULTI)
|
||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_ALLMULTI);
|
||||
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_ALLMULTI);
|
||||
|
||||
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);
|
||||
if (!ioctl (skfd, SIOCGIFADDR, &ifr)) {
|
||||
struct sockaddr_in addr =
|
||||
*(struct sockaddr_in *) &ifr.ifr_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);
|
||||
@@ -166,13 +164,13 @@ glibtop_get_netload_s (glibtop *server, glibtop_netload *buf,
|
||||
struct sockaddr_in addr =
|
||||
*(struct sockaddr_in *) &ifr.ifr_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);
|
||||
if (!ioctl (skfd, SIOCGIFMTU, &ifr)) {
|
||||
buf->mtu = ifr.ifr_mtu;
|
||||
buf->flags |= (1 << GLIBTOP_NETLOAD_MTU);
|
||||
buf->flags |= (1L << GLIBTOP_NETLOAD_MTU);
|
||||
}
|
||||
|
||||
close (skfd);
|
||||
|
@@ -31,11 +31,13 @@
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_ppp =
|
||||
(1 << GLIBTOP_PPP_STATE) + (1 << GLIBTOP_PPP_BYTES_IN) +
|
||||
(1 << GLIBTOP_PPP_BYTES_OUT);
|
||||
(1L << GLIBTOP_PPP_STATE) + (1L << GLIBTOP_PPP_BYTES_IN) +
|
||||
(1L << GLIBTOP_PPP_BYTES_OUT);
|
||||
|
||||
/* Init function. */
|
||||
|
||||
@@ -187,13 +189,13 @@ glibtop_get_ppp_s (glibtop *server, glibtop_ppp *buf, unsigned short device)
|
||||
if (is_ISDN_on (server, &online)) {
|
||||
buf->state = online ? GLIBTOP_PPP_STATE_ONLINE :
|
||||
GLIBTOP_PPP_STATE_HANGUP;
|
||||
buf->flags |= (1 << GLIBTOP_PPP_STATE);
|
||||
buf->flags |= (1L << GLIBTOP_PPP_STATE);
|
||||
}
|
||||
|
||||
if (get_ISDN_stats (server, &in, &out)) {
|
||||
buf->bytes_in = in;
|
||||
buf->bytes_out = out;
|
||||
buf->flags |= (1 << GLIBTOP_PPP_BYTES_IN) |
|
||||
(1 << GLIBTOP_PPP_BYTES_OUT);
|
||||
buf->flags |= (1L << GLIBTOP_PPP_BYTES_IN) |
|
||||
(1L << GLIBTOP_PPP_BYTES_OUT);
|
||||
}
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@
|
||||
#include <glibtop/procargs.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_proc_args =
|
||||
(1 << GLIBTOP_PROC_ARGS_SIZE);
|
||||
(1L << GLIBTOP_PROC_ARGS_SIZE);
|
||||
|
||||
/* Init function. */
|
||||
|
||||
|
@@ -26,10 +26,10 @@
|
||||
#include <glibtop/prockernel.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_proc_kernel =
|
||||
(1 << GLIBTOP_PROC_KERNEL_K_FLAGS) + (1 << GLIBTOP_PROC_KERNEL_MIN_FLT) +
|
||||
(1 << GLIBTOP_PROC_KERNEL_MAJ_FLT) + (1 << GLIBTOP_PROC_KERNEL_CMIN_FLT) +
|
||||
(1 << GLIBTOP_PROC_KERNEL_CMAJ_FLT) + (1 << GLIBTOP_PROC_KERNEL_KSTK_ESP) +
|
||||
(1 << GLIBTOP_PROC_KERNEL_KSTK_EIP) + (1 << GLIBTOP_PROC_KERNEL_WCHAN);
|
||||
(1L << GLIBTOP_PROC_KERNEL_K_FLAGS) + (1L << GLIBTOP_PROC_KERNEL_MIN_FLT) +
|
||||
(1L << GLIBTOP_PROC_KERNEL_MAJ_FLT) + (1L << GLIBTOP_PROC_KERNEL_CMIN_FLT) +
|
||||
(1L << GLIBTOP_PROC_KERNEL_CMAJ_FLT) + (1L << GLIBTOP_PROC_KERNEL_KSTK_ESP) +
|
||||
(1L << GLIBTOP_PROC_KERNEL_KSTK_EIP) + (1L << GLIBTOP_PROC_KERNEL_WCHAN);
|
||||
|
||||
/* Init function. */
|
||||
|
||||
|
@@ -34,8 +34,8 @@
|
||||
#include <ctype.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_proclist =
|
||||
(1 << GLIBTOP_PROCLIST_TOTAL) + (1 << GLIBTOP_PROCLIST_NUMBER) +
|
||||
(1 << GLIBTOP_PROCLIST_SIZE);
|
||||
(1L << GLIBTOP_PROCLIST_TOTAL) + (1L << GLIBTOP_PROCLIST_NUMBER) +
|
||||
(1L << GLIBTOP_PROCLIST_SIZE);
|
||||
|
||||
/* Init function. */
|
||||
|
||||
@@ -122,28 +122,28 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
|
||||
case GLIBTOP_KERN_PROC_PGRP:
|
||||
/* Do you really, really need this ? */
|
||||
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)
|
||||
continue;
|
||||
break;
|
||||
case GLIBTOP_KERN_PROC_SESSION:
|
||||
/* Do you really, really need this ? */
|
||||
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)
|
||||
continue;
|
||||
break;
|
||||
case GLIBTOP_KERN_PROC_TTY:
|
||||
/* Do you really, really need this ? */
|
||||
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)
|
||||
continue;
|
||||
break;
|
||||
case GLIBTOP_KERN_PROC_RUID:
|
||||
/* Do you really, really need this ? */
|
||||
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)
|
||||
continue;
|
||||
break;
|
||||
@@ -151,19 +151,19 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
|
||||
|
||||
if (which & GLIBTOP_EXCLUDE_NOTTY) {
|
||||
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 (which & GLIBTOP_EXCLUDE_IDLE) {
|
||||
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 (which & GLIBTOP_EXCLUDE_SYSTEM) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
@@ -27,14 +27,14 @@
|
||||
#include <glibtop/procmap.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_proc_map =
|
||||
(1 << GLIBTOP_PROC_MAP_NUMBER) + (1 << GLIBTOP_PROC_MAP_TOTAL) +
|
||||
(1 << GLIBTOP_PROC_MAP_SIZE);
|
||||
(1L << GLIBTOP_PROC_MAP_NUMBER) + (1L << GLIBTOP_PROC_MAP_TOTAL) +
|
||||
(1L << GLIBTOP_PROC_MAP_SIZE);
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_map_entry =
|
||||
(1 << GLIBTOP_MAP_ENTRY_START) + (1 << GLIBTOP_MAP_ENTRY_END) +
|
||||
(1 << GLIBTOP_MAP_ENTRY_OFFSET) + (1 << GLIBTOP_MAP_ENTRY_PERM) +
|
||||
(1 << GLIBTOP_MAP_ENTRY_INODE) + (1 << GLIBTOP_MAP_ENTRY_DEVICE) +
|
||||
(1 << GLIBTOP_MAP_ENTRY_FILENAME);
|
||||
(1L << GLIBTOP_MAP_ENTRY_START) + (1L << GLIBTOP_MAP_ENTRY_END) +
|
||||
(1L << GLIBTOP_MAP_ENTRY_OFFSET) + (1L << GLIBTOP_MAP_ENTRY_PERM) +
|
||||
(1L << GLIBTOP_MAP_ENTRY_INODE) + (1L << GLIBTOP_MAP_ENTRY_DEVICE) +
|
||||
(1L << GLIBTOP_MAP_ENTRY_FILENAME);
|
||||
|
||||
/* Init function. */
|
||||
|
||||
@@ -66,11 +66,15 @@ glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid)
|
||||
do {
|
||||
short dev_major, dev_minor;
|
||||
unsigned long start, end, offset, inode, perm;
|
||||
char flags [5];
|
||||
char flags [5], *format;
|
||||
size_t size;
|
||||
|
||||
rv = fscanf (maps,
|
||||
"%08lx-%08lx %4c\n %08lx %02hx:%02hx %ld",
|
||||
if (sizeof (void*) == 8)
|
||||
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,
|
||||
&dev_major, &dev_minor, &inode);
|
||||
|
||||
|
@@ -26,12 +26,12 @@
|
||||
#include <glibtop/procmem.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_proc_mem =
|
||||
(1 << GLIBTOP_PROC_MEM_VSIZE) + (1 << GLIBTOP_PROC_MEM_RSS) +
|
||||
(1 << GLIBTOP_PROC_MEM_RSS_RLIM);
|
||||
(1L << GLIBTOP_PROC_MEM_VSIZE) + (1L << GLIBTOP_PROC_MEM_RSS) +
|
||||
(1L << GLIBTOP_PROC_MEM_RSS_RLIM);
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_proc_mem_statm =
|
||||
(1 << GLIBTOP_PROC_MEM_SIZE) + (1 << GLIBTOP_PROC_MEM_RESIDENT) +
|
||||
(1 << GLIBTOP_PROC_MEM_SHARE);
|
||||
(1L << GLIBTOP_PROC_MEM_SIZE) + (1L << GLIBTOP_PROC_MEM_RESIDENT) +
|
||||
(1L << GLIBTOP_PROC_MEM_SHARE);
|
||||
|
||||
#ifndef LOG1024
|
||||
#define LOG1024 10
|
||||
|
@@ -26,16 +26,16 @@
|
||||
#include <glibtop/procsegment.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_proc_segment =
|
||||
(1 << GLIBTOP_PROC_SEGMENT_START_CODE) +
|
||||
(1 << GLIBTOP_PROC_SEGMENT_END_CODE) +
|
||||
(1 << GLIBTOP_PROC_SEGMENT_START_STACK);
|
||||
(1L << GLIBTOP_PROC_SEGMENT_START_CODE) +
|
||||
(1L << GLIBTOP_PROC_SEGMENT_END_CODE) +
|
||||
(1L << GLIBTOP_PROC_SEGMENT_START_STACK);
|
||||
|
||||
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. */
|
||||
/* (1 << GLIBTOP_PROC_SEGMENT_SHLIB_RSS) + */
|
||||
(1 << GLIBTOP_PROC_SEGMENT_DATA_RSS) +
|
||||
(1 << GLIBTOP_PROC_SEGMENT_DIRTY_SIZE);
|
||||
/* (1L << GLIBTOP_PROC_SEGMENT_SHLIB_RSS) + */
|
||||
(1L << GLIBTOP_PROC_SEGMENT_DATA_RSS) +
|
||||
(1L << GLIBTOP_PROC_SEGMENT_DIRTY_SIZE);
|
||||
|
||||
#ifndef LOG1024
|
||||
#define LOG1024 10
|
||||
|
@@ -26,8 +26,8 @@
|
||||
#include <glibtop/procsignal.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_proc_signal =
|
||||
(1 << GLIBTOP_PROC_SIGNAL_SIGNAL) + (1 << GLIBTOP_PROC_SIGNAL_BLOCKED) +
|
||||
(1 << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + (1 << GLIBTOP_PROC_SIGNAL_SIGCATCH);
|
||||
(1L << GLIBTOP_PROC_SIGNAL_SIGNAL) + (1L << GLIBTOP_PROC_SIGNAL_BLOCKED) +
|
||||
(1L << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + (1L << GLIBTOP_PROC_SIGNAL_SIGCATCH);
|
||||
|
||||
/* Init function. */
|
||||
|
||||
|
@@ -28,10 +28,10 @@
|
||||
#include <sys/stat.h>
|
||||
|
||||
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 =
|
||||
(1 << GLIBTOP_PROC_STATE_UID) + (1 << GLIBTOP_PROC_STATE_GID);
|
||||
(1L << GLIBTOP_PROC_STATE_UID) + (1L << GLIBTOP_PROC_STATE_GID);
|
||||
|
||||
/* Init function. */
|
||||
|
||||
|
@@ -26,14 +26,13 @@
|
||||
#include <glibtop/proctime.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_proc_time =
|
||||
(1 << GLIBTOP_PROC_TIME_UTIME) + (1 << GLIBTOP_PROC_TIME_CUTIME) +
|
||||
(1 << GLIBTOP_PROC_TIME_STIME) + (1 << GLIBTOP_PROC_TIME_CSTIME) +
|
||||
(1 << GLIBTOP_PROC_TIME_RTIME) + (1 << GLIBTOP_PROC_TIME_FREQUENCY) +
|
||||
(1 << GLIBTOP_PROC_TIME_TIMEOUT) + (1 << GLIBTOP_PROC_TIME_IT_REAL_VALUE) +
|
||||
(1 << GLIBTOP_PROC_TIME_START_TIME);
|
||||
(1L << GLIBTOP_PROC_TIME_UTIME) + (1L << GLIBTOP_PROC_TIME_CUTIME) +
|
||||
(1L << GLIBTOP_PROC_TIME_STIME) + (1L << GLIBTOP_PROC_TIME_CSTIME) +
|
||||
(1L << GLIBTOP_PROC_TIME_FREQUENCY) + (1L << GLIBTOP_PROC_TIME_TIMEOUT) +
|
||||
(1L << GLIBTOP_PROC_TIME_IT_REAL_VALUE) + (1L << GLIBTOP_PROC_TIME_START_TIME);
|
||||
|
||||
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. */
|
||||
|
||||
@@ -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->cstime = strtoul (p, &p, 0);
|
||||
|
||||
buf->rtime = buf->utime + buf->stime;
|
||||
|
||||
p = skip_multiple_token (p, 2);
|
||||
|
||||
buf->timeout = strtoul (p, &p, 0);
|
||||
|
@@ -26,14 +26,14 @@
|
||||
#include <glibtop/procuid.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_proc_uid =
|
||||
(1 << GLIBTOP_PROC_UID_UID) + (1 << GLIBTOP_PROC_UID_EUID) +
|
||||
(1 << GLIBTOP_PROC_UID_GID) + (1 << GLIBTOP_PROC_UID_EGID);
|
||||
(1L << GLIBTOP_PROC_UID_UID) + (1L << GLIBTOP_PROC_UID_EUID) +
|
||||
(1L << GLIBTOP_PROC_UID_GID) + (1L << GLIBTOP_PROC_UID_EGID);
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_proc_uid_stat =
|
||||
(1 << GLIBTOP_PROC_UID_PID) + (1 << GLIBTOP_PROC_UID_PPID) +
|
||||
(1 << GLIBTOP_PROC_UID_PGRP) + (1 << GLIBTOP_PROC_UID_SESSION) +
|
||||
(1 << GLIBTOP_PROC_UID_TTY) + (1 << GLIBTOP_PROC_UID_TPGID) +
|
||||
(1 << GLIBTOP_PROC_UID_PRIORITY) + (1 << GLIBTOP_PROC_UID_NICE);
|
||||
(1L << GLIBTOP_PROC_UID_PID) + (1L << GLIBTOP_PROC_UID_PPID) +
|
||||
(1L << GLIBTOP_PROC_UID_PGRP) + (1L << GLIBTOP_PROC_UID_SESSION) +
|
||||
(1L << GLIBTOP_PROC_UID_TTY) + (1L << GLIBTOP_PROC_UID_TPGID) +
|
||||
(1L << GLIBTOP_PROC_UID_PRIORITY) + (1L << GLIBTOP_PROC_UID_NICE);
|
||||
|
||||
#define LINUX_VERSION(x,y,z) (0x10000*(x) + 0x100*(y) + z)
|
||||
|
||||
|
@@ -42,11 +42,11 @@ union semun
|
||||
#endif
|
||||
|
||||
static unsigned long _glibtop_sysdeps_sem_limits =
|
||||
(1 << GLIBTOP_IPC_SEMMAP) + (1 << GLIBTOP_IPC_SEMMNI) +
|
||||
(1 << GLIBTOP_IPC_SEMMNS) + (1 << GLIBTOP_IPC_SEMMNU) +
|
||||
(1 << GLIBTOP_IPC_SEMMSL) + (1 << GLIBTOP_IPC_SEMOPM) +
|
||||
(1 << GLIBTOP_IPC_SEMUME) + (1 << GLIBTOP_IPC_SEMUSZ) +
|
||||
(1 << GLIBTOP_IPC_SEMVMX) + (1 << GLIBTOP_IPC_SEMAEM);
|
||||
(1L << GLIBTOP_IPC_SEMMAP) + (1L << GLIBTOP_IPC_SEMMNI) +
|
||||
(1L << GLIBTOP_IPC_SEMMNS) + (1L << GLIBTOP_IPC_SEMMNU) +
|
||||
(1L << GLIBTOP_IPC_SEMMSL) + (1L << GLIBTOP_IPC_SEMOPM) +
|
||||
(1L << GLIBTOP_IPC_SEMUME) + (1L << GLIBTOP_IPC_SEMUSZ) +
|
||||
(1L << GLIBTOP_IPC_SEMVMX) + (1L << GLIBTOP_IPC_SEMAEM);
|
||||
|
||||
/* Init function. */
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user