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));
This commit is contained in:
Martin Baulig
1998-10-26 09:53:08 +00:00
parent 65e3bf19ab
commit bdc4e08454
35 changed files with 575 additions and 26 deletions

View File

@@ -35,6 +35,7 @@ static void
output (pid_t pid)
{
glibtop_union data;
char *args;
#if HAVE_LIBGTOP_SMP
unsigned long total;
double p_total, p_utime, p_stime;
@@ -135,6 +136,17 @@ output (pid_t pid)
printf ("\n");
args = glibtop_get_proc_args (&data.proc_args, pid, 0);
printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", (int) pid,
(unsigned long) data.proc_args.flags,
(unsigned long) data.proc_args.size,
args);
glibtop_free (args);
printf ("\n");
#if HAVE_LIBGTOP_SMP
ncpu = glibtop_global_server->ncpu;