Compare commits

..

6 Commits

Author SHA1 Message Date
Benoît Dejean
9d2131a4b5 Released 2.13.2.
* NEWS:
	* configure.in:

	Released 2.13.2.
2006-01-02 13:13:11 +00:00
James Henstridge
7d3059e732 add quotes around symbol definition.
2006-01-02  James Henstridge  <james@jamesh.id.au>

	* configure.in (LT_VERSION_INFO): add quotes around symbol definition.
2006-01-02 11:30:32 +00:00
Benoît Dejean
d3add9e115 Released 2.13.1.
* configure.in:
	* NEWS:

	Released 2.13.1.
2005-12-15 13:10:53 +00:00
Benoît Dejean
101fe5874f Improved example.
* proclist.c: (print_pids), (main):

	Improved example.
2005-12-15 13:05:55 +00:00
Benoît Dejean
3afe2bf629 Fixed when which == GLIBTOP_KERN_PROC_UID. Closes #324055.
* proclist.c: (glibtop_get_proclist_s):

	Fixed when which == GLIBTOP_KERN_PROC_UID.
	Closes #324055.
2005-12-15 13:04:04 +00:00
Benoît Dejean
e296c3a37a Implemented server->real_ncpu. Add a warning to display ncpu and real_ncpu
* open.c: (glibtop_open_s):

	Implemented server->real_ncpu.
	Add a warning to display ncpu and real_ncpu on open.
2005-12-14 10:53:53 +00:00
8 changed files with 89 additions and 12 deletions

View File

@@ -1,3 +1,21 @@
2006-01-02 Benoît Dejean <benoit@placenet.org>
* NEWS:
* configure.in:
Released 2.13.2.
2006-01-02 James Henstridge <james@jamesh.id.au>
* configure.in (LT_VERSION_INFO): add quotes around symbol definition.
2005-12-15 Benoît Dejean <benoit@placenet.org>
* configure.in:
* NEWS:
Released 2.13.1.
2005-12-13 Benoît Dejean <benoit@placenet.org>
* NEWS:

10
NEWS
View File

@@ -1,3 +1,13 @@
January 2, 2006: Overview of changes in 2.13.2
==============================================
* Fixed libtool versioning (James Henstridge)
December 15, 2005: Overview of changes in 2.13.1
================================================
* linux:
- fixed proclist
- implemented server->real_ncpu
December 13, 2005: Overview of changes in 2.13.0
================================================
* Requires automake-1.9 (James Henstridge)

View File

@@ -4,7 +4,7 @@ dnl
m4_define([libgtop_major_version], [2])
m4_define([libgtop_minor_version], [13])
m4_define([libgtop_micro_version], [0])
m4_define([libgtop_micro_version], [2])
m4_define([libgtop_version], [libgtop_major_version.libgtop_minor_version.libgtop_micro_version])
dnl increment if the interface has additions, changes, removals.
@@ -44,7 +44,7 @@ AC_SUBST(LIBGTOP_VERSION_CODE, [libgtop_version_code])
# libtool versioning
AC_SUBST(LT_VERSION_INFO,
[-version-info libgtop_current:libgtop_revision:libgtop_age])
["-version-info libgtop_current:libgtop_revision:libgtop_age"])
ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I ."

View File

@@ -1,3 +1,9 @@
2005-12-15 Benoît Dejean <benoit@placenet.org>
* proclist.c: (print_pids), (main):
Improved example.
2005-12-12 Benoît Dejean <benoit@placenet.org>
* .cvsignore:

View File

@@ -5,22 +5,37 @@
#include <stdio.h>
int main()
#include <unistd.h>
#include <sys/types.h>
static void print_pids(guint64 which, guint64 arg)
{
unsigned *pids;
unsigned i;
glibtop_proclist buf;
glibtop_init();
pids = glibtop_get_proclist(&buf, which, arg);
pids = glibtop_get_proclist(&buf, 0, 0);
printf("glibtop_get_proclist(%#llx, %llu) -> %lu processes\n",
which, arg, (unsigned long)buf.number);
for (i = 0; i < buf.number; ++i)
printf("%u ", pids[i]);
putchar('\n');
putchar('\n');
g_free(pids);
}
int main()
{
glibtop_init();
print_pids(GLIBTOP_KERN_PROC_ALL, 0);
print_pids(GLIBTOP_KERN_PROC_UID, getuid());
glibtop_close();

View File

@@ -1,3 +1,17 @@
2005-12-15 Benoît Dejean <benoit@placenet.org>
* proclist.c: (glibtop_get_proclist_s):
Fixed when which == GLIBTOP_KERN_PROC_UID.
Closes #324055.
2005-12-14 Benoît Dejean <benoit@placenet.org>
* open.c: (glibtop_open_s):
Implemented server->real_ncpu.
Add a warning to display ncpu and real_ncpu on open.
2005-12-13 Benoît Dejean <benoit@placenet.org>
* cpu.c: (glibtop_get_cpu_s):

View File

@@ -79,17 +79,21 @@ glibtop_open_s (glibtop *server, const char *program_name,
p = skip_line(p); /* cpu */
for (server->ncpu = 0; server->ncpu < GLIBTOP_NCPU; server->ncpu++) {
for (server->real_ncpu = 0; /* nop */; server->real_ncpu++) {
if (!check_cpu_line(server, p, server->ncpu)) {
server->ncpu--;
if (!check_cpu_line(server, p, server->real_ncpu)) {
server->real_ncpu--;
break;
}
p = skip_line(p);
}
#ifdef DEBUG
printf ("\nThis machine has %d CPUs.\n\n", server->ncpu);
#endif
server->ncpu = MIN(GLIBTOP_NCPU - 1, server->real_ncpu);
glibtop_warn_r(server,
"This machine has %d CPUs, "
"%d are being monitored.",
server->real_ncpu + 1,
server->ncpu + 1);
}

View File

@@ -98,8 +98,18 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
continue;
break;
case GLIBTOP_KERN_PROC_UID:
if ((uid_t) arg != statb.st_uid)
{
char path[32];
struct stat path_stat;
snprintf(path, sizeof path, "/proc/%u", pid);
if (stat(path, &path_stat))
continue;
if ((uid_t) arg != path_stat.st_uid)
continue;
}
break;
case GLIBTOP_KERN_PROC_PGRP:
/* Do you really, really need this ? */