[Sysfence-commit] sysfence datastruct.c,1.9,1.10 getstats.c,1.19,1.20 mainloop.c,1.15,1.16 sysfence.
Status: Alpha
Brought to you by:
emes
|
From: Michal S. <em...@us...> - 2004-06-04 13:07:23
|
Update of /cvsroot/sysfence/sysfence In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4613 Modified Files: datastruct.c getstats.c mainloop.c sysfence.c Log Message: + nproc handling so far, works only with -DDEBUG and crashes without it. don't know why Index: getstats.c =================================================================== RCS file: /cvsroot/sysfence/sysfence/getstats.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- getstats.c 31 May 2004 14:10:06 -0000 1.19 +++ getstats.c 4 Jun 2004 13:07:03 -0000 1.20 @@ -53,18 +53,21 @@ sf_value get_nproc (sf_stat_def *def, sf_database *db) { - long int *nproc = (long int *) xalloc (NULL, sizeof (long int)); - sf_value res = { INTEGER, nproc }; - sf_list *uids = def->arg[0].uids; - char statemask = def->arg[1].procstates; + long long int *nproc = (long long int *) xalloc (NULL, sizeof (long int)); + sf_value res = { INTEGER, nproc }; + sf_list *uids = def->arg[0].uids; + char statemask = def->arg[1].procstates; if (! uids) *nproc = get_proc_num (db, statemask, NULL); + else *nproc = 0; while (uids) { - *nproc += get_proc_num (db, statemask, (uid_t *) uids->el); + *nproc = *nproc + get_proc_num (db, statemask, (uid_t *) uids->el); uids = uids->next; } - +#ifdef DEBUG + syslog (LOG_DEBUG, "%s = %lu", def_2_string (def), *nproc); +#endif return res; } @@ -284,9 +287,11 @@ state = PROC_ZOMBIE; break; case 'T': - case 'D': state = PROC_STOP; break; + case 'D': + state = PROC_UNINT; + break; default: state = PROC_UNKNOWN; } Index: datastruct.c =================================================================== RCS file: /cvsroot/sysfence/sysfence/datastruct.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- datastruct.c 3 Jun 2004 23:42:41 -0000 1.9 +++ datastruct.c 4 Jun 2004 13:07:03 -0000 1.10 @@ -270,8 +270,8 @@ case ST_PROC: snprintf (buf, STRBUF, - "nproc (uid[0]: %s) (state: %d)", - "NIY", + "nproc (uid(s): %s) (state: %d)", + uids_2_str (def->arg[0].uids), def->arg[1].procstates ); default: Index: sysfence.c =================================================================== RCS file: /cvsroot/sysfence/sysfence/sysfence.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- sysfence.c 31 May 2004 14:09:07 -0000 1.25 +++ sysfence.c 4 Jun 2004 13:07:03 -0000 1.26 @@ -37,7 +37,7 @@ #include "sys/processtitle.h" const char *usage = - "sysfence v0.11, 01-03-2004\n" + "sysfence v0.14, 01-03-2004\n" "Usage: sysfence <config file> [<config file> ...] \n" "\n" "http://sysfence.sourceforge.net/\n" Index: mainloop.c =================================================================== RCS file: /cvsroot/sysfence/sysfence/mainloop.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- mainloop.c 31 May 2004 14:10:06 -0000 1.15 +++ mainloop.c 4 Jun 2004 13:07:03 -0000 1.16 @@ -92,7 +92,7 @@ fetch_la (db); fetch_mem (db); fetch_fs (db); -// fetch_proc (db); + fetch_proc (db); semaphore_post (semid); signals_handling (SIGUNBLOCK); |