Commit Graph

25 Commits

Author SHA1 Message Date
Martin Baulig
de5137ff28 Define this here. Moved to limits.h.
1999-05-08  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/limits.h (GLIBTOP_MAX_GROUPS): Define this here.
	* include/glibtop/procuid.h (GLIBTOP_MAX_GROUPS): Moved to limits.h.

	* features.def: We can use constants from <glibtop/limits.h> here.
1999-05-08 19:53:31 +00:00
Martin Baulig
1cec9b70a2 Thanks to Drazen Kacar for pointing out that not all processors must be
1999-04-18  Martin Baulig  <martin@home-of-linux.org>

	Thanks to Drazen Kacar for pointing out that not all processors must
	be running all the time under Solaris, so we need to have some flag
	to find out which processors are running.

	* (glibtop_cpu): Added `xcpu_flags' bitmask of running processors.
	* (glibtop_proc_time): Added `xcpu_flags'.
1999-04-18 11:47:58 +00:00
Martin Baulig
ede4594dd9 Added some new features.
1999-03-30  Martin Baulig  <martin@home-of-linux.org>

	Added some new features.

	* (glibtop_uptime): Added `boot_time', boot time in seconds
	since the epoch.

	* (glibtop_proc_state): Changed `state' from char to unsigned.
	`uid' and `gid' are effective uid and gid; added comment.
	Added `ruid' and `rgid' for guaranteed-to-be-correct real uid/gid.
	For SMP systems: added `has_cpu', `processor' and `last_processor'.

	* (glibtop_proc_uid): Added suid, sgid, fsuid, fsgid, ngroups, groups.

	* (glibtop_proc_segment): Added start_data, end_data, start_brk,
	end_brk, start_mmap, arg_start, arg_end, env_start, env_end.

	* include/glibtop/procstate.h: Define some constants for the `state'
	field of glibtop_proc_state.

	* include/glibtop/prockernel.h: Define some constands for the
	`k_flags' field of glibtop_proc_kernel.
1999-03-31 16:53:05 +00:00
Martin Baulig
1520ee7083 Make the return value a char *' instead of a const char *'.
1998-12-09  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/procargs.h (glibtop_get_proc_args): Make the
	return value a `char *' instead of a `const char *'.
1998-12-09 11:38:49 +00:00
Martin Baulig
2795790ab6 Sync. 1998-12-08 18:52:00 +00:00
Martin Baulig
b70d0570c7 More network load stuff. 1998-10-26 12:21:28 +00:00
Martin Baulig
13d9120f93 Some systems may not distinguish between input and output bytes/pkts/errs
so we add `_total' fields:

typedef struct _glibtop_netload	glibtop_netload;

struct _glibtop_netload
{
	u_int64_t	flags,
		mtu,			/* GLIBTOP_NETLOAD_MTU		*/
		address,		/* GLIBTOP_NETLOAD_ADDRESS	*/
		packets_in,		/* GLIBTOP_NETLOAD_PACKETS_IN	*/
		packets_out,		/* GLIBTOP_NETLOAD_PACKETS_OUT	*/
		packets_total,		/* GLIBTOP_NETLOAD_PACKETS_TOTAL*/
		bytes_in,		/* GLIBTOP_NETLOAD_BYTES_IN	*/
		bytes_out,		/* GLIBTOP_NETLOAD_BYTES_OUT	*/
		bytes_total,		/* GLIBTOP_NETLOAD_BYTES_TOTAL	*/
		errors_in,		/* GLIBTOP_NETLOAD_ERRORS_IN	*/
		errors_out,		/* GLIBTOP_NETLOAD_ERRORS_OUT	*/
		errors_total,		/* GLIBTOP_NETLOAD_ERRORS_TOTAL	*/
		collisions;		/* GLIBTOP_NETLOAD_COLLISIONS	*/
};
1998-10-26 10:44:16 +00:00
Martin Baulig
1289b92d06 Added new features to get network load:
typedef struct _glibtop_netload	glibtop_netload;

struct _glibtop_netload
{
	u_int64_t	flags,
		mtu,			/* GLIBTOP_NETLOAD_MTU		*/
		address,		/* GLIBTOP_NETLOAD_ADDRESS	*/
		packets_in,		/* GLIBTOP_NETLOAD_PACKETS_IN	*/
		packets_out,		/* GLIBTOP_NETLOAD_PACKETS_OUT	*/
		bytes_in,		/* GLIBTOP_NETLOAD_BYTES_IN	*/
		bytes_out,		/* GLIBTOP_NETLOAD_BYTES_OUT	*/
		errors_in,		/* GLIBTOP_NETLOAD_ERRORS_IN	*/
		errors_out,		/* GLIBTOP_NETLOAD_ERRORS_OUT	*/
		collisions;		/* GLIBTOP_NETLOAD_COLLISIONS	*/
};

Returns network load of the given interface, it is specified as string
like `isppp' or `ippp0':

extern void glibtop_get_netload_l __P((glibtop *, glibtop_netload *, const char *));
1998-10-26 10:39:14 +00:00
Martin Baulig
bdc4e08454 Added new feature (proc_args) to get command line arguments:
typedef struct _glibtop_proc_args	glibtop_proc_args;

struct _glibtop_proc_args
{
	u_int64_t	flags,
		size;			/* GLIBTOP_PROC_ARGS_SIZE	*/
};

Returns a string containing all command line arguments of the process,
the `unsigned' parameter is the maximum length of this string; if it
is zero then no limit will be set.

extern const char  *glibtop_get_proc_args_l __P((glibtop *, glibtop_proc_args *, pid_t, unsigned));
1998-10-26 09:53:08 +00:00
Martin Baulig
9114af9fdf Added new feature to get PPP/ISDN support:
enum {
	GLIBTOP_PPP_STATE_UNKNOWN = 0,
	GLIBTOP_PPP_STATE_HANGUP,
	GLIBTOP_PPP_STATE_ONLINE
};

struct _glibtop_ppp
{
	u_int64_t	flags,
		state,			/* GLIBTOP_PPP_STATE		*/
		bytes_in,		/* GLIBTOP_PPP_BYTES_IN		*/
		bytes_out;		/* GLIBTOP_PPP_BYTES_OUT	*/
};

Currently only implemented in the FreeBSD port with ISDN via I4B. - Martin
1998-10-25 17:07:16 +00:00
Martin Baulig
afe57f9ee9 Use a 2-element-array of type `u_int64_t' for all signal masks instead of
1998-10-20  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/proc_signal.h: Use a 2-element-array of
	type `u_int64_t' for all signal masks instead of just
	scalar numbers. This avoids problems on systems with more
	than 64 signals.

	If there is any operating system out there with even more than
	128 signals, we can simply increase the number of array elements
	here.

	[NOTE for people porting libgtop:

 	 Please use all 64 bits of the `u_int64_t' and not just 32 - the
	 signal number (as it is used in calls to kill () ...) should be
	 a bit-index into this field; if a process ignores for instance
	 signal 64, it has the 0-bit of sigcatch[1] set, if it ignores 63,
	 this is the 63-bit of sigcatch[0] and so on ...

	 The mapping between signal numbers and their names is done via the
	 glibtop_sys_siglist [] field which should be declared in
	 sysdeps/@sysdeps_dir@/siglist.c - see linux for an example.
	]

	* features.def: It's now safe to put things like `loadavg[3]'
	here - the awk skripts should correctly threat this as an array.
1998-10-20 20:08:49 +00:00
Martin Baulig
a0b502df75 Merged from `LIBGTOP_0_25_PATCHES'. 1998-08-23 12:26:32 +00:00
Martin Baulig
b40e08fb74 Added new fields nr_running', nr_tasks', `last_pid'. Added new fields
1998-08-16  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/loadavg.h (glibtop_loadavg): Added new
	fields `nr_running', `nr_tasks', `last_pid'.
	* features.def (loadavg): Added new fields `nr_running',
	`nr_tasks', `last_pid'.
1998-08-16 13:40:01 +00:00
Martin Baulig
9248d72018 Using text_rss', shlib_rss', data_rss' and dirty_size' instead of
1998-08-12  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/procsegment.h (glibtop_proc_segment): Using
	`text_rss', `shlib_rss', `data_rss' and `dirty_size' instead of
	`tsr', `lrs', `drs' and `dt'. New field `stack_rss'.

	* sysdeps/linux/procmem.c: Memory sizes now correctly in bytes.
	* sysdeps/linux/procsegment.c: Dito.

	* sysdeps/kernel/procsegment.c: Stack pages are reported via
	`stack_rss' and no longer count towards `data_rss'
	* kernel/table.h (table_proc_segment): Added `srs' field.
	* kernel/table21/module.c (TBL_PROC_SEGMENT): Added kernel support
	for this.

	* sysdeps/{linux, kernel, stub}/procmap.c: New files.
1998-08-12 20:16:24 +00:00
Martin Baulig
d9361d388c New file. Added definition of `proc_map'.
1998-08-10  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/procmap.h (glibtop_proc_map): New file.
	* features.def: Added definition of `proc_map'.
1998-08-10 16:57:44 +00:00
Martin Baulig
8b8ceec1bf Added new fields rtime' and frequency'.
1998-08-10  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/proctime.h (glibtop_proc_time): Added new
	fields `rtime' and `frequency'.
1998-08-10 08:08:51 +00:00
Martin Baulig
32c0ced22a Renamed wchan' field to nwchan'; added wchan' which is of type char
1998-08-09  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/prockernel.h (glibtop_proc_kernel): Renamed
	`wchan' field to `nwchan'; added `wchan' which is of type `char [40]'.
1998-08-09 21:11:18 +00:00
Martin Baulig
fd95ab60a4 Changed format of this file to support multiple arguments to be passed to
1998-08-09  Martin Baulig  <martin@home-of-linux.org>

	* features.def: Changed format of this file to support multiple
	arguments to be passed to a function.

	* include/glibtop/proclist.h: `glibtop_get_proclist' now takes two
	more arguments `method' and `param'.
1998-08-09 17:08:59 +00:00
Martin Baulig
2e454140f1 Added pagein' and pageout'.
1998-08-01  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/swap.h (glibtop_swap): Added `pagein' and `pageout'.

	* kernel/table20/table.h: Removed.
	* kernel/table21/table.h: Removed.
	* kernel/table.h: Added. Things are now binary compatible between
	both kernel versions.
1998-08-01 22:03:11 +00:00
Martin Baulig
f07551a43d New file.
1998-07-29  Martin Baulig  <martin@home-of-linux.org>

	* guile/ChangeLog: New file.

	* features.def: New format - now includes type of return value
	and parameters.

	* lib/lib.awk: Changed to use new `features.def'.
	* sysdeps/guile/guile.awk: Dito;
	* sysdeps/guile/names/guile-names.awk: Dito.

	* libgtopConf.sh.in: Added
	`LIBGTOP_NAMES_LIBS', `LIBGTOP_NAMES_INCS',
	`LIBGTOP_GUILE_NAMES_LIBS', `LIBGTOP_GUILE_NAMES_INCS',
	`LIBGTOP_MAJOR_VERSION', `LIBGTOP_MINOR_VERSION'
	`LIBGTOP_VERSION', `libgtop_sysdeps_dir'.

	* acinclude.m4 (AC_LC_SYSDEPS): Removed since this has been
	replaced with `GNOME_LIBGTOP_SYSDEPS' long ago.

	* LIBGTOP-VERSION: New file.

	* */Makefile.am (INCLUDES): Removed; now defined in `configure.in'.

	* sysdeps/names/mountlist.c: New file.

	* lib/{init, open}.c (GTOP_SERVER): Renamed to `LIBGTOP_SERVER'.

	* configure.in (INCLUDES): Added definition.
	(libgtop_want_names): Always true; `libgtop_names.la' is now
	always created since some other programs rely upon it - but
	have to use `LIBGTOP_NAMES_LIBS' and `LIBGTOP_NAMES_INCS' to
	use it in your application.
	(libgtop_want_guile_names): Always true; but you have to use
	`LIBGTOP_GUILE_NAMES_LIBS' and `LIBGTOP_GUILE_NAMES_INCS' to
	use it in your application.
	(LIBGTOP_LIBS): Removed `-lgtop_names' and `-lgtop_guile_names'.
	(LIBGTOP_NAMES_LIBS): New variable. Use it to link your
	application with the names interface.
	(LIBGTOP_NAMES_INCS): New variable. Also #defines `GLIBTOP_NAMES'
	which is now required if your application wants to use the names
	interface.
	(LIBGTOP_GUILE_NAMES_LIBS): New variable. Use it to link your
	application with the guile names interface.
	(LIBGTOP_GUILE_NAMES_INCS): New variable. Also #defines
	`GLIBTOP_NAMES' and `GLIBTOP_GUILE_NAMES' which are now required
	if your application wants to use the guile names interface.
1998-07-29 22:01:31 +00:00
Martin Baulig
954a78f200 New file.
1998-07-22  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/fsusage.h: New file.

	* features.def: Added new feature `fsusage'.

	* sysdeps/common/fsusage.c (glibtop_get_fsusage_s): New function.
	(get_fs_usage): Declared as `static'.

	* sysdeps/names/fsusage.c: New file.
1998-07-22 22:56:09 +00:00
Martin Baulig
6bf243c901 New file.
1998-07-22  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/mountlist.h: New file.

	* features.def: Added new feature `mountlist'.

	* sysdeps/common/mountlist.c (glibtop_get_mountlist_s): New function.
	(read_filesystem_list): Declared as `static'.
1998-07-22 20:52:42 +00:00
Martin Baulig
5e97af535f Summary of this long ChangeLog:
* Splitted `libgtop_sysdeps.la' into `libgtop_sysdeps.la' and
   `libgtop_sysdeps_suid.la'.

   Everything that needs to be suid/sgid is in `libgtop_sysdeps_suid.la'
   and the rest in `libgtop_sysdeps.la'.

   The functions from `libgtop_sysdeps_suid.la' have the `_p' prefix and
   the ones from `libgtop_sysdeps.la' the `_s' prefix.

   The suid library uses `glibtop_open_p' and `glibtop_close_p', the
   normal one `glibtop_init_s' (found in lib/init.c), `glibtop_open_s'
   and `glibtop_close_s'.

 * Added `libgtop_suid_common.la' containing stuff from sysdeps/common
   that is required from the suid server (currently everything from
   error.c and xmalloc.c).

   This means, we can add some more stuff to `libgtop_common.la' without
   the risk that it may be dangerous in the suid server.

 * The ``library order'' is much clearer now:

   -> `libgtop.la' (from lib/) contains user-level stuff;
      all functions except `glibtop_init_r' have the `_l'
      suffix.

   -> `libgtop_common.la' (from sysdeps/common/) contains stuff
      that is common among the sysdeps directories.
      use anything from `libgtop_sysdeps.la' and
      `libgtop_sysdeps_suid.la'.

   -> `libgtop_sysdeps.la' (from sysdeps/<sysdeps_dir>/) contains
      everything from the sysdeps directory that doesn't need to
      be suid/sgid.

   -> `libgtop_suid_common.la' (from sysdeps/common/) is used from
      the suid server instead of `libgtop_common.la'.

   -> `libgtop_sysdeps_suid.la' (from sysdeps/<sysdeps_dir>/) contains
      everything from the sysdeps directory that needs to be in the
      suid server.

 * To summarize: the server is linked only with functions that need
   to be suid and everything else is linked only with functions that
   do not need to be suid.

Martin

1998-07-22  Martin Baulig  <martin@home-of-linux.org>

	* lib/init.c (glibtop_init_s): Added this init function of
	the sysdeps directory `libgtop_sysdeps.la'.

	* lib/open.c (glibtop_open_l): Unconditionally calling
	`glibtop_init_s' after server initialization.

	* lib/lib.awk: Removed references to functions from
	`libgtop_sysdeps_suid.la' to avoid undefined symbols.

	* sysdeps/stub/open.c (glibtop_open_s): Renamed this
	function from `glibtop_open_r'.

	* sysdeps/stub/close.c (glibtop_close_s): Renamed this
	function from `glibtop_close_l'.

	* sysdeps/kernel/open.c (glibtop_open_s): Renamed this
	function from `glibtop_open_r'.

	* sysdeps/kernel/close.c (glibtop_close_s): Renamed this
	function from `glibtop_close_l'.

	* sysdeps/linux/open.c (glibtop_open_s): Renamed this
	function from `glibtop_open_r'.

	* sysdeps/linux/close.c (glibtop_close_s): Renamed this
	function from `glibtop_close_l'.

	* sysdeps/osf1/Makefile.am (lib_LTLIBRARIES): Added
	`libgtop_sysdeps_suid.la' for the suid server.

	* sysdeps/osf1/open_suid.c (glibtop_open_p): New file.
	Contains all stuff that was formerly in `open.c'.

	* sysdeps/osf1/open.c: Moved everything from here into
	the new file `open_suid.c'.

	* sysdeps/osf1/open.c (glibtop_open_s): New function.

	* sysdeps/osf1/close_suid.c (glibtop_close_p): New file.

	* sysdeps/osf1/close.c (glibtop_close_s): New function.

	* sysdeps/osf1/*.c: Using the new init, open and close
	functions.

	* sysdeps/sun4/Makefile.am (lib_LTLIBRARIES): Added
	`libgtop_sysdeps_suid.la' for the suid server.

	* sysdeps/sun4/nosuid.c (glibtop_open_s, glibtop_close_s): New file

	* sysdeps/sun4/*.c: All functions now have the `_p' suffix.

	* sysdeps/common/Makefile.am (lib_LTLIBRARIES): Added
	`libgtop_suid_common.la' which only contains stuff that is
	needed in the suid parts.

	* sysdeps/common/xmalloc.c: Using `glibtop_error_io_r' instead
	of `glibtop_error_r'.

	* sysdeps/{kernel, linux, osf1, sun4, stub}/init.c: Removed.
	`glibtop_init_s' has been moved into `lib/init.c' since it's the
	same in all the sysdeps directories.

	* src/server/main.c: It is now an error to request a feature that
	does not need the suid server.

	* src/proxy: Removed.
1998-07-22 09:26:43 +00:00
Martin Baulig
13148c632f New file. Creates gulie.c' depending upon features.def'.
1998-06-14  Martin Baulig  <martin@home-of-linux.org>

	* sysdeps/guile/guile.awk: New file.
	Creates `gulie.c' depending upon `features.def'.

	* sysdeps/guile/*.c: Removed.
1998-06-14 00:57:03 +00:00
Martin Baulig
6fd3c113ec List of features for `guile-names.awk'.
1998-06-13  Martin Baulig  <martin@home-of-linux.org>

	* features.def: List of features for `guile-names.awk'.

	* sysdeps/guile/names/guile-names.awk: New file.
	Creates `guile-names.c' depending upon `features.def'.

	* sysdeps/guile/names/*.c: Removed.
1998-06-13 22:53:55 +00:00