Compare commits
63 Commits
LIBGTOP_2_
...
LIBGTOP_2_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d21fd97f6 | ||
|
|
666a347f25 | ||
|
|
68db204d6a | ||
|
|
fbe5c8da8e | ||
|
|
a354ca2635 | ||
|
|
639ea4870c | ||
|
|
702d9a1501 | ||
|
|
ea1a6dbaca | ||
|
|
bb60753844 | ||
|
|
d9781917c5 | ||
|
|
bd119a72e2 | ||
|
|
78c10bca9b | ||
|
|
270ec235c1 | ||
|
|
2362be986b | ||
|
|
8a1e1cff91 | ||
|
|
46380bf655 | ||
|
|
91dda5b70d | ||
|
|
9b263e0fbb | ||
|
|
793807b07e | ||
|
|
9898e7ee58 | ||
|
|
7ecdcd712d | ||
|
|
703a17f3f0 | ||
|
|
92a9e7d937 | ||
|
|
01c7e99aa6 | ||
|
|
6fe16f1d91 | ||
|
|
fcb83e637d | ||
|
|
50e4e07013 | ||
|
|
ab40c94db3 | ||
|
|
fee415ecd8 | ||
|
|
647a313d5b | ||
|
|
70ac398a44 | ||
|
|
48056f7d8a | ||
|
|
7ca4171652 | ||
|
|
1537eea7e5 | ||
|
|
0a425e4e41 | ||
|
|
0fa9c9bc61 | ||
|
|
9561cf34b2 | ||
|
|
be721ca476 | ||
|
|
265da513de | ||
|
|
a180cb5b10 | ||
|
|
c517f20195 | ||
|
|
e4ad12fd93 | ||
|
|
c22300d109 | ||
|
|
bffc09b594 | ||
|
|
b7fd73bc5c | ||
|
|
15904773f3 | ||
|
|
b76ae7b1ca | ||
|
|
006eddb5fe | ||
|
|
7566ccf311 | ||
|
|
cde49f488c | ||
|
|
ce9ce223ca | ||
|
|
71900c0e30 | ||
|
|
817057bc3c | ||
|
|
9fe6dadcec | ||
|
|
3e06f95c84 | ||
|
|
2ca1905547 | ||
|
|
65d2d61d41 | ||
|
|
8a4fd3c971 | ||
|
|
c09e2fdead | ||
|
|
fe5bb1c39c | ||
|
|
4b310d26f7 | ||
|
|
83759b2a4a | ||
|
|
209219d5ce |
160
ChangeLog
160
ChangeLog
@@ -1,3 +1,163 @@
|
||||
2005-02-06 Benoît Dejean <TazForEver@dlfp.org>
|
||||
|
||||
* NEWS:
|
||||
* configure.in: Released 2.9.91.
|
||||
|
||||
2005-01-24 Benoît Dejean <TazForEver@dlfp.org>
|
||||
|
||||
* NEWS:
|
||||
* configure.in: Released 2.9.90.
|
||||
|
||||
2005-01-24 Benoît Dejean <TazForEver@dlfp.org>
|
||||
|
||||
* include/glibtop/procopenfiles.h:
|
||||
* sysdeps/linux/procopenfiles.c:
|
||||
* sysdeps/stub/procopenfiles.c: UTF-8-ified.
|
||||
|
||||
2005-01-22 Benoît Dejean <TazForEver@dlfp.org>
|
||||
|
||||
* examples/openfiles.c: (show_open_files):
|
||||
* include/glibtop/procopenfiles.h: added localsock { name } to
|
||||
glibtop_open_files_entry. Should not break ABI.
|
||||
|
||||
2005-01-12 Benoît Dejean <TazForEver@dlfp.org>
|
||||
|
||||
* configure.in: 2.9.5.
|
||||
|
||||
2005-01-10 Benoît Dejean <TazForEver@dlfp.org>
|
||||
|
||||
* NEWS: Released 2.9.4.
|
||||
|
||||
2005-01-10 Benoît Dejean <TazForEver@dlfp.org>
|
||||
|
||||
* configure.in:
|
||||
* examples/.cvsignore:
|
||||
* examples/Makefile.am:
|
||||
* examples/openfiles.c: (show_open_files), (main):
|
||||
* features.def:
|
||||
* include/glibtop/Makefile.am:
|
||||
* include/glibtop/command.h:
|
||||
* include/glibtop/procopenfiles.h:
|
||||
* include/glibtop/sysdeps.h:
|
||||
* include/glibtop/union.h:
|
||||
* structures.def:
|
||||
* sysdeps/linux/Makefile.am:
|
||||
* sysdeps/linux/procopenfiles.c: (glibtop_init_proc_open_files_s),
|
||||
(get_socket_endpoint), (glibtop_get_proc_open_files_s):
|
||||
* sysdeps/stub/Makefile.am:
|
||||
* sysdeps/stub/procopenfiles.c: (glibtop_init_proc_open_files_s),
|
||||
(glibtop_get_proc_open_files_s):
|
||||
|
||||
New feature by nick@reloco.com.ar (Nicolás Lichtmaier).
|
||||
|
||||
glibtop_get_open_files(pid) -> list of files by process.
|
||||
TODO: Add documentation.
|
||||
|
||||
2005-01-03 Benoît Dejean <TazForEver@dlfp.org>
|
||||
|
||||
* examples/pprint.c: (pprint_get_cpu):
|
||||
* features.def:
|
||||
* include/glibtop/cpu.h:
|
||||
* sysdeps/linux/cpu.c: (glibtop_init_cpu_s), (glibtop_get_cpu_s):
|
||||
Added I/O and IRQ wait time to glibtop_cpu. Closes #160443.
|
||||
|
||||
* configure.in: Post-release bump 2.9.4
|
||||
|
||||
2004-12-29 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* lib/read_data.c: (glibtop_read_data_l):
|
||||
* lib/write.c: (glibtop_write_l): Fixed error messages.
|
||||
Closes #162406.
|
||||
|
||||
2004-12-23 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* include/glibtop/error.h:
|
||||
* lib/parameter.c: (glibtop_set_parameter_l):
|
||||
* lib/read_data.c: (glibtop_read_data_l):
|
||||
* sysdeps/common/error.c: (print_server_name), (glibtop_error_vr),
|
||||
(glibtop_error_io_vr), (glibtop_warn_vr), (glibtop_warn_io_vr),
|
||||
(glibtop_error_r), (glibtop_warn_r), (glibtop_error_io_r),
|
||||
(glibtop_warn_io_r), (glibtop_error), (glibtop_warn),
|
||||
(glibtop_error_io), (glibtop_warn_io): Turned all macros to functions.
|
||||
Marked everything as G_GNUC_PRINTF and fixed format bugs.
|
||||
|
||||
* sysdeps/common/fsusage.c: Marked some functions as G_GNUC_INTERNAL
|
||||
|
||||
2004-12-20 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* NEWS:
|
||||
* configure.in: Released 2.9.3.
|
||||
|
||||
2004-12-10 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* lib/lib.pl: Fixed Argument passing between library and server.
|
||||
Thanks everyone. Closes #139809.
|
||||
|
||||
2004-12-06 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* acconfig.h:
|
||||
* configure.in:
|
||||
* debian/libgtop-dev.files.in:
|
||||
* doc/Makefile.am:
|
||||
* examples/Makefile.am:
|
||||
* examples/third.c:
|
||||
* include/glibtop/cpu.h:
|
||||
* include/glibtop/fsusage.h:
|
||||
* include/glibtop/loadavg.h:
|
||||
* include/glibtop/mem.h:
|
||||
* include/glibtop/mountlist.h:
|
||||
* include/glibtop/msg_limits.h:
|
||||
* include/glibtop/netlist.h:
|
||||
* include/glibtop/netload.h:
|
||||
* include/glibtop/ppp.h:
|
||||
* include/glibtop/procargs.h:
|
||||
* include/glibtop/prockernel.h:
|
||||
* include/glibtop/proclist.h:
|
||||
* include/glibtop/procmap.h:
|
||||
* include/glibtop/procmem.h:
|
||||
* include/glibtop/procsegment.h:
|
||||
* include/glibtop/procsignal.h:
|
||||
* include/glibtop/procstate.h:
|
||||
* include/glibtop/proctime.h:
|
||||
* include/glibtop/procuid.h:
|
||||
* include/glibtop/sem_limits.h:
|
||||
* include/glibtop/shm_limits.h:
|
||||
* include/glibtop/swap.h:
|
||||
* include/glibtop/sysdeps.h:
|
||||
* include/glibtop/uptime.h:
|
||||
* po/POTFILES.in:
|
||||
* sysdeps/Makefile.am:
|
||||
* sysdeps/names/.cvsignore:
|
||||
* sysdeps/names/Makefile.am:
|
||||
* sysdeps/names/cpu.c:
|
||||
* sysdeps/names/fsusage.c:
|
||||
* sysdeps/names/loadavg.c:
|
||||
* sysdeps/names/mem.c:
|
||||
* sysdeps/names/mountlist.c:
|
||||
* sysdeps/names/msg_limits.c:
|
||||
* sysdeps/names/netlist.c:
|
||||
* sysdeps/names/netload.c:
|
||||
* sysdeps/names/ppp.c:
|
||||
* sysdeps/names/procargs.c:
|
||||
* sysdeps/names/prockernel.c:
|
||||
* sysdeps/names/proclist.c:
|
||||
* sysdeps/names/procmap.c:
|
||||
* sysdeps/names/procmem.c:
|
||||
* sysdeps/names/procsegment.c:
|
||||
* sysdeps/names/procsignal.c:
|
||||
* sysdeps/names/procstate.c:
|
||||
* sysdeps/names/proctime.c:
|
||||
* sysdeps/names/procuid.c:
|
||||
* sysdeps/names/sem_limits.c:
|
||||
* sysdeps/names/shm_limits.c:
|
||||
* sysdeps/names/swap.c:
|
||||
* sysdeps/names/sysdeps.c:
|
||||
* sysdeps/names/uptime.c: Removed libgtop_names :)
|
||||
|
||||
2004-11-30 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* configure.in: post-release bump to 2.9.1.
|
||||
|
||||
2004-11-30 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* NEWS:
|
||||
|
||||
24
NEWS
24
NEWS
@@ -1,4 +1,26 @@
|
||||
December 30, 2004: Overview of Changes from 2.8.1 to 2.9.0
|
||||
February 6, 2004: Overview of Changes from 2.9.90 to 2.9.91
|
||||
==========================================================
|
||||
* Fixed typo in stub.
|
||||
* Updated i18n.
|
||||
|
||||
January 24, 2004: Overview of Changes from 2.9.4 to 2.9.90
|
||||
==========================================================
|
||||
* Updated Linux support.
|
||||
|
||||
January 10, 2004: Overview of Changes from 2.9.3 to 2.9.4
|
||||
=========================================================
|
||||
* New glibtop_proc_open_files nick@reloco.com.ar (Nicolás Lichtmaier).
|
||||
* Updated AIX support (Christophe Belle).
|
||||
|
||||
December 20, 2004: Overview of Changes from 2.9.0 to 2.9.3
|
||||
==========================================================
|
||||
* Removed libgtop_names.
|
||||
* Fixed Argument passing between library and server. #139809.
|
||||
* *BSD updated by marcus@freebsd.org (Joe Marcus Clarke).
|
||||
* glibtop_get_mountlist(False) now ignores 'unknown' fs.
|
||||
|
||||
|
||||
November 30, 2004: Overview of Changes from 2.8.1 to 2.9.0
|
||||
=========================================================
|
||||
* glibtop_get_netload : Fixed segfault on linux with ppp devices.
|
||||
* NEW glibtop_get_netlist : retrieves the list of all available interfaces.
|
||||
|
||||
@@ -131,7 +131,6 @@
|
||||
|
||||
#undef HAVE_GLIBTOP_MACHINE_H
|
||||
|
||||
#undef GLIBTOP_NAMES
|
||||
#undef GLIBTOP_GUILE
|
||||
#undef GLIBTOP_GUILE_NAMES
|
||||
#undef GLIBTOP_EXAMPLES
|
||||
|
||||
16
configure.in
16
configure.in
@@ -8,7 +8,7 @@ AC_CANONICAL_SYSTEM
|
||||
|
||||
LIBGTOP_MAJOR_VERSION=2
|
||||
LIBGTOP_MINOR_VERSION=9
|
||||
LIBGTOP_MICRO_VERSION=0
|
||||
LIBGTOP_MICRO_VERSION=91
|
||||
LIBGTOP_VERSION=$LIBGTOP_MAJOR_VERSION.$LIBGTOP_MINOR_VERSION.$LIBGTOP_MICRO_VERSION
|
||||
AM_INIT_AUTOMAKE(libgtop, $LIBGTOP_VERSION)
|
||||
|
||||
@@ -112,7 +112,6 @@ if test x$build_inodedb = xyes ; then
|
||||
AC_DEFINE(GLIBTOP_INODEDB)
|
||||
fi
|
||||
|
||||
AC_DEFINE(GLIBTOP_NAMES)
|
||||
|
||||
if test x$libgtop_smp = xyes ; then
|
||||
smp_examples='smp'
|
||||
@@ -123,7 +122,7 @@ else
|
||||
fi
|
||||
|
||||
if test "x$enable_static" != xno; then
|
||||
static_targets="first_static second_static mountlist_static procmap_static netload_static sysdeps_static timings_static $smp_static_examples pprint_static procargs_static df_static netlist netlist_static"
|
||||
static_targets="first_static second_static mountlist_static procmap_static netload_static sysdeps_static timings_static $smp_static_examples pprint_static procargs_static df_static netlist netlist_static openfiles_static"
|
||||
else
|
||||
static_targets=""
|
||||
fi
|
||||
@@ -255,7 +254,7 @@ AC_TYPE_SIGNAL
|
||||
AC_FUNC_STRFTIME
|
||||
AC_CHECK_FUNCS(getcwd gettimeofday getwd putenv strdup strtoul uname)
|
||||
|
||||
ALL_LINGUAS="am ar az be bg bn bs ca cs cy da de el en_CA en_GB es et eu fa fi fr ga gl gu he hi hr hu id it ja ko lt lv mi mk ml mn ms nb nl nn no or pa pl pt pt_BR ro ru sk sl sq sr sr@Latn sv ta tr uk vi zh_CN zh_TW"
|
||||
ALL_LINGUAS="am ar az be bg bn bs ca cs cy da de el en_CA en_GB es et eu fa fi fr ga gl gu he hi hr hu id it ja ko lt lv mi mk ml mn ms nb ne nl nn no or pa pl pt pt_BR ro ru sk sl sq sr sr@Latn sv ta tr uk vi zh_CN zh_TW"
|
||||
|
||||
GETTEXT_PACKAGE=libgtop-2.0
|
||||
AC_SUBST(GETTEXT_PACKAGE)
|
||||
@@ -338,12 +337,8 @@ fi
|
||||
LIBGTOP_EXTRA_LIBS="$LIBGTOP_EXTRA_LIBS $GLIB_LIBS"
|
||||
|
||||
LIBGTOP_LIBS="$LIBGTOP_LIBS"
|
||||
LIBGTOP_NAMES_LIBS="$LIBGTOP_LIBS"
|
||||
|
||||
LIBGTOP_LIBS="$LIBGTOP_LIBS"
|
||||
LIBGTOP_NAMES_LIBS="$LIBGTOP_NAMES_LIBS"
|
||||
|
||||
LIBGTOP_NAMES_INCS="$LIBGTOP_INCS -DGLIBTOP_NAMES"
|
||||
|
||||
machine_incs="-I\$(top_srcdir)/sysdeps/$sysdeps_dir"
|
||||
|
||||
@@ -361,7 +356,7 @@ if test "$GCC" = "yes" ; then
|
||||
$CFLAGS"
|
||||
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 $GLIB_CFLAGS $CFLAGS $X_CFLAGS "'-DGTOPLOCALEDIR=\"$(datadir)/locale\" -DLIBGTOP_VERSION=\"'"$LIBGTOP_VERSION"'\" -DLIBGTOP_SERVER_VERSION=\"'"$LIBGTOP_SERVER_VERSION"'\" -DLIBGTOP_VERSION_CODE='$LIBGTOP_VERSION_CODE' -DLIBGTOP_SERVER=\"'"$LIBGTOP_SERVER"'\"'
|
||||
INCLUDES="-D_IN_LIBGTOP -D_GNU_SOURCE -I\$(top_builddir) -I\$(top_srcdir) -I\$(top_srcdir)/sysdeps/$sysdeps_dir -I\$(top_srcdir)/include $GLIB_CFLAGS $CFLAGS $X_CFLAGS "'-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)
|
||||
|
||||
@@ -369,8 +364,6 @@ AC_SUBST(LIBGTOP_EXTRA_LIBS)
|
||||
AC_SUBST(GLIB_LIBS)
|
||||
AC_SUBST(LIBGTOP_LIBS)
|
||||
AC_SUBST(LIBGTOP_INCS)
|
||||
AC_SUBST(LIBGTOP_NAMES_LIBS)
|
||||
AC_SUBST(LIBGTOP_NAMES_INCS)
|
||||
AC_SUBST(LIBGTOP_BINDIR)
|
||||
AC_SUBST(LIBGTOP_SERVER)
|
||||
|
||||
@@ -393,7 +386,6 @@ include/Makefile
|
||||
include/glibtop/Makefile
|
||||
sysdeps/Makefile
|
||||
sysdeps/common/Makefile
|
||||
sysdeps/names/Makefile
|
||||
sysdeps/stub/Makefile
|
||||
sysdeps/stub_suid/Makefile
|
||||
sysdeps/sun4/Makefile
|
||||
|
||||
3
debian/libgtop-dev.files.in
vendored
3
debian/libgtop-dev.files.in
vendored
@@ -1,17 +1,14 @@
|
||||
@PREFIX@/lib/libgtop.a
|
||||
@PREFIX@/lib/libgtop_common.a
|
||||
@PREFIX@/lib/libgtop_names.a
|
||||
@PREFIX@/lib/libgtop_suid_common.a
|
||||
@PREFIX@/lib/libgtop_sysdeps.a
|
||||
@PREFIX@/lib/libgtop.la
|
||||
@PREFIX@/lib/libgtop_common.la
|
||||
@PREFIX@/lib/libgtop_names.la
|
||||
@PREFIX@/lib/libgtop_suid_common.la
|
||||
@PREFIX@/lib/libgtop_sysdeps.la
|
||||
@PREFIX@/lib/libgtopConf.sh
|
||||
@PREFIX@/lib/libgtop.so
|
||||
@PREFIX@/lib/libgtop_common.so
|
||||
@PREFIX@/lib/libgtop_names.so
|
||||
@PREFIX@/lib/libgtop_suid_common.so
|
||||
@PREFIX@/lib/libgtop_sysdeps.so
|
||||
@PREFIX@/lib/libgtop-features.def
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
2005-01-03 Benoît Dejean <TazForEver@dlfp.org>
|
||||
|
||||
* reference.texi: Updated.
|
||||
|
||||
2004-12-04 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* reference.texi: Updated.
|
||||
|
||||
2004-08-03 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* reference.texi: Updated.
|
||||
|
||||
@@ -16,8 +16,6 @@ auto-macros.texi: auto-macros.texi.in Makefile
|
||||
-e 's#\%LIBGTOP_EXTRA_LIBS\%#$(LIBGTOP_EXTRA_LIBS)#g' \
|
||||
-e 's#\%LIBGTOP_LIBS\%#$(LIBGTOP_LIBS)#g' \
|
||||
-e 's#\%LIBGTOP_INCS\%#$(LIBGTOP_INCS)#g' \
|
||||
-e 's#\%LIBGTOP_NAMES_LIBS\%#$(LIBGTOP_NAMES_LIBS)#g' \
|
||||
-e 's#\%LIBGTOP_NAMES_INCS\%#$(LIBGTOP_NAMES_INCS)#g' \
|
||||
-e 's#\%LIBGTOP_BINDIR\%#$(LIBGTOP_BINDIR)#g' \
|
||||
-e 's#\%LIBGTOP_SERVER\%#$(LIBGTOP_SERVER)#g' \
|
||||
-e 's#\%LIBGTOP_MAJOR_VERSION\%#$(LIBGTOP_MAJOR_VERSION)#g' \
|
||||
|
||||
@@ -56,18 +56,19 @@ struct _glibtop_cpu
|
||||
nice,
|
||||
sys,
|
||||
idle,
|
||||
iowait,
|
||||
irq,
|
||||
softirq,
|
||||
frequency,
|
||||
xcpu_total [GLIBTOP_NCPU],
|
||||
xcpu_user [GLIBTOP_NCPU],
|
||||
xcpu_nice [GLIBTOP_NCPU],
|
||||
xcpu_sys [GLIBTOP_NCPU],
|
||||
@ifset LIBGTOP-1-1
|
||||
xcpu_idle [GLIBTOP_NCPU],
|
||||
xcpu_iowait [GLIBTOP_NCPU],
|
||||
xcpu_irq [GLIBTOP_NCPU],
|
||||
xcpu_softirq [GLIBTOP_NCPU],
|
||||
xcpu_flags;
|
||||
@end ifset
|
||||
@ifclear LIBGTOP-1-1
|
||||
xcpu_idle [GLIBTOP_NCPU];
|
||||
@end ifclear
|
||||
@};
|
||||
@end cartouche
|
||||
@end example
|
||||
@@ -92,25 +93,33 @@ Number of clock ticks the system spent in system mode.
|
||||
@item idle
|
||||
Number of clock ticks the system spent in the idle task.
|
||||
|
||||
@item iowait
|
||||
Number of clock ticks the system spent waiting for I/O to complete.
|
||||
|
||||
@item irq
|
||||
Number of clock ticks the system spent servicing interrupts.
|
||||
|
||||
@item softirq
|
||||
Number of clock ticks the system spent servicing softirqs.
|
||||
|
||||
@item frequency
|
||||
Tick frequency (default is 100).
|
||||
|
||||
@end table
|
||||
|
||||
The @samp{xcpu_} values are for SMP systems - they are the same than
|
||||
@code{total}, @code{user}, @code{nice}, @code{sys} and @code{idle}
|
||||
@code{total}, @code{user}, @code{nice}, @code{sys}, @code{idle},
|
||||
@code{iowait}, @code{irq} and @code{softirq}
|
||||
except that they are arrays of @code{GLIBTOP_NCPU} (defined in
|
||||
@file{<glibtop/limits.h>}) elements and contain one value for each CPU
|
||||
in the system.
|
||||
|
||||
@ifset LIBGTOP-1-1
|
||||
@table @code
|
||||
@item xcpu_flags
|
||||
This is interpreted as a bit-field: on systems like Solaris, not all CPUs
|
||||
need to be running all the time, so we set the corresponding bit for each
|
||||
CPU that is currently running.
|
||||
@end table
|
||||
@end ifset
|
||||
|
||||
Please note that all of the cpu values are absolute values measured in
|
||||
certain units (to get seconds, divide them by @code{frequency}) since system
|
||||
@@ -1051,16 +1060,7 @@ struct _glibtop_proc_segment
|
||||
dirty_size,
|
||||
start_code,
|
||||
end_code,
|
||||
start_data,
|
||||
end_data,
|
||||
start_brk,
|
||||
end_brk,
|
||||
start_stack,
|
||||
start_mmap,
|
||||
arg_start,
|
||||
arg_end,
|
||||
env_start,
|
||||
env_end;
|
||||
start_stack;
|
||||
@};
|
||||
@end cartouche
|
||||
@end example
|
||||
@@ -1533,6 +1533,8 @@ struct _glibtop_fsusage
|
||||
files,
|
||||
ffree;
|
||||
guint32 block_size;
|
||||
guint64 read,
|
||||
write;
|
||||
@};
|
||||
@end cartouche
|
||||
@end example
|
||||
@@ -1550,10 +1552,12 @@ Total file nodes.
|
||||
Free file nodes.
|
||||
@item block_size
|
||||
Block size in bytes.
|
||||
@item read
|
||||
Total blocks read.
|
||||
@item write
|
||||
Total blocks written.
|
||||
@end table
|
||||
|
||||
Blocks are usually 512 bytes.
|
||||
|
||||
@page
|
||||
@node Library Functions, , Common Functions, Reference Manual
|
||||
@section Library Functions
|
||||
|
||||
@@ -22,4 +22,5 @@ df
|
||||
df_static
|
||||
netlist
|
||||
netlist_static
|
||||
|
||||
openfiles
|
||||
openfiles_static
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
2005-01-22 Benoît Dejean <TazForEver@dlfp.org>
|
||||
|
||||
* openfiles.c: (show_open_files): Updated.
|
||||
|
||||
2004-12-23 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* netload.c: (main):
|
||||
* procmap.c: (main): s/glibtop_error/g_error/g
|
||||
|
||||
2004-11-15 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* netload.c: (hwaddress_format_for_display), (main): Updated.
|
||||
|
||||
@@ -8,11 +8,12 @@ DEFS = @DEFS@
|
||||
|
||||
noinst_PROGRAMS = first second pprint procargs df netlist \
|
||||
mountlist procmap netload sysdeps timings \
|
||||
openfiles \
|
||||
@static_targets@ @smp_examples@
|
||||
|
||||
EXTRA_PROGRAMS = first_static second_static \
|
||||
mountlist_static procmap_static \
|
||||
third third_static smp smp_static \
|
||||
smp smp_static openfiles_static \
|
||||
netload_static sysdeps_static \
|
||||
timings_static pprint_static procargs_static \
|
||||
df_static netlist_static
|
||||
@@ -52,16 +53,6 @@ sysdeps_static_SOURCES = $(sysdeps_SOURCES)
|
||||
sysdeps_static_LDADD = $(sysdeps_LDADD)
|
||||
sysdeps_static_LDFLAGS = -static
|
||||
|
||||
third_names_LIBS = $(top_builddir)/sysdeps/names/libgtop_names-2.0.la
|
||||
|
||||
third_SOURCES = third.c
|
||||
third_LDADD = $(third_names_LIBS) \
|
||||
$(top_builddir)/lib/libgtop-2.0.la \
|
||||
@INTLLIBS@
|
||||
|
||||
third_static_SOURCES = $(third_SOURCES)
|
||||
third_static_LDADD = $(third_LDADD)
|
||||
third_static_LDFLAGS = -static
|
||||
|
||||
mountlist_SOURCES = mountlist.c
|
||||
mountlist_LDADD = $(top_builddir)/lib/libgtop-2.0.la
|
||||
@@ -118,3 +109,11 @@ netlist_static_LDADD = $(netlist_LDADD)
|
||||
netlist_static_LDFLAGS = -static
|
||||
|
||||
|
||||
openfiles_SOURCES = openfiles.c
|
||||
openfiles_LDADD = $(top_builddir)/lib/libgtop-2.0.la
|
||||
|
||||
openfiles_static_SOURCES = $(openfiles_SOURCES)
|
||||
openfiles_static_LDADD = $(openfiles_LDADD)
|
||||
openfiles_static_LDFLAGS = -static
|
||||
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ main (int argc, char *argv [])
|
||||
glibtop_init_r (&glibtop_global_server, 0, 0);
|
||||
|
||||
if (argc != 2)
|
||||
glibtop_error ("Usage: %s interface", argv [0]);
|
||||
g_error ("Usage: %s interface", argv [0]);
|
||||
|
||||
glibtop_get_netload (&netload, argv [1]);
|
||||
|
||||
|
||||
64
examples/openfiles.c
Normal file
64
examples/openfiles.c
Normal file
@@ -0,0 +1,64 @@
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/procopenfiles.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
static void show_open_files(pid_t pid)
|
||||
{
|
||||
glibtop_proc_open_files buf;
|
||||
glibtop_open_files_entry *files;
|
||||
unsigned i;
|
||||
|
||||
files = glibtop_get_proc_open_files(&buf, pid);
|
||||
|
||||
printf("<%ld>\n", (long)pid);
|
||||
|
||||
for(i = 0; i < buf.number; ++i)
|
||||
{
|
||||
printf("\tfd = %d\t", files[i].fd);
|
||||
|
||||
switch(files[i].type)
|
||||
{
|
||||
case GLIBTOP_FILE_TYPE_FILE:
|
||||
printf("file \"%s\"\n", files[i].info.file.name);
|
||||
break;
|
||||
|
||||
case GLIBTOP_FILE_TYPE_PIPE:
|
||||
printf("pipe\n");
|
||||
break;
|
||||
|
||||
case GLIBTOP_FILE_TYPE_INETSOCKET:
|
||||
printf("socket %s:%d\n", files[i].info.sock.dest_host, files[i].info.sock.dest_port);
|
||||
break;
|
||||
|
||||
case GLIBTOP_FILE_TYPE_LOCALSOCKET:
|
||||
printf("localsocket %s\n", files[i].info.localsock.name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
putchar('\n');
|
||||
|
||||
g_free(files);
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
glibtop_init();
|
||||
|
||||
show_open_files(getpid());
|
||||
|
||||
while(*++argv)
|
||||
{
|
||||
pid_t pid = strtol(*argv, NULL, 10);
|
||||
show_open_files(pid);
|
||||
}
|
||||
|
||||
glibtop_close();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -41,12 +41,18 @@ static void pprint_get_cpu()
|
||||
PPRINT(nice, "%llu");
|
||||
PPRINT(sys, "%llu");
|
||||
PPRINT(idle, "%llu");
|
||||
PPRINT(iowait, "%llu");
|
||||
PPRINT(irq, "%llu");
|
||||
PPRINT(softirq, "%llu");
|
||||
PPRINT(frequency, "%llu");
|
||||
PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu");
|
||||
PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu");
|
||||
PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu");
|
||||
PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu");
|
||||
PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu");
|
||||
PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu");
|
||||
PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu");
|
||||
PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu");
|
||||
PPRINT(xcpu_flags, "%llx");
|
||||
FOOTER_PPRINT();
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ main (int argc, char *argv [])
|
||||
glibtop_init_r (&glibtop_global_server, 0, 0);
|
||||
|
||||
if ((argc != 2) || (sscanf (argv [1], "%d", (int *) &pid) != 1))
|
||||
glibtop_error ("Usage: %s pid", argv [0]);
|
||||
g_error ("Usage: %s pid", argv [0]);
|
||||
|
||||
#ifdef GLIBTOP_INODEDB
|
||||
inodedb = glibtop_inodedb_open (0, 0);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
void|cpu|ulong(total,user,nice,sys,idle,frequency,xcpu_total[4],xcpu_user[4],xcpu_nice[4],xcpu_sys[4],xcpu_idle[4])
|
||||
void|cpu|ulong(total,user,nice,sys,idle,iowait,irq,softirq,frequency,xcpu_total[4],xcpu_user[4],xcpu_nice[4],xcpu_sys[4],xcpu_idle[4],xcpu_iowait[4],xcpu_irq[4],xcpu_softirq[4])
|
||||
void|mem|ulong(total,used,free,shared,buffer,cached,user,locked)
|
||||
void|swap|ulong(total,used,free,pagein,pageout)
|
||||
void|uptime|double(uptime,idletime)
|
||||
@@ -16,6 +16,7 @@ void|proc_kernel|ulong(k_flags,min_flt,maj_flt,cmin_flt,cmaj_flt,kstk_esp,kstk_e
|
||||
void|proc_segment|ulong(text_rss,shlib_rss,data_rss,stack_rss,dirty_size,start_code,end_code,start_stack)|pid_t(pid)
|
||||
char *|proc_args|ulong(size)|pid_t(pid):unsigned(max_len)
|
||||
glibtop_map_entry *|proc_map|ulong(number,size,total)|pid_t(pid)
|
||||
glibtop_open_files_entry *|proc_open_files|ulong(number)|pid_t(pid)
|
||||
glibtop_mountentry *|@mountlist|ulong(number,size,total)|int(all_fs)
|
||||
void|@fsusage|ulong(blocks,bfree,bavail,files,ffree)|string|mount_dir
|
||||
void|netload|ulong(if_flags,mtu,subnet,address,packets_in,packets_out,packets_total,bytes_in,bytes_out,bytes_total,errors_in,errors_out,errors_total,collisions)|string|interface
|
||||
|
||||
@@ -7,4 +7,5 @@ glibtop_HEADERS = close.h loadavg.h prockernel.h procstate.h \
|
||||
procsegment.h read.h sysdeps.h global.h \
|
||||
procsignal.h read_data.h union.h types.h gnuserv.h \
|
||||
parameter.h mountlist.h fsusage.h procmap.h signal.h \
|
||||
inodedb.h sysinfo.h ppp.h procargs.h netload.h netlist.h
|
||||
inodedb.h sysinfo.h ppp.h procargs.h netload.h \
|
||||
netlist.h procopenfiles.h
|
||||
|
||||
@@ -58,8 +58,9 @@ G_BEGIN_DECLS
|
||||
#define GLIBTOP_CMND_NETLOAD 22
|
||||
#define GLIBTOP_CMND_PPP 23
|
||||
#define GLIBTOP_CMND_NETLIST 24
|
||||
#define GLIBTOP_CMND_PROC_OPEN_FILES 25
|
||||
|
||||
#define GLIBTOP_MAX_CMND 25
|
||||
#define GLIBTOP_MAX_CMND 26
|
||||
|
||||
#define _GLIBTOP_PARAM_SIZE 16
|
||||
|
||||
|
||||
@@ -41,9 +41,16 @@ G_BEGIN_DECLS
|
||||
#define GLIBTOP_XCPU_NICE 8
|
||||
#define GLIBTOP_XCPU_SYS 9
|
||||
#define GLIBTOP_XCPU_IDLE 10
|
||||
#define GLIBTOP_XCPU_FLAGS 11
|
||||
#define GLIBTOP_XCPU_FLAGS 11
|
||||
|
||||
#define GLIBTOP_MAX_CPU 12
|
||||
#define GLIBTOP_CPU_IOWAIT 12
|
||||
#define GLIBTOP_CPU_IRQ 13
|
||||
#define GLIBTOP_CPU_SOFTIRQ 14
|
||||
#define GLIBTOP_XCPU_IOWAIT 15
|
||||
#define GLIBTOP_XCPU_IRQ 16
|
||||
#define GLIBTOP_XCPU_SOFTIRQ 17
|
||||
|
||||
#define GLIBTOP_MAX_CPU 18
|
||||
|
||||
/* Nobody should really be using more than 4 processors. */
|
||||
#define GLIBTOP_NCPU 4
|
||||
@@ -58,12 +65,18 @@ struct _glibtop_cpu
|
||||
nice, /* GLIBTOP_CPU_NICE */
|
||||
sys, /* GLIBTOP_CPU_SYS */
|
||||
idle, /* GLIBTOP_CPU_IDLE */
|
||||
iowait, /* GLIBTOP_CPU_IOWAIT */
|
||||
irq, /* GLIBTOP_CPU_IRQ */
|
||||
softirq, /* GLIBTOP_CPU_SOFTIRQ */
|
||||
frequency, /* GLIBTOP_CPU_FREQUENCY */
|
||||
xcpu_total [GLIBTOP_NCPU], /* GLIBTOP_XCPU_TOTAL */
|
||||
xcpu_user [GLIBTOP_NCPU], /* GLIBTOP_XCPU_USER */
|
||||
xcpu_nice [GLIBTOP_NCPU], /* GLIBTOP_XCPU_NICE */
|
||||
xcpu_sys [GLIBTOP_NCPU], /* GLIBTOP_XCPU_SYS */
|
||||
xcpu_idle [GLIBTOP_NCPU], /* GLIBTOP_XCPU_IDLE */
|
||||
xcpu_iowait [GLIBTOP_NCPU], /* GLIBTOP_XCPU_IOWAIT */
|
||||
xcpu_irq [GLIBTOP_NCPU], /* GLIBTOP_XCPU_IRQ */
|
||||
xcpu_softirq [GLIBTOP_NCPU], /* GLIBTOP_XCPU_SOFTIRQ */
|
||||
xcpu_flags; /* GLIBTOP_XCPU_IDLE */
|
||||
};
|
||||
|
||||
@@ -85,16 +98,6 @@ void glibtop_init_cpu_s (glibtop *server);
|
||||
void glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_cpu [];
|
||||
extern const unsigned glibtop_types_cpu [];
|
||||
extern const char *glibtop_labels_cpu [];
|
||||
extern const char *glibtop_descriptions_cpu [];
|
||||
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -28,42 +28,20 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
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_vr (glibtop *server, const char *format, va_list args);
|
||||
void glibtop_warn_vr (glibtop *server, const char *format, va_list args);
|
||||
void glibtop_error_io_vr (glibtop *server, const char *format, int, va_list args);
|
||||
void glibtop_warn_io_vr (glibtop *server, const char *format, int, va_list args);
|
||||
|
||||
void glibtop_error_io_vr (glibtop *server, char *format, int, va_list args);
|
||||
void glibtop_warn_io_vr (glibtop *server, char *format, int, va_list args);
|
||||
void glibtop_error_r (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3);
|
||||
void glibtop_warn_r (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3);
|
||||
void glibtop_error_io_r (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3);
|
||||
void glibtop_warn_io_r (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3);
|
||||
|
||||
void G_GNUC_UNUSED glibtop_error_r (glibtop *server, char *format, ...);
|
||||
void G_GNUC_UNUSED glibtop_warn_r (glibtop *server, char *format, ...);
|
||||
void G_GNUC_UNUSED glibtop_error_io_r (glibtop *server, char *format, ...);
|
||||
void G_GNUC_UNUSED glibtop_warn_io_r (glibtop *server, char *format, ...);
|
||||
|
||||
|
||||
#ifdef __GNUC__
|
||||
|
||||
#define glibtop_error(p1, args...) glibtop_error_r(glibtop_global_server , p1 , ## args)
|
||||
#define glibtop_warn(p1, args...) glibtop_warn_r(glibtop_global_server , p1 , ## args)
|
||||
|
||||
#define glibtop_error_io(p1, args...) glibtop_error_io_r(glibtop_global_server , p1 , ## args)
|
||||
#define glibtop_warn_io(p1, args...) glibtop_warn_io_r(glibtop_global_server , p1 , ## args)
|
||||
|
||||
#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
|
||||
#define glibtop_error(p1, ...) glibtop_error_r(glibtop_global_server , p1 , __VA_ARGS__)
|
||||
#define glibtop_warn(p1, ...) glibtop_warn_r(glibtop_global_server , p1 , __VA_ARGS__)
|
||||
|
||||
#define glibtop_error_io(p1, ...) glibtop_error_io_r(glibtop_global_server , p1 , __VA_ARGS__)
|
||||
#define glibtop_warn_io(p1, ...) glibtop_warn_io_r(glibtop_global_server , p1 , __VA_ARGS__)
|
||||
|
||||
#else /* no __GNUC__, no C99*/
|
||||
|
||||
void glibtop_error (char *format, ...);
|
||||
void glibtop_warn (char *format, ...);
|
||||
void glibtop_error_io (char *format, ...);
|
||||
void glibtop_warn_io (char *format, ...);
|
||||
|
||||
#endif /* no __GNUC__ */
|
||||
void glibtop_error (const char *format, ...) G_GNUC_PRINTF(1, 2);
|
||||
void glibtop_warn (const char *format, ...) G_GNUC_PRINTF(1, 2);
|
||||
void glibtop_error_io (const char *format, ...) G_GNUC_PRINTF(1, 2);
|
||||
void glibtop_warn_io (const char *format, ...) G_GNUC_PRINTF(1, 2);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -60,16 +60,6 @@ struct _glibtop_fsusage
|
||||
void glibtop_get_fsusage_l (glibtop *server, glibtop_fsusage *buf, const char *mount_dir);
|
||||
void glibtop_get_fsusage_s (glibtop *server, glibtop_fsusage *buf, const char *mount_dir);
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_fsusage [];
|
||||
extern const unsigned glibtop_types_fsusage [];
|
||||
extern const char *glibtop_labels_fsusage [];
|
||||
extern const char *glibtop_descriptions_fsusage [];
|
||||
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -65,16 +65,6 @@ void glibtop_init_loadavg_s (glibtop *server);
|
||||
void glibtop_get_loadavg_s (glibtop *server, glibtop_loadavg *buf);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_loadavg [];
|
||||
extern const unsigned glibtop_types_loadavg [];
|
||||
extern const char *glibtop_labels_loadavg [];
|
||||
extern const char *glibtop_descriptions_loadavg [];
|
||||
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -73,16 +73,6 @@ void glibtop_init_mem_s (glibtop *server);
|
||||
void glibtop_get_mem_s (glibtop *server, glibtop_mem *buf);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_mem [];
|
||||
extern const unsigned glibtop_types_mem [];
|
||||
extern const char *glibtop_labels_mem [];
|
||||
extern const char *glibtop_descriptions_mem [];
|
||||
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -65,16 +65,6 @@ glibtop_get_mountlist_l (glibtop *server, glibtop_mountlist *buf, int all_fs);
|
||||
glibtop_mountentry *
|
||||
glibtop_get_mountlist_s (glibtop *server, glibtop_mountlist *buf, int all_fs);
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_mountlist [];
|
||||
extern const unsigned glibtop_types_mountlist [];
|
||||
extern const char *glibtop_labels_mountlist [];
|
||||
extern const char *glibtop_descriptions_mountlist [];
|
||||
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -71,16 +71,6 @@ void glibtop_init_msg_limits_s (glibtop *server);
|
||||
void glibtop_get_msg_limits_s (glibtop *server, glibtop_msg_limits *buf);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_msg_limits [];
|
||||
extern const unsigned glibtop_types_msg_limits [];
|
||||
extern const char *glibtop_labels_msg_limits [];
|
||||
extern const char *glibtop_descriptions_msg_limits [];
|
||||
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -55,16 +55,6 @@ void glibtop_init_netlist_s (glibtop *server);
|
||||
char** glibtop_get_netlist_s (glibtop *server, glibtop_netlist *buf);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_netlist [];
|
||||
extern const unsigned glibtop_types_netlist [];
|
||||
extern const char *glibtop_labels_netlist [];
|
||||
extern const char *glibtop_descriptions_netlist [];
|
||||
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -125,16 +125,6 @@ void glibtop_init_netload_s (glibtop *server);
|
||||
void glibtop_get_netload_s (glibtop *server, glibtop_netload *buf, const char *interface);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_netload [];
|
||||
extern const unsigned glibtop_types_netload [];
|
||||
extern const char *glibtop_labels_netload [];
|
||||
extern const char *glibtop_descriptions_netload [];
|
||||
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -69,16 +69,6 @@ void glibtop_init_ppp_s (glibtop *server);
|
||||
void glibtop_get_ppp_s (glibtop *server, glibtop_ppp *buf, unsigned short device);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_ppp [];
|
||||
extern const unsigned glibtop_types_ppp [];
|
||||
extern const char *glibtop_labels_ppp [];
|
||||
extern const char *glibtop_descriptions_ppp [];
|
||||
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -85,16 +85,6 @@ glibtop_get_proc_argv_l (glibtop *server, glibtop_proc_args *buf,
|
||||
#define glibtop_get_proc_argv(proc_args,pid,max_len) glibtop_get_proc_argv_l(glibtop_global_server, proc_args, pid, max_len)
|
||||
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_proc_args [];
|
||||
extern const unsigned glibtop_types_proc_args [];
|
||||
extern const char *glibtop_labels_proc_args [];
|
||||
extern const char *glibtop_descriptions_proc_args [];
|
||||
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -82,16 +82,6 @@ void glibtop_init_proc_kernel_s (glibtop *server);
|
||||
void glibtop_get_proc_kernel_s (glibtop *server, glibtop_proc_kernel *buf, pid_t pid);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_proc_kernel [];
|
||||
extern const unsigned glibtop_types_proc_kernel [];
|
||||
extern const char *glibtop_labels_proc_kernel [];
|
||||
extern const char *glibtop_descriptions_proc_kernel [];
|
||||
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -88,16 +88,6 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
|
||||
gint64 which, gint64 arg);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_proclist [];
|
||||
extern const unsigned glibtop_types_proclist [];
|
||||
extern const char *glibtop_labels_proclist [];
|
||||
extern const char *glibtop_descriptions_proclist [];
|
||||
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -94,16 +94,6 @@ glibtop_map_entry *
|
||||
glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_proc_map [];
|
||||
extern const unsigned glibtop_types_proc_map [];
|
||||
extern const char *glibtop_labels_proc_map [];
|
||||
extern const char *glibtop_descriptions_proc_map [];
|
||||
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -73,16 +73,6 @@ void glibtop_init_proc_mem_s (glibtop *server);
|
||||
void glibtop_get_proc_mem_s (glibtop *server, glibtop_proc_mem *buf, pid_t pid);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_proc_mem [];
|
||||
extern const unsigned glibtop_types_proc_mem [];
|
||||
extern const char *glibtop_labels_proc_mem [];
|
||||
extern const char *glibtop_descriptions_proc_mem [];
|
||||
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
122
include/glibtop/procopenfiles.h
Normal file
122
include/glibtop/procopenfiles.h
Normal file
@@ -0,0 +1,122 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 1998-99 Martin Baulig
|
||||
Copyright (C) 2004 Nicolás Lichtmaier
|
||||
This file is part of LibGTop 1.0.
|
||||
|
||||
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
|
||||
|
||||
Modified by Nicolás Lichtmaier to give open process files.
|
||||
|
||||
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_PROC_OPEN_FILES_H__
|
||||
#define __GLIBTOP_PROC_OPEN_FILES_H__
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/global.h>
|
||||
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GLIBTOP_PROC_OPEN_FILES_NUMBER 0
|
||||
#define GLIBTOP_PROC_OPEN_FILES_TOTAL 1
|
||||
#define GLIBTOP_PROC_OPEN_FILES_SIZE 2
|
||||
|
||||
#define GLIBTOP_MAX_PROC_OPEN_FILES 3
|
||||
|
||||
#define GLIBTOP_FILE_ENTRY_FD 0
|
||||
#define GLIBTOP_FILE_ENTRY_NAME 1
|
||||
#define GLIBTOP_FILE_ENTRY_TYPE 2
|
||||
#define GLIBTOP_FILE_ENTRY_INETSOCKET_DST_HOST 3
|
||||
#define GLIBTOP_FILE_ENTRY_INETSOCKET_DST_PORT 4
|
||||
|
||||
#define GLIBTOP_MAX_OPEN_FILE_ENTRY 5
|
||||
|
||||
#define GLIBTOP_OPEN_FILENAME_LEN 215
|
||||
/* ready for IPv6 */
|
||||
#define GLIBTOP_OPEN_DEST_HOST_LEN 46
|
||||
|
||||
enum glibtop_file_type {
|
||||
GLIBTOP_FILE_TYPE_FILE = 1,
|
||||
GLIBTOP_FILE_TYPE_PIPE = 2,
|
||||
GLIBTOP_FILE_TYPE_INETSOCKET = 4,
|
||||
GLIBTOP_FILE_TYPE_LOCALSOCKET = 8
|
||||
};
|
||||
|
||||
typedef struct _glibtop_open_files_entry glibtop_open_files_entry;
|
||||
|
||||
typedef struct _glibtop_proc_open_files glibtop_proc_open_files;
|
||||
|
||||
struct _glibtop_open_files_entry
|
||||
{
|
||||
int fd;
|
||||
guint16 type; /* An "enum glibtop_file_type" value. */
|
||||
union {
|
||||
/* When type == GLIBTOP_FILE_TYPE_INETSOCKET */
|
||||
struct {
|
||||
char dest_host[GLIBTOP_OPEN_DEST_HOST_LEN+1];
|
||||
int dest_port;
|
||||
} sock;
|
||||
|
||||
/* When type == GLIBTOP_FILE_TYPE_FILE */
|
||||
struct {
|
||||
char name[GLIBTOP_OPEN_FILENAME_LEN+1];
|
||||
} file;
|
||||
|
||||
/* When type == GLIBTOP_FILE_TYPE_LOCALSOCKET */
|
||||
struct {
|
||||
char name[GLIBTOP_OPEN_FILENAME_LEN+1];
|
||||
} localsock;
|
||||
|
||||
} info;
|
||||
};
|
||||
|
||||
struct _glibtop_proc_open_files
|
||||
{
|
||||
guint64 flags,
|
||||
number, /* GLIBTOP_PROC_OPEN_FILES_NUMBER */
|
||||
total, /* GLIBTOP_PROC_OPEN_FILES_TOTAL */
|
||||
size; /* GLIBTOP_PROC_OPEN_FILES_SIZE */
|
||||
};
|
||||
|
||||
#define glibtop_get_proc_open_files(proc_open_files,pid) glibtop_get_proc_open_files_l(glibtop_global_server, proc_open_files, pid)
|
||||
|
||||
#if GLIBTOP_SUID_PROC_FILE
|
||||
#define glibtop_get_proc_open_files_r glibtop_get_proc_open_files_p
|
||||
#else
|
||||
#define glibtop_get_proc_open_files_r glibtop_get_proc_open_files_s
|
||||
#endif
|
||||
|
||||
glibtop_open_files_entry *
|
||||
glibtop_get_proc_open_files_l (glibtop *server, glibtop_proc_open_files *buf, pid_t pid);
|
||||
|
||||
#if GLIBTOP_SUID_PROC_FILE
|
||||
void glibtop_init_proc_open_files_p (glibtop *server);
|
||||
|
||||
glibtop_open_files_entry *
|
||||
glibtop_get_proc_open_files_p (glibtop *server, glibtop_proc_open_files *buf, pid_t pid);
|
||||
#else
|
||||
void glibtop_init_proc_open_files_s (glibtop *server);
|
||||
|
||||
glibtop_open_files_entry *
|
||||
glibtop_get_proc_open_files_s (glibtop *server, glibtop_proc_open_files *buf, pid_t pid);
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif
|
||||
@@ -76,16 +76,6 @@ void glibtop_init_proc_segment_s (glibtop *server);
|
||||
void glibtop_get_proc_segment_s (glibtop *server, glibtop_proc_segment *buf, pid_t pid);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_proc_segment [];
|
||||
extern const unsigned glibtop_types_proc_segment [];
|
||||
extern const char *glibtop_labels_proc_segment [];
|
||||
extern const char *glibtop_descriptions_proc_segment [];
|
||||
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -67,16 +67,6 @@ void glibtop_init_proc_signal_s (glibtop *server);
|
||||
void glibtop_get_proc_signal_s (glibtop *server, glibtop_proc_signal *buf, pid_t pid);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_proc_signal [];
|
||||
extern const unsigned glibtop_types_proc_signal [];
|
||||
extern const char *glibtop_labels_proc_signal [];
|
||||
extern const char *glibtop_descriptions_proc_signal [];
|
||||
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -92,16 +92,6 @@ void glibtop_init_proc_state_s (glibtop *server);
|
||||
void glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf, pid_t pid);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_proc_state [];
|
||||
extern const unsigned glibtop_types_proc_state [];
|
||||
extern const char *glibtop_labels_proc_state [];
|
||||
extern const char *glibtop_descriptions_proc_state [];
|
||||
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -88,16 +88,6 @@ void glibtop_init_proc_time_s (glibtop *server);
|
||||
void glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, pid_t pid);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_proc_time [];
|
||||
extern const unsigned glibtop_types_proc_time [];
|
||||
extern const char *glibtop_labels_proc_time [];
|
||||
extern const char *glibtop_descriptions_proc_time [];
|
||||
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -98,16 +98,6 @@ void glibtop_init_proc_uid_s (glibtop *server);
|
||||
void glibtop_get_proc_uid_s (glibtop *server, glibtop_proc_uid *buf, pid_t pid);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_proc_uid [];
|
||||
extern const unsigned glibtop_types_proc_uid [];
|
||||
extern const char *glibtop_labels_proc_uid [];
|
||||
extern const char *glibtop_descriptions_proc_uid [];
|
||||
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -77,16 +77,6 @@ void glibtop_init_sem_limits_s (glibtop *server);
|
||||
void glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_sem_limits [];
|
||||
extern const unsigned glibtop_types_sem_limits [];
|
||||
extern const char *glibtop_labels_sem_limits [];
|
||||
extern const char *glibtop_descriptions_sem_limits [];
|
||||
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -67,16 +67,6 @@ void glibtop_init_shm_limits_s (glibtop *server);
|
||||
void glibtop_get_shm_limits_s (glibtop *server, glibtop_shm_limits *buf);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_shm_limits [];
|
||||
extern const unsigned glibtop_types_shm_limits [];
|
||||
extern const char *glibtop_labels_shm_limits [];
|
||||
extern const char *glibtop_descriptions_shm_limits [];
|
||||
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -67,16 +67,6 @@ void glibtop_init_swap_s (glibtop *server);
|
||||
void glibtop_get_swap_s (glibtop *server, glibtop_swap *buf);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_swap [];
|
||||
extern const unsigned glibtop_types_swap [];
|
||||
extern const char *glibtop_labels_swap [];
|
||||
extern const char *glibtop_descriptions_swap [];
|
||||
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -52,8 +52,9 @@ G_BEGIN_DECLS
|
||||
#define GLIBTOP_SYSDEPS_NETLOAD 21
|
||||
#define GLIBTOP_SYSDEPS_PPP 22
|
||||
#define GLIBTOP_SYSDEPS_NETLIST 23
|
||||
#define GLIBTOP_SYSDEPS_PROC_OPEN_FILES 24
|
||||
|
||||
#define GLIBTOP_MAX_SYSDEPS 24
|
||||
#define GLIBTOP_MAX_SYSDEPS 25
|
||||
|
||||
#define GLIBTOP_SYSDEPS_ALL ((1 << GLIBTOP_MAX_SYSDEPS) - 1)
|
||||
|
||||
@@ -85,6 +86,7 @@ struct _glibtop_sysdeps
|
||||
proc_segment, /* glibtop_proc_segment */
|
||||
proc_args, /* glibtop_proc_args */
|
||||
proc_map, /* glibtop_proc_map */
|
||||
proc_open_files, /* glibtop_proc_open_files */
|
||||
mountlist, /* glibtop_mountlist */
|
||||
fsusage, /* glibtop_fsusage */
|
||||
netlist, /* glibtop_netlist */
|
||||
@@ -96,16 +98,6 @@ struct _glibtop_sysdeps
|
||||
|
||||
void glibtop_get_sysdeps_r (glibtop *server, glibtop_sysdeps *buf);
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_sysdeps [];
|
||||
extern const unsigned glibtop_types_sysdeps [];
|
||||
extern const char *glibtop_labels_sysdeps [];
|
||||
extern const char *glibtop_descriptions_sysdeps [];
|
||||
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include <glibtop/procsegment.h>
|
||||
#include <glibtop/procargs.h>
|
||||
#include <glibtop/procmap.h>
|
||||
#include <glibtop/procopenfiles.h>
|
||||
|
||||
#include <glibtop/mountlist.h>
|
||||
#include <glibtop/fsusage.h>
|
||||
@@ -80,6 +81,7 @@ union _glibtop_union
|
||||
glibtop_netlist netlist;
|
||||
glibtop_netload netload;
|
||||
glibtop_ppp ppp;
|
||||
glibtop_proc_open_files proc_open_files;
|
||||
};
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
@@ -63,16 +63,6 @@ void glibtop_init_uptime_s (glibtop *server);
|
||||
void glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_uptime [];
|
||||
extern const unsigned glibtop_types_uptime [];
|
||||
extern const char *glibtop_labels_uptime [];
|
||||
extern const char *glibtop_descriptions_uptime [];
|
||||
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
37
lib/lib.pl
37
lib/lib.pl
@@ -106,6 +106,8 @@ sub output {
|
||||
|
||||
if ($param_def eq 'string') {
|
||||
$call_param = ', ' . $line_fields[5];
|
||||
$param_buf = '';
|
||||
$buf_set = '';
|
||||
$param_decl = ",\n " . $space . ' const char *' .
|
||||
|
||||
$line_fields[5];
|
||||
@@ -119,7 +121,12 @@ sub output {
|
||||
$param_decl = '';
|
||||
$send_size = '';
|
||||
$send_ptr = '';
|
||||
$param_buf = '';
|
||||
$buf_set = '';
|
||||
$nr_params = (@params = split(/:/, $param_def, 9999));
|
||||
if ($nr_params) {
|
||||
$param_buf = "\n\tstruct {\n";
|
||||
}
|
||||
for ($param = 1; $param <= $nr_params; $param++) {
|
||||
$list = $params[$param];
|
||||
$type = $params[$param];
|
||||
@@ -127,6 +134,14 @@ sub output {
|
||||
$list =~ s/^.*\(//;
|
||||
$list =~ s/\)$//;
|
||||
$count = (@fields = split(/,/, $list, 9999));
|
||||
|
||||
if ($count > 0) {
|
||||
for ($field = 1; $field <= $count; $field++) {
|
||||
$param_buf .= "\t\t$convert{$type} buf_$fields[$field];\n";
|
||||
$buf_set .= "\tparam_buf.buf_$fields[$field] = $fields[$field];\n";
|
||||
}
|
||||
}
|
||||
|
||||
for ($field = 1; $field <= $count; $field++) {
|
||||
if ($param_decl eq '') {
|
||||
$param_decl = ",\n " . $space . ' ';
|
||||
@@ -139,21 +154,13 @@ sub output {
|
||||
$fields[$field];
|
||||
$call_param = $call_param . ', ' . $fields[$field];
|
||||
if ($send_ptr eq '') {
|
||||
$send_ptr = "\n\tconst void *send_ptr = &" .
|
||||
|
||||
$fields[$field] . ';';
|
||||
$send_ptr = "\n\tconst void *send_ptr = ¶m_buf;";
|
||||
}
|
||||
if ($send_size eq '') {
|
||||
$send_size = "\n\tconst size_t send_size =\n\t\t";
|
||||
}
|
||||
else {
|
||||
$send_size = $send_size . ' + ';
|
||||
}
|
||||
$send_size = $send_size . 'sizeof (' . $fields[$field] . ')';
|
||||
}
|
||||
}
|
||||
if ($send_size ne '') {
|
||||
$send_size = $send_size . ';';
|
||||
if ($nr_params) {
|
||||
$param_buf .= "\t} param_buf;";
|
||||
$send_size = "\n\tconst size_t send_size = sizeof param_buf;";
|
||||
}
|
||||
else {
|
||||
$send_size = "\n\tconst size_t send_size = 0;";
|
||||
@@ -167,11 +174,13 @@ sub output {
|
||||
|
||||
$feature . ' *buf' . $param_decl . ')';
|
||||
|
||||
print '{' . $send_ptr . '' . $send_size;
|
||||
print "{" . $param_buf;
|
||||
|
||||
print $send_ptr . '' . $send_size;
|
||||
if ($retval !~ /^void$/) {
|
||||
print "\t" . $retval . ' retval = (' . $retval . ') 0;';
|
||||
}
|
||||
print '';
|
||||
print $buf_set;
|
||||
|
||||
print "\tglibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_" .
|
||||
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
|
||||
#define _check_data(size) \
|
||||
if ((data_ptr == NULL) || (data_size != size)) { \
|
||||
glibtop_warn_r (server, "glibtop_set_parameter (%d): " \
|
||||
glibtop_warn_r (server, "glibtop_set_parameter (%u): " \
|
||||
"Expected %lu bytes but got %lu.", \
|
||||
parameter, size, data_size); \
|
||||
(unsigned) parameter, (unsigned long) size, (unsigned long) data_size); \
|
||||
return; \
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ glibtop_set_parameter_l (glibtop *server, const unsigned parameter,
|
||||
break;
|
||||
case GLIBTOP_PARAM_FEATURES:
|
||||
/* You should not be allowed to set this field. */
|
||||
glibtop_warn_r (server, "glibtop_set_parameter (%d): " \
|
||||
glibtop_warn_r (server, "glibtop_set_parameter (%u): " \
|
||||
"Cannot modify read-only value.",
|
||||
parameter);
|
||||
break;
|
||||
|
||||
@@ -38,7 +38,8 @@ glibtop_read_data_l (glibtop *server)
|
||||
glibtop_init_r (&server, 0, 0);
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf (stderr, "LIBRARY: reading %d data bytes.\n", sizeof (size_t));
|
||||
fprintf (stderr, "LIBRARY: reading %lu data bytes.\n",
|
||||
(unsigned long) sizeof (size_t));
|
||||
#endif
|
||||
|
||||
if (server->socket) {
|
||||
@@ -51,7 +52,8 @@ glibtop_read_data_l (glibtop *server)
|
||||
glibtop_error_io_r (server, _("read data size"));
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf (stderr, "LIBRARY: really reading %d data bytes (ret = %d).\n", size, ret);
|
||||
fprintf (stderr, "LIBRARY: really reading %lu data bytes (ret = %d).\n",
|
||||
(unsigned long) size, ret);
|
||||
#endif
|
||||
|
||||
if (!size) return NULL;
|
||||
@@ -65,7 +67,10 @@ glibtop_read_data_l (glibtop *server)
|
||||
}
|
||||
|
||||
if (ret < 0)
|
||||
glibtop_error_io_r (server, ngettext ("read data %d byte", "read data %d bytes", size));
|
||||
glibtop_error_io_r (server,
|
||||
ngettext ("read %lu byte of data",
|
||||
"read %lu bytes of data",
|
||||
(unsigned long) size));
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
@@ -48,5 +48,5 @@ glibtop_write_l (glibtop *server, size_t size, void *buf)
|
||||
}
|
||||
|
||||
if (ret < 0)
|
||||
glibtop_error_io_r (server, ngettext ("write %d byte", "write %d bytes", size), size);
|
||||
glibtop_error_io_r (server, ngettext ("wrote %d byte", "wrote %d bytes", size), size);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
POTFILES
|
||||
cat-id-tbl.c
|
||||
*.gmo
|
||||
*.mo
|
||||
libgtop.pot
|
||||
libgtop-2.0.pot
|
||||
*.pot
|
||||
Makefile
|
||||
Makefile.in
|
||||
Makefile.in.in
|
||||
POTFILES
|
||||
cat-id-tbl.c
|
||||
messages
|
||||
stamp-cat-id
|
||||
po2tbl.sed
|
||||
missing
|
||||
notexist
|
||||
po2tbl.sed
|
||||
po2tbl.sed.in
|
||||
stamp-cat-id
|
||||
|
||||
125
po/ChangeLog
125
po/ChangeLog
@@ -1,3 +1,128 @@
|
||||
2005-02-06 Ole Laursen <olau@hardworking.dk>
|
||||
|
||||
* da.po: Updated Danish translation.
|
||||
|
||||
2005-02-06 Pauli Virtanen <pauli.virtanen@hut.fi>
|
||||
|
||||
* fi.po: Updated Finnish translation.
|
||||
|
||||
2005-02-04 Priit Laes <plaes@cvs.gnome.org>
|
||||
|
||||
* et.po: Translation updated by Tõivo Leedjärv.
|
||||
|
||||
2005-01-30 Žygimantas Beručka <uid0@akl.lt>
|
||||
|
||||
* lt.po: Updated Lithuanian translation.
|
||||
|
||||
2005-01-28 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* nb.po: Update
|
||||
* no.po: Update
|
||||
|
||||
2005-01-27 Alexander Shopov <ash@contact.bg>
|
||||
|
||||
* bg.po: Updated Bulgarian translation by
|
||||
Iassen Pramatarov <turin@fsa-bg.org>
|
||||
|
||||
2005-01-26 Duarte Loreto <happyguy_pt@hotmail.com>
|
||||
|
||||
* pt.po: Updated Portuguese translation.
|
||||
|
||||
2005-01-24 Funda Wang <fundawang@linux.net.cn>
|
||||
|
||||
* zh_CN.po: Updated Simplified Chinese translation.
|
||||
|
||||
2005-01-24 Alexander Shopov <ash@contact.bg>
|
||||
|
||||
* bg.po: Updated Bulgarian translation by
|
||||
Vladimir Petkov <vpetkov@i-space.org>
|
||||
|
||||
2005-01-24 Benoît Dejean <TazForEver@dlfp.org>
|
||||
|
||||
* POTFILES.in:
|
||||
* POTFILES.skip: Removed lib/lib.c as it is generated.
|
||||
Closes #165038.
|
||||
|
||||
2005-01-17 Benoît Dejean <TazForEver@dlfp.org>
|
||||
|
||||
* POTFILES.in: Updated.
|
||||
|
||||
2005-01-16 Hendrik Richter <hendrik@gnome-de.org>
|
||||
|
||||
* de.po: Updated German translation.
|
||||
|
||||
2005-01-16 Takeshi AIHANA <aihana@gnome.gr.jp>
|
||||
|
||||
* ja.po: Updated Japanese translation.
|
||||
|
||||
2005-01-13 Benoît Dejean <TazForEver@dlfp.org>
|
||||
|
||||
* POTFILES.in:
|
||||
* POTFILES.skip: Don't translate examples/smp.c.
|
||||
|
||||
2005-01-13 Christian Rose <menthos@menthos.com>
|
||||
|
||||
* POTFILES.in: Added missing file.
|
||||
|
||||
2005-01-02 Miloslav Trmac <mitr@volny.cz>
|
||||
|
||||
* cs.po: Updated Czech translation.
|
||||
|
||||
2004-12-29 Francisco Javier F. Serrador <serrador@cvs.gnome.org>
|
||||
|
||||
* es.po: Updated Spanish translation
|
||||
|
||||
2004-12-29 Marcel Telka <marcel@telka.sk>
|
||||
|
||||
* sk.po: Updated Slovak translation.
|
||||
|
||||
2004-12-29 Christian Rose <menthos@menthos.com>
|
||||
|
||||
* sv.po: Updated Swedish translation.
|
||||
|
||||
2004-12-29 Adam Weinberger <adamw@gnome.org>
|
||||
|
||||
* en_CA.po: Updated Canadian English translation.
|
||||
|
||||
2004-12-29 Pawan Chitrakar <pawan@nplinux.org>
|
||||
|
||||
* ne.po: Added Nepali Translation
|
||||
|
||||
2004-12-29 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* POTFILES.in: Removed a bunch of strings.
|
||||
|
||||
2004-12-28 Christian Rose <menthos@menthos.com>
|
||||
|
||||
* POTFILES.in: Added comment and missing file.
|
||||
* .cvsignore: Added entries and cleaned up.
|
||||
* sv.po: Updated Swedish translation.
|
||||
|
||||
2004-12-28 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* nb.po: Update
|
||||
* no.po: Update
|
||||
|
||||
2004-12-28 Marcel Telka <marcel@telka.sk>
|
||||
|
||||
* sk.po: Updated Slovak translation.
|
||||
|
||||
2004-12-27 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* POTFILES.in: Removed a lot of unused/useless files.
|
||||
|
||||
2004-12-26 Adam Weinberger <adamw@gnome.org>
|
||||
|
||||
* en_CA.po: Updated Canadian English translation.
|
||||
|
||||
2004-12-25 Miloslav Trmac <mitr@volny.cz>
|
||||
|
||||
* cs.po: Updated Czech translation.
|
||||
|
||||
2004-12-04 Žygimantas Beručka <uid0@akl.lt>
|
||||
|
||||
* lt.po: Updated Lithuanian translation.
|
||||
|
||||
2004-11-23 Martin Willemoes Hansen <mwh@sysrq.dk>
|
||||
|
||||
* da.po: Updated Danish translation.
|
||||
|
||||
@@ -1,40 +1,5 @@
|
||||
examples/smp.c
|
||||
include/glibtop/close.h
|
||||
include/glibtop/command.h
|
||||
include/glibtop/cpu.h
|
||||
include/glibtop/error.h
|
||||
include/glibtop/fsusage.h
|
||||
include/glibtop/global.h
|
||||
include/glibtop/gnuserv.h
|
||||
include/glibtop/inodedb.h
|
||||
include/glibtop/loadavg.h
|
||||
include/glibtop/mem.h
|
||||
include/glibtop/mountlist.h
|
||||
include/glibtop/msg_limits.h
|
||||
include/glibtop/open.h
|
||||
include/glibtop/parameter.h
|
||||
include/glibtop/prockernel.h
|
||||
include/glibtop/proclist.h
|
||||
include/glibtop/procmap.h
|
||||
include/glibtop/procmem.h
|
||||
include/glibtop/procsegment.h
|
||||
include/glibtop/procsignal.h
|
||||
include/glibtop/procstate.h
|
||||
include/glibtop/proctime.h
|
||||
include/glibtop/procuid.h
|
||||
include/glibtop/read_data.h
|
||||
include/glibtop/read.h
|
||||
include/glibtop/sem_limits.h
|
||||
include/glibtop/shm_limits.h
|
||||
include/glibtop/signal.h
|
||||
include/glibtop/swap.h
|
||||
include/glibtop/sysdeps.h
|
||||
include/glibtop/sysinfo.h
|
||||
include/glibtop/types.h
|
||||
include/glibtop/union.h
|
||||
include/glibtop/uptime.h
|
||||
include/glibtop/version.h
|
||||
include/glibtop/write.h
|
||||
# List of source files containing translatable strings.
|
||||
# Please keep this file sorted alphabetically.
|
||||
lib/close.c
|
||||
lib/command.c
|
||||
lib/init.c
|
||||
@@ -52,57 +17,6 @@ src/daemon/slave.c
|
||||
src/daemon/version.c
|
||||
src/inodedb/file_by_inode2.c
|
||||
src/inodedb/mkinodedb2.c
|
||||
sysdeps/common/error.c
|
||||
sysdeps/common/fsusage.c
|
||||
sysdeps/common/gnuslib.c
|
||||
sysdeps/common/inodedb.c
|
||||
sysdeps/common/mountlist.c
|
||||
sysdeps/common/sysdeps_suid.c
|
||||
sysdeps/linux/close.c
|
||||
sysdeps/linux/cpu.c
|
||||
sysdeps/linux/glibtop_machine.h
|
||||
sysdeps/linux/glibtop_server.h
|
||||
sysdeps/linux/loadavg.c
|
||||
sysdeps/linux/mem.c
|
||||
sysdeps/linux/msg_limits.c
|
||||
sysdeps/linux/open.c
|
||||
sysdeps/linux/prockernel.c
|
||||
sysdeps/linux/proclist.c
|
||||
sysdeps/linux/procmap.c
|
||||
sysdeps/linux/procmem.c
|
||||
sysdeps/linux/procsegment.c
|
||||
sysdeps/linux/procsignal.c
|
||||
sysdeps/linux/procstate.c
|
||||
sysdeps/linux/proctime.c
|
||||
sysdeps/linux/procuid.c
|
||||
sysdeps/linux/sem_limits.c
|
||||
sysdeps/linux/shm_limits.c
|
||||
sysdeps/linux/siglist.c
|
||||
sysdeps/linux/swap.c
|
||||
sysdeps/linux/sysinfo.c
|
||||
sysdeps/linux/uptime.c
|
||||
sysdeps/names/cpu.c
|
||||
sysdeps/names/fsusage.c
|
||||
sysdeps/names/loadavg.c
|
||||
sysdeps/names/mem.c
|
||||
sysdeps/names/mountlist.c
|
||||
sysdeps/names/msg_limits.c
|
||||
sysdeps/names/netload.c
|
||||
sysdeps/names/ppp.c
|
||||
sysdeps/names/procargs.c
|
||||
sysdeps/names/prockernel.c
|
||||
sysdeps/names/proclist.c
|
||||
sysdeps/names/procmap.c
|
||||
sysdeps/names/procmem.c
|
||||
sysdeps/names/procsegment.c
|
||||
sysdeps/names/procsignal.c
|
||||
sysdeps/names/procstate.c
|
||||
sysdeps/names/proctime.c
|
||||
sysdeps/names/procuid.c
|
||||
sysdeps/names/sem_limits.c
|
||||
sysdeps/names/shm_limits.c
|
||||
sysdeps/names/swap.c
|
||||
sysdeps/names/sysdeps.c
|
||||
sysdeps/names/uptime.c
|
||||
sysdeps/osf1/siglist.c
|
||||
sysdeps/sun4/siglist.c
|
||||
|
||||
@@ -2,3 +2,5 @@ support/error.c
|
||||
support/getopt.c
|
||||
support/popt.c
|
||||
support/popthelp.c
|
||||
examples/smp.c
|
||||
lib/lib.c
|
||||
|
||||
1233
po/en_CA.po
1233
po/en_CA.po
File diff suppressed because it is too large
Load Diff
30
po/et.po
30
po/et.po
@@ -2,18 +2,19 @@
|
||||
# Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
# This file is distributed under the same license as the libgtop package.
|
||||
# Tõivo Leedjärv <toivo@linux.ee>, 2003.
|
||||
#
|
||||
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: libgtop\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2004-08-03 14:09+0200\n"
|
||||
"POT-Creation-Date: 2004-08-06 12:07+0200\n"
|
||||
"PO-Revision-Date: 2003-02-25 01:05+0200\n"
|
||||
"Last-Translator: Tõivo Leedjärv <toivo@linux.ee>\n"
|
||||
"Language-Team: Estonian <gnome-et@linux.ee>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: examples/smp.c:76
|
||||
#, c-format
|
||||
@@ -100,8 +101,8 @@ msgstr ""
|
||||
#, c-format
|
||||
msgid "read %d byte"
|
||||
msgid_plural "read %d bytes"
|
||||
msgstr[0] ""
|
||||
msgstr[1] ""
|
||||
msgstr[0] "loetud %d bait"
|
||||
msgstr[1] "loetud %d baiti"
|
||||
|
||||
#: lib/read_data.c:51
|
||||
msgid "read data size"
|
||||
@@ -111,8 +112,8 @@ msgstr ""
|
||||
#, c-format
|
||||
msgid "read data %d byte"
|
||||
msgid_plural "read data %d bytes"
|
||||
msgstr[0] ""
|
||||
msgstr[1] ""
|
||||
msgstr[0] "andmeid loetud %d bait"
|
||||
msgstr[1] "andmeid loetud %d baiti"
|
||||
|
||||
#: lib/write.c:51
|
||||
#, c-format
|
||||
@@ -411,14 +412,12 @@ msgid "MTU"
|
||||
msgstr ""
|
||||
|
||||
#: sysdeps/names/netload.c:48 sysdeps/names/netload.c:69
|
||||
#, fuzzy
|
||||
msgid "IPv4 Subnet"
|
||||
msgstr "Alamvõrk"
|
||||
msgstr "IPv4 alamvõrk"
|
||||
|
||||
#: sysdeps/names/netload.c:49 sysdeps/names/netload.c:70
|
||||
#, fuzzy
|
||||
msgid "IPv4 Address"
|
||||
msgstr "Aadress"
|
||||
msgstr "IPv4 aadress"
|
||||
|
||||
#: sysdeps/names/netload.c:50 sysdeps/names/netload.c:71
|
||||
msgid "Packets In"
|
||||
@@ -461,9 +460,8 @@ msgid "Collisions"
|
||||
msgstr "Põrkumisi"
|
||||
|
||||
#: sysdeps/names/netload.c:60 sysdeps/names/netload.c:81
|
||||
#, fuzzy
|
||||
msgid "IPv6 Address"
|
||||
msgstr "Aadress"
|
||||
msgstr "IPv6 aadress"
|
||||
|
||||
#: sysdeps/names/netload.c:61 sysdeps/names/netload.c:82
|
||||
msgid "IPv6 Prefix"
|
||||
@@ -1004,9 +1002,8 @@ msgid "Set Group ID"
|
||||
msgstr ""
|
||||
|
||||
#: sysdeps/names/procuid.c:62
|
||||
#, fuzzy
|
||||
msgid "Filesystem User ID"
|
||||
msgstr "Failisüsteemide kasutus"
|
||||
msgstr "Failisüsteemi kasutaja ID"
|
||||
|
||||
#: sysdeps/names/procuid.c:63
|
||||
msgid "Filesystem Group ID"
|
||||
@@ -1261,9 +1258,8 @@ msgid "Time in seconds the system spent in the idle task since system boot"
|
||||
msgstr "Kui kaua on protsessor käivitamisest alates jõude seisnud (sekundites)"
|
||||
|
||||
#: sysdeps/names/uptime.c:48
|
||||
#, fuzzy
|
||||
msgid "Time of last system boot in seconds since the epoch"
|
||||
msgstr "Aega süsteemi käivitamisest (sekundites)"
|
||||
msgstr "Aega viimasest süsteemi alglaadimisest (sekundites aasta 1970 algusest)"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28
|
||||
msgid "Hangup"
|
||||
@@ -1299,7 +1295,7 @@ msgstr ""
|
||||
|
||||
#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36
|
||||
msgid "Kill"
|
||||
msgstr ""
|
||||
msgstr "Kõrvaldamine"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37
|
||||
msgid "Bus error"
|
||||
|
||||
322
po/ne.po
Normal file
322
po/ne.po
Normal file
@@ -0,0 +1,322 @@
|
||||
# Nepali Translation Project.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the libgtop package.
|
||||
# Pawan Chitrakar <pawan@nplinux.org>, 2004.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: levgtop.HEAD.ne.po\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2004-12-11 04:37+0100\n"
|
||||
"PO-Revision-Date: 2004-12-25 04:13+0545\n"
|
||||
"Last-Translator: Rajeev Shrestha <rstha@ecomail.com.np>\n"
|
||||
"Language-Team: NEPALI <info@mpp.org.np>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Poedit-Language: Nepali\n"
|
||||
"X-Poedit-Country: NEPAL\n"
|
||||
"X-Poedit-SourceCharset: utf-8\n"
|
||||
|
||||
#: examples/smp.c:76
|
||||
#, c-format
|
||||
msgid "Ticks (%ld per second):"
|
||||
msgstr "टिकटिक गर्छ (%ld प्रति सेकेन्ड):"
|
||||
|
||||
#: examples/smp.c:79
|
||||
msgid "Total"
|
||||
msgstr "जम्मा"
|
||||
|
||||
#: examples/smp.c:79
|
||||
msgid "User"
|
||||
msgstr "प्रयोगकर्ता"
|
||||
|
||||
#: examples/smp.c:79
|
||||
msgid "Nice"
|
||||
msgstr "असल"
|
||||
|
||||
#: examples/smp.c:79
|
||||
msgid "Sys"
|
||||
msgstr "प्रणाली"
|
||||
|
||||
#: examples/smp.c:79
|
||||
msgid "Idle"
|
||||
msgstr "बेकाम"
|
||||
|
||||
#: examples/smp.c:81
|
||||
#, c-format
|
||||
msgid ""
|
||||
"CPU (0x%08lx): %12.0f %12.0f %12.0f %12.0f %12.0f\n"
|
||||
"\n"
|
||||
msgstr ""
|
||||
"सिपियु (0x%08lx): %12.0f %12.0f %12.0f %12.0f %12.0f\n"
|
||||
"\n"
|
||||
|
||||
#: examples/smp.c:85
|
||||
#, c-format
|
||||
msgid "CPU %3d (0x%08lx): %12lu %12lu %12lu %12lu %12lu\n"
|
||||
msgstr "सिपियु%3d (0x%08lx): %12lu %12lu %12lu %12lu %12lu\n"
|
||||
|
||||
#: examples/smp.c:102
|
||||
msgid "Percent:"
|
||||
msgstr "प्रतिशत:"
|
||||
|
||||
#: examples/smp.c:103
|
||||
msgid "Total (%)"
|
||||
msgstr "जम्मा(%)"
|
||||
|
||||
#: examples/smp.c:103
|
||||
msgid "User (%)"
|
||||
msgstr "प्रयोगकर्ता(%)"
|
||||
|
||||
#: examples/smp.c:103
|
||||
msgid "Nice (%)"
|
||||
msgstr "असल(%)"
|
||||
|
||||
#: examples/smp.c:103
|
||||
msgid "Sys (%)"
|
||||
msgstr "प्रणाली(%)"
|
||||
|
||||
#: examples/smp.c:104
|
||||
msgid "Idle (%)"
|
||||
msgstr "बेकाम(%)"
|
||||
|
||||
#: examples/smp.c:106
|
||||
#, c-format
|
||||
msgid ""
|
||||
"CPU (0x%08lx): %12.3f %12.3f %12.3f %12.3f %12.3f\n"
|
||||
"\n"
|
||||
msgstr ""
|
||||
"सिपियु (0x%08lx): %12.3f %12.3f %12.3f %12.3f %12.3f\n"
|
||||
"\n"
|
||||
|
||||
#: examples/smp.c:122
|
||||
#, c-format
|
||||
msgid "CPU %3d (0x%08lx): %12.3f %12.3f %12.3f %12.3f %12.3f\n"
|
||||
msgstr "सिपियु%3d (0x%08lx): %12.3f %12.3f %12.3f %12.3f %12.3f\n"
|
||||
|
||||
#: examples/smp.c:128
|
||||
msgid "Spin:"
|
||||
msgstr "घुम:"
|
||||
|
||||
#: lib/read.c:64
|
||||
#, fuzzy, c-format
|
||||
msgid "read %d byte"
|
||||
msgid_plural "read %d bytes"
|
||||
msgstr[0] "[पढ्ने मात्र]"
|
||||
msgstr[1] ""
|
||||
|
||||
#: lib/read_data.c:51
|
||||
msgid "read data size"
|
||||
msgstr "तथ्य आकार पढ"
|
||||
|
||||
#: lib/read_data.c:68
|
||||
#, c-format
|
||||
msgid "read data %d byte"
|
||||
msgid_plural "read data %d bytes"
|
||||
msgstr[0] ""
|
||||
msgstr[1] ""
|
||||
|
||||
#: lib/write.c:51
|
||||
#, fuzzy, c-format
|
||||
msgid "write %d byte"
|
||||
msgid_plural "write %d bytes"
|
||||
msgstr[0] "लेख्न निषेध"
|
||||
msgstr[1] ""
|
||||
|
||||
#: src/daemon/gnuserv.c:461
|
||||
msgid "Enable debugging"
|
||||
msgstr "डिबग गर्न सक्षम गर"
|
||||
|
||||
#: src/daemon/gnuserv.c:461
|
||||
msgid "DEBUG"
|
||||
msgstr "डिबग"
|
||||
|
||||
#: src/daemon/gnuserv.c:463
|
||||
msgid "Enable verbose output"
|
||||
msgstr "भर्बोज निवेश सक्षम गर"
|
||||
|
||||
#: src/daemon/gnuserv.c:463
|
||||
msgid "VERBOSE"
|
||||
msgstr "भर्बोज"
|
||||
|
||||
#: src/daemon/gnuserv.c:465
|
||||
msgid "Don't fork into background"
|
||||
msgstr ""
|
||||
|
||||
#: src/daemon/gnuserv.c:465
|
||||
msgid "NO-DAEMON"
|
||||
msgstr "अवतारिक छैन"
|
||||
|
||||
#: src/daemon/gnuserv.c:467
|
||||
msgid "Invoked from inetd"
|
||||
msgstr "इनेट्डबाट जगाइएको"
|
||||
|
||||
#: src/daemon/gnuserv.c:467
|
||||
msgid "INETD"
|
||||
msgstr "इनेट्ड"
|
||||
|
||||
#: src/daemon/gnuserv.c:501
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Error on option %s: %s.\n"
|
||||
"Run '%s --help' to see a full list of available command line options.\n"
|
||||
msgstr ""
|
||||
"%s: %s विकल्पमा त्रटि।\n"
|
||||
"उपलब्ध आदेशरेखाको विकल्पहरुको एउटा पूर्ण सूची हेर्नको निम्ति '%s --मद्दत' सञ्चालन गर।\n"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:28
|
||||
#: sysdeps/sun4/siglist.c:28
|
||||
msgid "Hangup"
|
||||
msgstr "सम्पर्क छुटाउ"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:29
|
||||
#: sysdeps/sun4/siglist.c:29
|
||||
msgid "Interrupt"
|
||||
msgstr "रोक(अबरोध) "
|
||||
|
||||
#: sysdeps/osf1/siglist.c:30
|
||||
#: sysdeps/sun4/siglist.c:30
|
||||
msgid "Quit"
|
||||
msgstr "बाहिर जाउ"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:31
|
||||
#: sysdeps/sun4/siglist.c:31
|
||||
msgid "Illegal instruction"
|
||||
msgstr "अवैध उपदेश"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:32
|
||||
#: sysdeps/sun4/siglist.c:32
|
||||
msgid "Trace trap"
|
||||
msgstr "ट्याप खोज"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:33
|
||||
#: sysdeps/sun4/siglist.c:33
|
||||
msgid "Abort"
|
||||
msgstr "रोक्नु"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:34
|
||||
#: sysdeps/sun4/siglist.c:34
|
||||
msgid "EMT error"
|
||||
msgstr "इयमटि त्रुटि"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:35
|
||||
#: sysdeps/sun4/siglist.c:35
|
||||
msgid "Floating-point exception"
|
||||
msgstr "फ्लोटिङ्ग-प्वाइन्ट अपबाद"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:36
|
||||
#: sysdeps/sun4/siglist.c:36
|
||||
msgid "Kill"
|
||||
msgstr "नास गर"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:37
|
||||
#: sysdeps/sun4/siglist.c:37
|
||||
msgid "Bus error"
|
||||
msgstr "बस त्रुटि"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:38
|
||||
#: sysdeps/sun4/siglist.c:38
|
||||
msgid "Segmentation violation"
|
||||
msgstr "खण्डीकरण उल्लंघन"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:39
|
||||
#: sysdeps/sun4/siglist.c:39
|
||||
msgid "Bad argument to system call"
|
||||
msgstr "प्रणाली बोलाहटलाई खराब आर्गुमेन्ट"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:40
|
||||
#: sysdeps/sun4/siglist.c:40
|
||||
msgid "Broken pipe"
|
||||
msgstr "फुटेको पाइप"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:41
|
||||
#: sysdeps/sun4/siglist.c:41
|
||||
msgid "Alarm clock"
|
||||
msgstr "जागरन घडी"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:42
|
||||
#: sysdeps/sun4/siglist.c:42
|
||||
msgid "Termination"
|
||||
msgstr "समाप्त गर"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:43
|
||||
#: sysdeps/sun4/siglist.c:43
|
||||
msgid "Urgent condition on socket"
|
||||
msgstr "खोपिल्टोमा आकस्मिक अवस्था(गतिविधि)"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:44
|
||||
#: sysdeps/sun4/siglist.c:44
|
||||
msgid "Stop"
|
||||
msgstr "रोक"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:45
|
||||
#: sysdeps/sun4/siglist.c:45
|
||||
msgid "Keyboard stop"
|
||||
msgstr "किबोर्ड रोक"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:46
|
||||
#: sysdeps/sun4/siglist.c:46
|
||||
msgid "Continue"
|
||||
msgstr "जारी राख"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:47
|
||||
#: sysdeps/sun4/siglist.c:47
|
||||
msgid "Child status has changed"
|
||||
msgstr "बालक वस्तुस्थिति परिवर्तन गरिएको छ"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:48
|
||||
#: sysdeps/sun4/siglist.c:48
|
||||
msgid "Background read from tty"
|
||||
msgstr ""
|
||||
|
||||
#: sysdeps/osf1/siglist.c:49
|
||||
#: sysdeps/sun4/siglist.c:49
|
||||
msgid "Background write to tty"
|
||||
msgstr ""
|
||||
|
||||
#: sysdeps/osf1/siglist.c:50
|
||||
#: sysdeps/sun4/siglist.c:50
|
||||
msgid "I/O now possible"
|
||||
msgstr "प्र/नि अब सम्भव "
|
||||
|
||||
#: sysdeps/osf1/siglist.c:51
|
||||
#: sysdeps/sun4/siglist.c:51
|
||||
msgid "CPU limit exceeded"
|
||||
msgstr "सिपियुको सीमा नाघियो"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:52
|
||||
#: sysdeps/sun4/siglist.c:52
|
||||
msgid "File size limit exceeded"
|
||||
msgstr "फाईलको आकारको सीमा नाघियो"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:53
|
||||
#: sysdeps/sun4/siglist.c:53
|
||||
msgid "Virtual alarm clock"
|
||||
msgstr "काल्पनिक जागरन घडी "
|
||||
|
||||
#: sysdeps/osf1/siglist.c:54
|
||||
#: sysdeps/sun4/siglist.c:54
|
||||
msgid "Profiling alarm clock"
|
||||
msgstr "जागरन घडीको प्रोफाईलहुदैछ"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:55
|
||||
#: sysdeps/sun4/siglist.c:55
|
||||
msgid "Window size change"
|
||||
msgstr "विन्डो आकार परिवर्तन"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:56
|
||||
#: sysdeps/sun4/siglist.c:56
|
||||
msgid "Information request"
|
||||
msgstr "जानकारी अनुरोध"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:57
|
||||
#: sysdeps/sun4/siglist.c:57
|
||||
msgid "User defined signal 1"
|
||||
msgstr "प्रयोगकर्ताद्वारा परिभषित संकेत १"
|
||||
|
||||
#: sysdeps/osf1/siglist.c:58
|
||||
#: sysdeps/sun4/siglist.c:58
|
||||
msgid "User defined signal 2"
|
||||
msgstr "प्रयोगकर्ताद्वारा परिभषित संकेत २"
|
||||
|
||||
1232
po/zh_CN.po
1232
po/zh_CN.po
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,5 @@
|
||||
glibtop_map_entry|ulong(flags,start,end,offset,perm,inode,device):string(filename)
|
||||
glibtop_open_file_entry|ulong(flags,fd,type,dest_port):string(filename,dest_host)
|
||||
glibtop_mountentry|ulong(dev):string(devname,mountdir,type)
|
||||
glibtop_sysdeps|ulong(features,pointer_size,cpu,mem,swap,uptime,loadavg,shm_limits,msg_limits,sem_limits,proclist,proc_state,proc_uid,proc_mem,proc_time,proc_signal,proc_kernel,proc_segment,proc_args,proc_map,mountlist,fsusage,interface_names,netlist,netload,ppp)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
SUBDIRS = common @sysdeps_dir@ names
|
||||
SUBDIRS = common @sysdeps_dir@
|
||||
|
||||
DIST_SUBDIRS = common linux names osf1 \
|
||||
DIST_SUBDIRS = common linux osf1 \
|
||||
stub stub_suid sun4 freebsd solaris aix
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
2004-12-23 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* netlist.c:
|
||||
* Makefile.am: Added dummy glibtop_get_netlist.
|
||||
|
||||
2004-10-22 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* procargs.c: (glibtop_get_proc_args_s):
|
||||
|
||||
@@ -7,8 +7,8 @@ libgtop_sysdeps_2_0_la_SOURCES = siglist.c nosuid.c mem.c swap.c uptime.c \
|
||||
procargs.c prockernel.c proclist.c procmap.c \
|
||||
procmem.c procsegment.c procsignal.c \
|
||||
proctime.c procuid.c procmem.c utils.c \
|
||||
procstate.c sysinfo.c
|
||||
|
||||
procstate.c sysinfo.c netlist.c
|
||||
|
||||
|
||||
libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO)
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (C) 2004 Benoît Dejean
|
||||
This file is part of LibGTop 2.0.
|
||||
/* $Id$ */
|
||||
|
||||
/* This file is part of LibGTop 2.0.
|
||||
|
||||
LibGTop is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
@@ -17,26 +18,23 @@
|
||||
Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/netlist.h>
|
||||
#include "libgtop-i18n.h"
|
||||
|
||||
const char *glibtop_names_netlist [GLIBTOP_MAX_NETLIST] =
|
||||
static const unsigned long _glibtop_sysdeps_netlist = 0;
|
||||
|
||||
/* Init function. */
|
||||
|
||||
void
|
||||
glibtop_init_netlist_s (glibtop *server)
|
||||
{
|
||||
"number"
|
||||
};
|
||||
server->sysdeps.netlist = _glibtop_sysdeps_netlist;
|
||||
}
|
||||
|
||||
const unsigned glibtop_types_netlist [GLIBTOP_MAX_NETLIST] =
|
||||
char**
|
||||
glibtop_get_netlist_s (glibtop *server, glibtop_netlist *buf)
|
||||
{
|
||||
GLIBTOP_TYPE_ULONG
|
||||
};
|
||||
|
||||
const char *glibtop_labels_netlist [GLIBTOP_MAX_NETLIST] =
|
||||
{
|
||||
N_("Number"),
|
||||
};
|
||||
|
||||
const char *glibtop_descriptions_netlist [GLIBTOP_MAX_NETLIST] =
|
||||
{
|
||||
N_("Number of network devices found"),
|
||||
};
|
||||
memset (buf, 0, sizeof (glibtop_netlist));
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -1,3 +1,11 @@
|
||||
2005-01-18 Benoît Dejean <TazForEver@dlfp.org>
|
||||
|
||||
* mountlist.c: (ignore_mount_entry): Re-worked with bsearch.
|
||||
|
||||
2004-12-09 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* mountlist.c: (ignore_mount_entry): Ignores "unkown" file system type.
|
||||
|
||||
2004-09-24 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* fsusage.c: (glibtop_get_fsusage_s): Fixed .block_size on Solaris.
|
||||
|
||||
@@ -30,17 +30,17 @@
|
||||
static void
|
||||
print_server_name (const glibtop *server)
|
||||
{
|
||||
fprintf (stderr, "%s: ", server ?
|
||||
(server->name ? server->name : DEFAULT_NAME)
|
||||
fprintf (stderr, "%s: ", server && server->name
|
||||
? server->name
|
||||
: DEFAULT_NAME);
|
||||
}
|
||||
|
||||
void
|
||||
glibtop_error_vr (glibtop *server, char *format, va_list args)
|
||||
glibtop_error_vr (glibtop *server, const char *format, va_list args)
|
||||
{
|
||||
print_server_name (server);
|
||||
vfprintf (stderr, format, args);
|
||||
fprintf (stderr, "\n");
|
||||
fputc('\n', stderr);
|
||||
|
||||
#ifdef LIBGTOP_ENABLE_DEBUG
|
||||
abort ();
|
||||
@@ -50,7 +50,7 @@ glibtop_error_vr (glibtop *server, char *format, va_list args)
|
||||
}
|
||||
|
||||
void
|
||||
glibtop_error_io_vr (glibtop *server, char *format, int error, va_list args)
|
||||
glibtop_error_io_vr (glibtop *server, const char *format, int error, va_list args)
|
||||
{
|
||||
print_server_name (server);
|
||||
vfprintf (stderr, format, args);
|
||||
@@ -64,11 +64,11 @@ glibtop_error_io_vr (glibtop *server, char *format, int error, va_list args)
|
||||
}
|
||||
|
||||
void
|
||||
glibtop_warn_vr (glibtop *server, char *format, va_list args)
|
||||
glibtop_warn_vr (glibtop *server, const char *format, va_list args)
|
||||
{
|
||||
print_server_name (server);
|
||||
vfprintf (stderr, format, args);
|
||||
fprintf (stderr, "\n");
|
||||
fputc('\n', stderr);
|
||||
|
||||
#ifdef LIBGTOP_FATAL_WARNINGS
|
||||
abort ();
|
||||
@@ -76,7 +76,7 @@ glibtop_warn_vr (glibtop *server, char *format, va_list args)
|
||||
}
|
||||
|
||||
void
|
||||
glibtop_warn_io_vr (glibtop *server, char *format, int error, va_list args)
|
||||
glibtop_warn_io_vr (glibtop *server, const char *format, int error, va_list args)
|
||||
{
|
||||
print_server_name (server);
|
||||
vfprintf (stderr, format, args);
|
||||
@@ -88,8 +88,8 @@ glibtop_warn_io_vr (glibtop *server, char *format, int error, va_list args)
|
||||
}
|
||||
|
||||
|
||||
void G_GNUC_UNUSED
|
||||
glibtop_error_r (glibtop *server, char *format, ...)
|
||||
void
|
||||
glibtop_error_r (glibtop *server, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
@@ -99,8 +99,8 @@ glibtop_error_r (glibtop *server, char *format, ...)
|
||||
}
|
||||
|
||||
|
||||
void G_GNUC_UNUSED
|
||||
glibtop_warn_r (glibtop *server, char *format, ...)
|
||||
void
|
||||
glibtop_warn_r (glibtop *server, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
@@ -109,8 +109,8 @@ glibtop_warn_r (glibtop *server, char *format, ...)
|
||||
va_end (args);
|
||||
}
|
||||
|
||||
void G_GNUC_UNUSED
|
||||
glibtop_error_io_r (glibtop *server, char *format, ...)
|
||||
void
|
||||
glibtop_error_io_r (glibtop *server, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
@@ -119,8 +119,8 @@ glibtop_error_io_r (glibtop *server, char *format, ...)
|
||||
va_end (args);
|
||||
}
|
||||
|
||||
void G_GNUC_UNUSED
|
||||
glibtop_warn_io_r (glibtop *server, char *format, ...)
|
||||
void
|
||||
glibtop_warn_io_r (glibtop *server, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
@@ -129,10 +129,9 @@ glibtop_warn_io_r (glibtop *server, char *format, ...)
|
||||
va_end (args);
|
||||
}
|
||||
|
||||
#ifndef __GNUC__
|
||||
|
||||
void
|
||||
glibtop_error (char *format, ...)
|
||||
glibtop_error (const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start (args, format);
|
||||
@@ -141,7 +140,7 @@ glibtop_error (char *format, ...)
|
||||
}
|
||||
|
||||
void
|
||||
glibtop_warn (char *format, ...)
|
||||
glibtop_warn (const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start (args, format);
|
||||
@@ -150,7 +149,7 @@ glibtop_warn (char *format, ...)
|
||||
}
|
||||
|
||||
void
|
||||
glibtop_error_io (char *format, ...)
|
||||
glibtop_error_io (const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start (args, format);
|
||||
@@ -159,12 +158,10 @@ glibtop_error_io (char *format, ...)
|
||||
}
|
||||
|
||||
void
|
||||
glibtop_warn_io (char *format, ...)
|
||||
glibtop_warn_io (const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start (args, format);
|
||||
glibtop_warn_io_vr (glibtop_global_server, format, errno, args);
|
||||
va_end (args);
|
||||
}
|
||||
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
@@ -126,9 +126,10 @@ static const unsigned long _glibtop_sysdeps_fsusage =
|
||||
*/
|
||||
|
||||
#ifdef linux
|
||||
void _glibtop_linux_get_fsusage_read_write(glibtop *server,
|
||||
glibtop_fsusage *buf,
|
||||
const char *path);
|
||||
void G_GNUC_INTERNAL
|
||||
_glibtop_linux_get_fsusage_read_write(glibtop *server,
|
||||
glibtop_fsusage *buf,
|
||||
const char *path);
|
||||
|
||||
#define _glibtop_get_fsusage_read_write(S, B, P) \
|
||||
_glibtop_linux_get_fsusage_read_write(S, B, P)
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include <glib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
|
||||
@@ -535,30 +536,28 @@ read_filesystem_list (void)
|
||||
|
||||
static gboolean ignore_mount_entry(const struct mount_entry *me)
|
||||
{
|
||||
/* keep sorted */
|
||||
static const char ignored[][12] = {
|
||||
"autofs",
|
||||
"binfmt_misc",
|
||||
"devpts",
|
||||
"mntfs",
|
||||
"none",
|
||||
"openpromfs",
|
||||
"proc",
|
||||
"procfs",
|
||||
"autofs",
|
||||
"sysfs",
|
||||
"usbfs",
|
||||
"none",
|
||||
"devpts",
|
||||
"usbdevfs",
|
||||
"binfmt_misc",
|
||||
"supermount",
|
||||
"mntfs",
|
||||
"openpromfs"
|
||||
"sysfs",
|
||||
"unknown",
|
||||
"usbdevfs",
|
||||
"usbfs"
|
||||
};
|
||||
|
||||
const char (*i)[12] = &ignored[0];
|
||||
typedef int (*Comparator)(const void*, const void*);
|
||||
|
||||
while(i != (&ignored[0] + G_N_ELEMENTS(ignored))) {
|
||||
if(strcmp(*i, me->me_type) == 0)
|
||||
return TRUE;
|
||||
++i;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return bsearch(me->me_type,
|
||||
ignored, G_N_ELEMENTS(ignored), sizeof ignored[0],
|
||||
(Comparator) strcmp) != NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
2004-12-05 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* Makefile.am:
|
||||
* netlist.c: (glibtop_init_netlist_s), (glibtop_get_netlist_s):
|
||||
Added glibtop_get_netlist. Patch from marcus@freebsd.org (Joe Marcus Clarke).
|
||||
|
||||
2004-08-28 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* mem.c: (glibtop_get_mem_p):
|
||||
|
||||
@@ -11,8 +11,8 @@ libgtop_sysdeps_suid_2_0_la_SOURCES = open.c close.c cpu.c mem.c swap.c \
|
||||
uptime.c loadavg.c shm_limits.c msg_limits.c \
|
||||
sem_limits.c proclist.c procstate.c procuid.c \
|
||||
proctime.c procmem.c procsignal.c prockernel.c \
|
||||
procsegment.c procargs.c procmap.c netload.c \
|
||||
ppp.c
|
||||
procsegment.c procargs.c procmap.c netlist.c \
|
||||
netload.c ppp.c
|
||||
|
||||
libgtop_sysdeps_suid_2_0_la_LDFLAGS = $(LT_VERSION_INFO)
|
||||
|
||||
|
||||
63
sysdeps/freebsd/netlist.c
Normal file
63
sysdeps/freebsd/netlist.c
Normal file
@@ -0,0 +1,63 @@
|
||||
/* $Id$ */
|
||||
|
||||
/*
|
||||
This file is part of LibGTop 2.0.
|
||||
|
||||
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/netlist.h>
|
||||
#include <glibtop/error.h>
|
||||
|
||||
#include <net/if.h>
|
||||
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_netlist = (1 << GLIBTOP_NETLIST_NUMBER);
|
||||
|
||||
/* Init function. */
|
||||
|
||||
void
|
||||
glibtop_init_netlist_s (glibtop *server)
|
||||
{
|
||||
server->sysdeps.netlist = _glibtop_sysdeps_netlist;
|
||||
}
|
||||
|
||||
|
||||
char**
|
||||
glibtop_get_netlist_s (glibtop *server, glibtop_netlist *buf)
|
||||
{
|
||||
struct if_nameindex *ifstart, *ifs;
|
||||
GPtrArray *devices;
|
||||
|
||||
ifs = ifstart = if_nameindex();
|
||||
|
||||
devices = g_ptr_array_new();
|
||||
|
||||
while(ifs && ifs->if_name) {
|
||||
g_ptr_array_add(devices, g_strdup(ifs->if_name));
|
||||
buf->number++;
|
||||
}
|
||||
|
||||
if_freenameindex(ifstart);
|
||||
|
||||
buf->flags = _glibtop_sysdeps_netlist;
|
||||
|
||||
g_ptr_array_add(devices, NULL);
|
||||
|
||||
return (char **) g_ptr_array_free(devices, FALSE);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,42 @@
|
||||
2005-01-22 Benoît Dejean <TazForEver@dlfp.org>
|
||||
|
||||
* procopenfiles.c: (parse_file), (get_all), (inet_socket_parser),
|
||||
(get_all_inet_sockets), (local_socket_parser),
|
||||
(get_all_local_sockets), (glibtop_get_proc_open_files_s): Total rewrite.
|
||||
socket/localsocket should be much faster.
|
||||
|
||||
2005-01-16 Benoît Dejean <TazForEver@dlfp.org>
|
||||
|
||||
* glibtop_private.c: (skip_token):
|
||||
* glibtop_private.h: Uninlined.
|
||||
|
||||
2005-01-13 Benoît Dejean <TazForEver@dlfp.org>
|
||||
|
||||
* fsusage.c: (get_partition), (get_sys_path), (linux_2_6_0): Reworked.
|
||||
Should works with IDE, SCSI. DM support is ready, but i don't know why
|
||||
their /stat is empty ...
|
||||
|
||||
2005-01-12 Benoît Dejean <TazForEver@dlfp.org>
|
||||
|
||||
* procopenfiles.c: (get_all_sockets),
|
||||
(glibtop_get_proc_open_files_s): Parses /proc/net/tcp only once.
|
||||
|
||||
2005-01-10 Benoît Dejean <TazForEver@dlfp.org>
|
||||
|
||||
* procopenfiles.c: (get_socket_endpoint): Fixed.
|
||||
|
||||
2005-01-10 Benoît Dejean <TazForEver@dlfp.org>
|
||||
|
||||
* glibtop_server.h:
|
||||
* procopenfiles.c: (get_socket_endpoint): Disabled.
|
||||
|
||||
(glibtop_get_proc_open_files_s): Secured -> g_snprintf.
|
||||
|
||||
2004-12-23 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* fsusage.c: (_glibtop_linux_get_fsusage_read_write):
|
||||
* glibtop_private.h: Marked private functions G_GNUC_INTERNAL.
|
||||
|
||||
2004-11-30 Benoît Dejean <tazforever@dlfp.org>
|
||||
|
||||
* proclist.c: (glibtop_get_proclist_s): Glibified. g_array_free which
|
||||
|
||||
@@ -8,7 +8,7 @@ libgtop_sysdeps_2_0_la_SOURCES = open.c close.c cpu.c mem.c swap.c \
|
||||
proctime.c procmem.c procsignal.c prockernel.c \
|
||||
procsegment.c procargs.c procmap.c siglist.c \
|
||||
sysinfo.c netload.c ppp.c glibtop_private.c \
|
||||
fsusage.c netlist.c
|
||||
fsusage.c netlist.c procopenfiles.c
|
||||
|
||||
libgtop_sysdeps_2_0_la_LIBADD = @GLIB_LIBS@
|
||||
|
||||
|
||||
@@ -37,6 +37,14 @@ static const unsigned long _glibtop_sysdeps_cpu_smp =
|
||||
(1L << GLIBTOP_XCPU_NICE) + (1L << GLIBTOP_XCPU_SYS) +
|
||||
(1L << GLIBTOP_XCPU_IDLE);
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_cpu_2_6 =
|
||||
(1L << GLIBTOP_CPU_IOWAIT) + (1L << GLIBTOP_CPU_IRQ) +
|
||||
(1L << GLIBTOP_CPU_SOFTIRQ);
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_cpu_smp_2_6 =
|
||||
(1L << GLIBTOP_XCPU_IOWAIT) + (1L << GLIBTOP_XCPU_IRQ) +
|
||||
(1L << GLIBTOP_XCPU_SOFTIRQ);
|
||||
|
||||
/* Init function. */
|
||||
|
||||
void
|
||||
@@ -46,6 +54,15 @@ glibtop_init_cpu_s (glibtop *server)
|
||||
|
||||
if (server->ncpu)
|
||||
server->sysdeps.cpu |= _glibtop_sysdeps_cpu_smp;
|
||||
|
||||
|
||||
if(server->os_version_code >= LINUX_VERSION_CODE(2, 6, 0))
|
||||
{
|
||||
server->sysdeps.cpu |= _glibtop_sysdeps_cpu_2_6;
|
||||
|
||||
if (server->ncpu)
|
||||
server->sysdeps.cpu |= _glibtop_sysdeps_cpu_smp_2_6;
|
||||
}
|
||||
}
|
||||
|
||||
/* Provides information about cpu usage. */
|
||||
@@ -76,9 +93,15 @@ glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf)
|
||||
buf->idle = strtoull (p, &p, 0);
|
||||
|
||||
/* 2.6 kernel */
|
||||
buf->idle += strtoull(p, &p, 0); /* "iowait" */
|
||||
buf->sys += strtoull(p, &p, 0); /* "irq" */
|
||||
buf->sys += strtoull(p, &p, 0); /* "softirq" */
|
||||
if(server->os_version_code >= LINUX_VERSION_CODE(2, 6, 0))
|
||||
{
|
||||
buf->iowait = strtoull(p, &p, 0);
|
||||
buf->irq = strtoull(p, &p, 0);
|
||||
buf->softirq = strtoull(p, &p, 0);
|
||||
|
||||
buf->idle += buf->iowait;
|
||||
buf->sys += buf->irq + buf->softirq;
|
||||
}
|
||||
|
||||
buf->total = buf->user + buf->nice + buf->sys + buf->idle;
|
||||
|
||||
@@ -104,9 +127,15 @@ glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf)
|
||||
buf->xcpu_idle [i] = strtoull (p, &p, 0);
|
||||
|
||||
/* 2.6 kernel */
|
||||
buf->xcpu_idle [i] += strtoull(p, &p, 0); /* "iowait" */
|
||||
buf->xcpu_sys [i] += strtoull(p, &p, 0); /* "irq" */
|
||||
buf->xcpu_sys [i] += strtoull(p, &p, 0); /* "softirq" */
|
||||
if(server->os_version_code >= LINUX_VERSION_CODE(2, 6, 0))
|
||||
{
|
||||
buf->xcpu_iowait [i] = strtoull(p, &p, 0);
|
||||
buf->xcpu_irq [i] = strtoull(p, &p, 0);
|
||||
buf->xcpu_softirq [i] = strtoull(p, &p, 0);
|
||||
|
||||
buf->xcpu_idle [i] += buf->xcpu_iowait [i];
|
||||
buf->xcpu_sys [i] += buf->xcpu_irq [i] + buf->xcpu_softirq [i];
|
||||
}
|
||||
|
||||
buf->xcpu_total[i] = buf->xcpu_user [i] \
|
||||
+ buf->xcpu_nice [i] \
|
||||
@@ -116,4 +145,12 @@ glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf)
|
||||
|
||||
if(i >= 2) /* ok, that's a real SMP */
|
||||
buf->flags |= _glibtop_sysdeps_cpu_smp;
|
||||
|
||||
if(server->os_version_code >= LINUX_VERSION_CODE(2, 6, 0))
|
||||
{
|
||||
buf->flags |= _glibtop_sysdeps_cpu_2_6;
|
||||
|
||||
if(i >= 2) /* ok, that's a real SMP */
|
||||
buf->flags |= _glibtop_sysdeps_cpu_smp_2_6;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,85 +5,117 @@
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#include <mntent.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <linux/kdev_t.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
void _glibtop_linux_get_fsusage_read_write(glibtop *server,
|
||||
glibtop_fsusage *buf,
|
||||
const char *path);
|
||||
void
|
||||
G_GNUC_INTERNAL
|
||||
_glibtop_linux_get_fsusage_read_write(glibtop *server,
|
||||
glibtop_fsusage *buf,
|
||||
const char *path);
|
||||
|
||||
/*
|
||||
* Linux 2.6.x
|
||||
* linux/Documentation/iostats.txt
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
static char *
|
||||
get_partition(const char *mountpoint)
|
||||
{
|
||||
FILE *partitions;
|
||||
char *name = NULL;
|
||||
char line[1024];
|
||||
struct stat statb;
|
||||
|
||||
if(stat(mountpoint, &statb) == -1)
|
||||
return NULL;
|
||||
|
||||
g_return_val_if_fail((partitions = fopen("/proc/partitions", "r")), NULL);
|
||||
|
||||
while(fgets(line, sizeof line, partitions))
|
||||
{
|
||||
unsigned major, minor;
|
||||
char dev[32];
|
||||
|
||||
if(sscanf(line, "%u %u %*u %31s", &major, &minor, dev) != 3)
|
||||
continue;
|
||||
|
||||
if(MKDEV(major, minor) != statb.st_dev)
|
||||
continue;
|
||||
|
||||
name = g_strdup(dev);
|
||||
break;
|
||||
}
|
||||
|
||||
fclose(partitions);
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
static char *
|
||||
get_sys_path(const char *device)
|
||||
{
|
||||
if(g_str_has_prefix(device, "hd") || g_str_has_prefix(device, "sd"))
|
||||
{
|
||||
char *prefix;
|
||||
char *path;
|
||||
size_t offset;
|
||||
|
||||
offset = strcspn(device, "0123456789");
|
||||
|
||||
prefix = g_strdup(device);
|
||||
prefix [offset] = '\0';
|
||||
|
||||
path = g_strdup_printf("/sys/block/%s/%s/stat",
|
||||
prefix, device);
|
||||
|
||||
g_free(prefix);
|
||||
return path;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return g_strdup_printf("/sys/block/%s/stat", device);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void linux_2_6_0(glibtop *server, glibtop_fsusage *buf, const char *path)
|
||||
{
|
||||
FILE *mtab = setmntent("/etc/mtab", "r");
|
||||
char *device;
|
||||
char *filename;
|
||||
int ret;
|
||||
char buffer[BUFSIZ];
|
||||
char *p;
|
||||
|
||||
struct mntent *emnt;
|
||||
device = get_partition(path);
|
||||
if(!device) return;
|
||||
|
||||
while((emnt = getmntent(mtab)) != NULL)
|
||||
{
|
||||
if(strcmp(emnt->mnt_dir, path) == 0)
|
||||
{
|
||||
char filename[64]; /* magic */
|
||||
filename = get_sys_path(device);
|
||||
g_free(device);
|
||||
|
||||
char buffer[1024]; /* magic */
|
||||
char *p;
|
||||
ret = try_file_to_buffer(buffer, filename);
|
||||
g_free(filename);
|
||||
|
||||
char device[32]; /* magic */
|
||||
unsigned partition;
|
||||
if(ret < 0) return;
|
||||
|
||||
const char *devname = emnt->mnt_fsname;
|
||||
size_t offset;
|
||||
p = buffer;
|
||||
p = skip_token(p);
|
||||
buf->read = strtoull(p, &p, 0);
|
||||
p = skip_token(p);
|
||||
buf->write = strtoull(p, &p, 0);
|
||||
|
||||
/*
|
||||
we only deal with /dev block devices "/dev/<DEVICE><PARTITION>"
|
||||
i don't know if other block devices such as network block
|
||||
devices provide this kind of information.
|
||||
*/
|
||||
|
||||
if(!g_str_has_prefix(devname, "/dev/"))
|
||||
break;
|
||||
|
||||
/* skip the "/dev/" */
|
||||
devname += sizeof "/dev/" - 1;
|
||||
|
||||
g_strlcpy(device, devname, sizeof device);
|
||||
|
||||
offset = strcspn(devname, "0123456789");
|
||||
partition = strtoul(devname + offset, NULL, 0);
|
||||
|
||||
device[offset] = '\0';
|
||||
|
||||
if((size_t) g_snprintf(filename, sizeof filename,
|
||||
"/sys/block/%s/%s%u/stat",
|
||||
device, device, partition) >= sizeof filename)
|
||||
break;
|
||||
|
||||
|
||||
if(try_file_to_buffer(buffer, filename) < 0)
|
||||
break;
|
||||
|
||||
p = buffer;
|
||||
p = skip_token(p);
|
||||
buf->read = strtoull(p, &p, 0);
|
||||
p = skip_token(p);
|
||||
buf->write = strtoull(p, &p, 0);
|
||||
|
||||
buf->flags |= (1 << GLIBTOP_FSUSAGE_READ) | (1 << GLIBTOP_FSUSAGE_WRITE);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
endmntent(mtab);
|
||||
buf->flags |= (1 << GLIBTOP_FSUSAGE_READ) | (1 << GLIBTOP_FSUSAGE_WRITE);
|
||||
}
|
||||
|
||||
|
||||
@@ -92,9 +124,10 @@ static void linux_2_4_0(glibtop *server, glibtop_fsusage *buf, const char *path)
|
||||
}
|
||||
|
||||
|
||||
void _glibtop_linux_get_fsusage_read_write(glibtop *server,
|
||||
glibtop_fsusage *buf,
|
||||
const char *path)
|
||||
void G_GNUC_INTERNAL
|
||||
_glibtop_linux_get_fsusage_read_write(glibtop *server,
|
||||
glibtop_fsusage *buf,
|
||||
const char *path)
|
||||
{
|
||||
if(server->os_version_code >= LINUX_VERSION_CODE(2, 6, 0))
|
||||
{
|
||||
|
||||
@@ -32,6 +32,16 @@ get_scaled(const char *buffer, const char *key)
|
||||
}
|
||||
|
||||
|
||||
char *
|
||||
skip_token (const char *p)
|
||||
{
|
||||
p = next_token(p);
|
||||
while (*p && !isspace(*p)) p++;
|
||||
p = next_token(p);
|
||||
return (char *)p;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Read functions
|
||||
*/
|
||||
|
||||
@@ -40,14 +40,8 @@ next_token(const char *p)
|
||||
return (char*) p;
|
||||
}
|
||||
|
||||
static inline char *
|
||||
skip_token (const char *p)
|
||||
{
|
||||
p = next_token(p);
|
||||
while (*p && !isspace(*p)) p++;
|
||||
p = next_token(p);
|
||||
return (char *)p;
|
||||
}
|
||||
char * G_GNUC_INTERNAL
|
||||
skip_token (const char *p);
|
||||
|
||||
static inline char *
|
||||
skip_multiple_token (const char *p, size_t count)
|
||||
@@ -67,17 +61,17 @@ skip_line (const char *p)
|
||||
}
|
||||
|
||||
|
||||
unsigned long long
|
||||
unsigned long long G_GNUC_INTERNAL
|
||||
get_scaled(const char *buffer, const char *key);
|
||||
|
||||
|
||||
/* aborts on error */
|
||||
void
|
||||
void G_GNUC_INTERNAL
|
||||
file_to_buffer(glibtop *server, char *buffer, const char *filename);
|
||||
|
||||
/* return < 0 on error, otherwise 0 on success */
|
||||
int
|
||||
try_file_to_buffer(char *buffer, const char *format, ...);
|
||||
int G_GNUC_INTERNAL
|
||||
try_file_to_buffer(char *buffer, const char *format, ...) G_GNUC_PRINTF(2, 3);
|
||||
|
||||
|
||||
/* some inline functions that wrap proc path
|
||||
|
||||
@@ -44,5 +44,6 @@
|
||||
#define GLIBTOP_SUID_PROC_MAP 0
|
||||
#define GLIBTOP_SUID_NETLOAD 0
|
||||
#define GLIBTOP_SUID_PPP 0
|
||||
#define GLIBTOP_SUID_PROC_FILE 0
|
||||
|
||||
#endif /* __LINUX__GLIBTOP_SERVER_H__ */
|
||||
|
||||
271
sysdeps/linux/procopenfiles.c
Normal file
271
sysdeps/linux/procopenfiles.c
Normal file
@@ -0,0 +1,271 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 1998-99 Martin Baulig
|
||||
Copyright (C) 2004 Nicolás Lichtmaier
|
||||
This file is part of LibGTop 1.0.
|
||||
|
||||
Modified by Nicolás Lichtmaier to give a process open files.
|
||||
|
||||
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 <glibtop.h>
|
||||
#include <glibtop/error.h>
|
||||
#include <glibtop/procopenfiles.h>
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "glibtop_private.h"
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_proc_open_files =
|
||||
(1L << GLIBTOP_PROC_OPEN_FILES_NUMBER)|
|
||||
(1L << GLIBTOP_PROC_OPEN_FILES_TOTAL)|
|
||||
(1L << GLIBTOP_PROC_OPEN_FILES_SIZE);
|
||||
|
||||
/* Init function. */
|
||||
|
||||
void
|
||||
glibtop_init_proc_open_files_s (glibtop *server)
|
||||
{
|
||||
server->sysdeps.proc_open_files = _glibtop_sysdeps_proc_open_files;
|
||||
}
|
||||
|
||||
|
||||
|
||||
typedef void (*LineParser)(GHashTable *dict, const char *line);
|
||||
|
||||
|
||||
static void
|
||||
parse_file(const char *filename, LineParser parser, GHashTable *dict)
|
||||
{
|
||||
FILE *f;
|
||||
char line[1024];
|
||||
|
||||
f = fopen(filename, "r");
|
||||
|
||||
if(!f) {
|
||||
g_warning("Cannot open '%s'", filename);
|
||||
return;
|
||||
}
|
||||
|
||||
/* skip the first line */
|
||||
if(!fgets(line, sizeof line, f)) goto eof;
|
||||
|
||||
while(fgets(line, sizeof line, f))
|
||||
{
|
||||
parser(dict, line);
|
||||
}
|
||||
|
||||
eof:
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
|
||||
static GHashTable*
|
||||
get_all(const char *filename, LineParser parser)
|
||||
{
|
||||
GHashTable *dict;
|
||||
|
||||
dict = g_hash_table_new_full(g_direct_hash, g_direct_equal,
|
||||
NULL, g_free);
|
||||
|
||||
parse_file(filename, parser, dict);
|
||||
|
||||
return dict;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
struct InetSocketEntry
|
||||
{
|
||||
char host[GLIBTOP_OPEN_DEST_HOST_LEN + 1];
|
||||
int port;
|
||||
};
|
||||
|
||||
|
||||
static void
|
||||
inet_socket_parser(GHashTable *dict, const char* line)
|
||||
{
|
||||
struct InetSocketEntry *se;
|
||||
int sock;
|
||||
unsigned addr;
|
||||
|
||||
se = g_malloc0(sizeof *se);
|
||||
|
||||
if(sscanf(line, "%*d: %*x:%*x %8x:%4x %*x %*x:%*x %*x:%*x %*d %*d %*d %d",
|
||||
&addr, &se->port, &sock) != 3)
|
||||
goto error;
|
||||
|
||||
if(!inet_ntop(AF_INET, &addr, se->host, sizeof se->host))
|
||||
goto error;
|
||||
|
||||
g_hash_table_insert(dict, GINT_TO_POINTER(sock), se);
|
||||
return;
|
||||
|
||||
error:
|
||||
g_free(se);
|
||||
}
|
||||
|
||||
|
||||
static inline GHashTable *
|
||||
get_all_inet_sockets()
|
||||
{
|
||||
return get_all("/proc/net/tcp", inet_socket_parser);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
struct LocalSocketEntry
|
||||
{
|
||||
char name[GLIBTOP_OPEN_DEST_HOST_LEN + 1];
|
||||
};
|
||||
|
||||
|
||||
static void
|
||||
local_socket_parser(GHashTable *dict, const char *line)
|
||||
{
|
||||
int sock;
|
||||
struct LocalSocketEntry *use;
|
||||
char *p;
|
||||
|
||||
use = g_malloc0(sizeof *use);
|
||||
|
||||
/* dfaf1640: 00000003 00000000 00000000 0001 03 6457 /dev/log */
|
||||
p = skip_multiple_token(line, 6);
|
||||
|
||||
sock = strtoul(p, &p, 10);
|
||||
g_strlcpy(use->name, p, sizeof use->name);
|
||||
g_strstrip(use->name);
|
||||
g_hash_table_insert(dict, GINT_TO_POINTER(sock), use);
|
||||
}
|
||||
|
||||
|
||||
static inline GHashTable *
|
||||
get_all_local_sockets()
|
||||
{
|
||||
return get_all("/proc/net/unix", local_socket_parser);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Provides detailed information about a process' open files */
|
||||
|
||||
glibtop_open_files_entry *
|
||||
glibtop_get_proc_open_files_s (glibtop *server, glibtop_proc_open_files *buf, pid_t pid)
|
||||
{
|
||||
char fn [BUFSIZ];
|
||||
GArray *entries;
|
||||
GHashTable *inet_sockets = NULL, *local_sockets = NULL;
|
||||
struct dirent *direntry;
|
||||
DIR *dir;
|
||||
|
||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_OPEN_FILES, 0);
|
||||
|
||||
memset (buf, 0, sizeof (glibtop_proc_open_files));
|
||||
|
||||
sprintf (fn, "/proc/%d/fd", pid);
|
||||
|
||||
dir = opendir (fn);
|
||||
if (!dir) return NULL;
|
||||
|
||||
entries = g_array_new(FALSE, FALSE, sizeof(glibtop_open_files_entry));
|
||||
|
||||
while((direntry = readdir(dir))) {
|
||||
char tgt [BUFSIZ];
|
||||
int rv;
|
||||
glibtop_open_files_entry entry = {0};
|
||||
|
||||
if(direntry->d_name[0] == '.')
|
||||
continue;
|
||||
|
||||
g_snprintf(fn, sizeof fn, "/proc/%d/fd/%s",
|
||||
pid, direntry->d_name);
|
||||
|
||||
rv = readlink(fn, tgt, sizeof(tgt) - 1);
|
||||
if(rv < 0) continue;
|
||||
tgt[rv] = '\0';
|
||||
|
||||
entry.fd = atoi(direntry->d_name);
|
||||
|
||||
if(g_str_has_prefix(tgt, "socket:["))
|
||||
{
|
||||
int sockfd;
|
||||
struct InetSocketEntry *ise;
|
||||
struct LocalSocketEntry *lse;
|
||||
|
||||
if(!inet_sockets) inet_sockets = get_all_inet_sockets();
|
||||
if(!local_sockets) local_sockets = get_all_local_sockets();
|
||||
|
||||
sockfd = atoi(tgt + 8);
|
||||
|
||||
ise = g_hash_table_lookup(inet_sockets,
|
||||
GINT_TO_POINTER(sockfd));
|
||||
|
||||
if(ise) {
|
||||
entry.type = GLIBTOP_FILE_TYPE_INETSOCKET;
|
||||
entry.info.sock.dest_port = ise->port;
|
||||
g_strlcpy(entry.info.sock.dest_host, ise->host,
|
||||
sizeof entry.info.sock.dest_host);
|
||||
goto found;
|
||||
}
|
||||
|
||||
lse = g_hash_table_lookup(local_sockets,
|
||||
GINT_TO_POINTER(sockfd));
|
||||
|
||||
if(lse) {
|
||||
entry.type = GLIBTOP_FILE_TYPE_LOCALSOCKET;
|
||||
g_strlcpy(entry.info.localsock.name, lse->name,
|
||||
sizeof entry.info.localsock.name);
|
||||
goto found;
|
||||
}
|
||||
|
||||
found:
|
||||
(void)0; /* kills warning */
|
||||
}
|
||||
else if(g_str_has_prefix(tgt, "pipe:["))
|
||||
{
|
||||
entry.type = GLIBTOP_FILE_TYPE_PIPE;
|
||||
}
|
||||
else
|
||||
{
|
||||
entry.type = GLIBTOP_FILE_TYPE_FILE;
|
||||
g_strlcpy(entry.info.file.name, tgt, sizeof entry.info.file.name);
|
||||
}
|
||||
|
||||
g_array_append_val(entries, entry);
|
||||
}
|
||||
|
||||
closedir (dir);
|
||||
|
||||
if(inet_sockets) g_hash_table_destroy(inet_sockets);
|
||||
if(local_sockets) g_hash_table_destroy(local_sockets);
|
||||
|
||||
buf->flags = _glibtop_sysdeps_proc_open_files;
|
||||
buf->number = entries->len;
|
||||
buf->size = sizeof(glibtop_open_files_entry);
|
||||
buf->total = buf->number * buf->size;
|
||||
|
||||
return (glibtop_open_files_entry*)g_array_free(entries, FALSE);
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
.deps
|
||||
.libs
|
||||
Makefile
|
||||
Makefile.in
|
||||
libgtop_names.la
|
||||
so_locations
|
||||
*.lo
|
||||
@@ -1,15 +0,0 @@
|
||||
|
||||
INCLUDES = @INCLUDES@
|
||||
|
||||
noinst_LTLIBRARIES = libgtop_names-2.0.la
|
||||
|
||||
libgtop_names_2_0_la_SOURCES = cpu.c mem.c swap.c uptime.c loadavg.c \
|
||||
shm_limits.c msg_limits.c sem_limits.c \
|
||||
proclist.c sysdeps.c procstate.c procuid.c \
|
||||
proctime.c procmem.c procsignal.c \
|
||||
prockernel.c procsegment.c fsusage.c \
|
||||
mountlist.c procargs.c procmap.c netload.c \
|
||||
ppp.c netlist.c
|
||||
|
||||
libgtop_names_2_0_la_LDFLAGS = $(LT_VERSION_INFO)
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
/* $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 <glibtop/cpu.h>
|
||||
#include "libgtop-i18n.h"
|
||||
|
||||
const char *glibtop_names_cpu [GLIBTOP_MAX_CPU] =
|
||||
{
|
||||
"total", "user", "nice", "sys", "idle", "frequency",
|
||||
"xcpu_total", "xcpu_user", "xcpu_nice", "xcpu_sys",
|
||||
"xcpu_idle", "xcpu_flags"
|
||||
};
|
||||
|
||||
const unsigned glibtop_types_cpu [GLIBTOP_MAX_CPU] =
|
||||
{
|
||||
GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG,
|
||||
GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG,
|
||||
GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG,
|
||||
GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG
|
||||
};
|
||||
|
||||
const char *glibtop_labels_cpu [GLIBTOP_MAX_CPU] =
|
||||
{
|
||||
N_("Total CPU Time"),
|
||||
N_("CPU Time in User Mode"),
|
||||
N_("CPU Time in User Mode (nice)"),
|
||||
N_("CPU Time in System Mode"),
|
||||
N_("CPU Time in the Idle Task"),
|
||||
N_("Tick Frequency"),
|
||||
N_("SMP Total CPU Time"),
|
||||
N_("SMP CPU Time in User Mode"),
|
||||
N_("SMP CPU Time in User Mode (nice)"),
|
||||
N_("SMP CPU Time in System Mode"),
|
||||
N_("SMP CPU Time in the Idle Task"),
|
||||
N_("SMP CPU Flags")
|
||||
};
|
||||
|
||||
const char *glibtop_descriptions_cpu [GLIBTOP_MAX_CPU] =
|
||||
{
|
||||
N_("Number of clock ticks since system boot"),
|
||||
N_("Number of clock ticks the system spent in user mode"),
|
||||
N_("Number of clock ticks the system spent in user mode (nice)"),
|
||||
N_("Number of clock ticks the system spent in system mode"),
|
||||
N_("Number of clock ticks the system spent in the idle task"),
|
||||
N_("Tick frequency (default is 100)"),
|
||||
N_("Number of clock ticks since system boot"),
|
||||
N_("Number of clock ticks the system spent in user mode"),
|
||||
N_("Number of clock ticks the system spent in user mode (nice)"),
|
||||
N_("Number of clock ticks the system spent in system mode"),
|
||||
N_("Number of clock ticks the system spent in the idle task"),
|
||||
N_("Bit field indicating which CPU is currently running"),
|
||||
};
|
||||
@@ -1,56 +0,0 @@
|
||||
/* $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 <glibtop/fsusage.h>
|
||||
#include "libgtop-i18n.h"
|
||||
|
||||
const char *glibtop_names_fsusage [GLIBTOP_MAX_FSUSAGE] =
|
||||
{
|
||||
"blocks", "bfree", "bavail", "files", "ffree", "block_size"
|
||||
};
|
||||
|
||||
const unsigned glibtop_types_fsusage [GLIBTOP_MAX_FSUSAGE] =
|
||||
{
|
||||
GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG,
|
||||
GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_INT
|
||||
};
|
||||
|
||||
const char *glibtop_labels_fsusage [GLIBTOP_MAX_FSUSAGE] =
|
||||
{
|
||||
N_("Total blocks"),
|
||||
N_("Free blocks"),
|
||||
N_("Available blocks"),
|
||||
N_("Total file nodes"),
|
||||
N_("Free file nodes"),
|
||||
N_("Block size")
|
||||
};
|
||||
|
||||
const char *glibtop_descriptions_fsusage [GLIBTOP_MAX_FSUSAGE] =
|
||||
{
|
||||
N_("Total blocks"),
|
||||
N_("Free blocks available to the superuser"),
|
||||
N_("Free blocks available to non-superusers"),
|
||||
N_("Total file nodes"),
|
||||
N_("Free file nodes"),
|
||||
N_("Block size")
|
||||
};
|
||||
@@ -1,52 +0,0 @@
|
||||
/* $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 <glibtop/loadavg.h>
|
||||
#include "libgtop-i18n.h"
|
||||
|
||||
const char *glibtop_names_loadavg [GLIBTOP_MAX_LOADAVG] =
|
||||
{
|
||||
"loadavg", "nr_running", "nr_tasks", "last_pid"
|
||||
};
|
||||
|
||||
const unsigned glibtop_types_loadavg [GLIBTOP_MAX_LOADAVG] =
|
||||
{
|
||||
GLIBTOP_TYPE_DOUBLE, GLIBTOP_TYPE_ULONG,
|
||||
GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG
|
||||
};
|
||||
|
||||
const char *glibtop_labels_loadavg [GLIBTOP_MAX_LOADAVG] =
|
||||
{
|
||||
N_("Load Average"),
|
||||
N_("Running Tasks"),
|
||||
N_("Number of Tasks"),
|
||||
N_("Last PID")
|
||||
};
|
||||
|
||||
const char *glibtop_descriptions_loadavg [GLIBTOP_MAX_LOADAVG] =
|
||||
{
|
||||
N_("Number of jobs running simultaneously averaged over 1, 5 and 15 minutes"),
|
||||
N_("Number of tasks currently running"),
|
||||
N_("Total number of tasks"),
|
||||
N_("Last PID")
|
||||
};
|
||||
@@ -1,62 +0,0 @@
|
||||
/* $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 <glibtop/mem.h>
|
||||
#include "libgtop-i18n.h"
|
||||
|
||||
const char *glibtop_names_mem [GLIBTOP_MAX_MEM] =
|
||||
{
|
||||
"total", "used", "free", "shared", "buffer",
|
||||
"cached", "user", "locked"
|
||||
};
|
||||
|
||||
const unsigned glibtop_types_mem [GLIBTOP_MAX_MEM] =
|
||||
{
|
||||
GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG,
|
||||
GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG,
|
||||
GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG
|
||||
};
|
||||
|
||||
const char *glibtop_labels_mem [GLIBTOP_MAX_MEM] =
|
||||
{
|
||||
N_("Total Memory"),
|
||||
N_("Used Memory"),
|
||||
N_("Free Memory"),
|
||||
N_("Shared Memory"),
|
||||
N_("Buffers"),
|
||||
N_("Cached"),
|
||||
N_("User"),
|
||||
N_("Locked"),
|
||||
};
|
||||
|
||||
const char *glibtop_descriptions_mem [GLIBTOP_MAX_MEM] =
|
||||
{
|
||||
N_("Total physical memory in kB"),
|
||||
N_("Used memory size in kB"),
|
||||
N_("Free memory size in kB"),
|
||||
N_("Shared memory size in kB"),
|
||||
N_("Size of buffers kB"),
|
||||
N_("Size of cached memory in kB"),
|
||||
N_("Memory used from user processes in kB"),
|
||||
N_("Memory in locked pages in kB")
|
||||
};
|
||||
@@ -1,49 +0,0 @@
|
||||
/* $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 <glibtop/mountlist.h>
|
||||
#include "libgtop-i18n.h"
|
||||
|
||||
const char *glibtop_names_mountlist [GLIBTOP_MAX_MOUNTLIST] =
|
||||
{
|
||||
"number", "total", "size"
|
||||
};
|
||||
|
||||
const unsigned glibtop_types_mountlist [GLIBTOP_MAX_MOUNTLIST] =
|
||||
{
|
||||
GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG
|
||||
};
|
||||
|
||||
const char *glibtop_labels_mountlist [GLIBTOP_MAX_MOUNTLIST] =
|
||||
{
|
||||
N_("Number of list elements"),
|
||||
N_("Total size of list"),
|
||||
N_("Size of a single list element")
|
||||
};
|
||||
|
||||
const char *glibtop_descriptions_mountlist [GLIBTOP_MAX_MOUNTLIST] =
|
||||
{
|
||||
N_("Number of list elements"),
|
||||
N_("Total size of list"),
|
||||
N_("Size of a single list element")
|
||||
};
|
||||
@@ -1,59 +0,0 @@
|
||||
/* $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 <glibtop/msg_limits.h>
|
||||
#include "libgtop-i18n.h"
|
||||
|
||||
const char *glibtop_names_msg_limits [GLIBTOP_MAX_MSG_LIMITS] =
|
||||
{
|
||||
"msgpool", "msgmap", "msgmax", "msgmnb", "msgmni", "msgssz", "msgtql"
|
||||
};
|
||||
|
||||
const unsigned glibtop_types_msg_limits [GLIBTOP_MAX_MSG_LIMITS] =
|
||||
{
|
||||
GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG,
|
||||
GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG,
|
||||
GLIBTOP_TYPE_ULONG
|
||||
};
|
||||
|
||||
const char *glibtop_labels_msg_limits [GLIBTOP_MAX_MSG_LIMITS] =
|
||||
{
|
||||
N_("Size in kilobytes of message pool"),
|
||||
N_("Number of entries in message map"),
|
||||
N_("Max size of message"),
|
||||
N_("Default max size of queue"),
|
||||
N_("Max queues system wide"),
|
||||
N_("Message segment size"),
|
||||
N_("Number of system message headers")
|
||||
};
|
||||
|
||||
const char *glibtop_descriptions_msg_limits [GLIBTOP_MAX_MSG_LIMITS] =
|
||||
{
|
||||
N_("Size in kilobytes of message pool"),
|
||||
N_("Number of entries in message map"),
|
||||
N_("Max size of message"),
|
||||
N_("Default max size of queue"),
|
||||
N_("Max queues system wide"),
|
||||
N_("Message segment size"),
|
||||
N_("Number of system message headers")
|
||||
};
|
||||
@@ -1,84 +0,0 @@
|
||||
/* $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 <glibtop/netload.h>
|
||||
#include "libgtop-i18n.h"
|
||||
|
||||
const char *glibtop_names_netload [GLIBTOP_MAX_NETLOAD] =
|
||||
{
|
||||
"if_flags", "mtu", "subnet", "address", "packets_in",
|
||||
"packets_out", "packets_total", "bytes_in", "bytes_out",
|
||||
"bytes_total", "errors_in", "errors_out", "errors_total",
|
||||
"collisions", "address6", "prefix6", "scope6"
|
||||
};
|
||||
|
||||
const unsigned glibtop_types_netload [GLIBTOP_MAX_NETLOAD] =
|
||||
{
|
||||
GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG,
|
||||
GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG,
|
||||
GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG,
|
||||
GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG,
|
||||
GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG
|
||||
};
|
||||
|
||||
const char *glibtop_labels_netload [GLIBTOP_MAX_NETLOAD] =
|
||||
{
|
||||
N_("Interface Flags"),
|
||||
N_("MTU"),
|
||||
N_("IPv4 Subnet"),
|
||||
N_("IPv4 Address"),
|
||||
N_("Packets In"),
|
||||
N_("Packets Out"),
|
||||
N_("Packets Total"),
|
||||
N_("Bytes In"),
|
||||
N_("Bytes Out"),
|
||||
N_("Bytes Total"),
|
||||
N_("Errors In"),
|
||||
N_("Errors Out"),
|
||||
N_("Errors Total"),
|
||||
N_("Collisions"),
|
||||
N_("IPv6 Address"),
|
||||
N_("IPv6 Prefix"),
|
||||
N_("IPv6 Scope")
|
||||
};
|
||||
|
||||
const char *glibtop_descriptions_netload [GLIBTOP_MAX_NETLOAD] =
|
||||
{
|
||||
N_("Interface Flags"),
|
||||
N_("Maximum Transfer Unit"),
|
||||
N_("IPv4 Subnet"),
|
||||
N_("IPv4 Address"),
|
||||
N_("Packets In"),
|
||||
N_("Packets Out"),
|
||||
N_("Packets Total"),
|
||||
N_("Bytes In"),
|
||||
N_("Bytes Out"),
|
||||
N_("Bytes Total"),
|
||||
N_("Errors In"),
|
||||
N_("Errors Out"),
|
||||
N_("Errors Total"),
|
||||
N_("Collisions"),
|
||||
N_("IPv6 Address"),
|
||||
N_("IPv6 Prefix"),
|
||||
N_("IPv6 Scope")
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user