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.
This commit is contained in:
committed by
Martin Baulig
parent
38b00dfae0
commit
afe57f9ee9
27
ChangeLog
27
ChangeLog
@@ -1,3 +1,30 @@
|
|||||||
|
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-12 Martin Baulig <martin@home-of-linux.org>
|
1998-10-12 Martin Baulig <martin@home-of-linux.org>
|
||||||
|
|
||||||
* configure.in (GNOME_COMPILE_WARNINGS): Let the user enable
|
* configure.in (GNOME_COMPILE_WARNINGS): Let the user enable
|
||||||
|
@@ -2,7 +2,7 @@ void|cpu|ulong(total,user,nice,sys,idle,frequency)
|
|||||||
void|mem|ulong(total,used,free,shared,buffer,cached,user,locked)
|
void|mem|ulong(total,used,free,shared,buffer,cached,user,locked)
|
||||||
void|swap|ulong(total,used,free,pagein,pageout)
|
void|swap|ulong(total,used,free,pagein,pageout)
|
||||||
void|uptime|double(uptime,idletime)
|
void|uptime|double(uptime,idletime)
|
||||||
void|loadavg|double(loadavg[0],loadavg[1],loadavg[2]):ulong(nr_running,nr_tasks,last_pid)
|
void|loadavg|double(loadavg[3]):ulong(nr_running,nr_tasks,last_pid)
|
||||||
void|shm_limits|ulong(shmmax,shmmin,shmmni,shmseg,shmall)
|
void|shm_limits|ulong(shmmax,shmmin,shmmni,shmseg,shmall)
|
||||||
void|msg_limits|ulong(msgpool,msgmap,msgmax,msgmnb,msgmni,msgssz,msgtql)
|
void|msg_limits|ulong(msgpool,msgmap,msgmax,msgmnb,msgmni,msgssz,msgtql)
|
||||||
void|sem_limits|ulong(semmap,semmni,semmns,semmnu,semmsl,semopm,semume,semusz,semvmx,semaem)
|
void|sem_limits|ulong(semmap,semmni,semmns,semmnu,semmsl,semopm,semume,semusz,semvmx,semaem)
|
||||||
@@ -11,7 +11,7 @@ void|proc_state|str(cmd):char(state):ulong(uid,gid)|pid_t(pid)
|
|||||||
void|proc_uid|long(uid,euid,gid,egid,pid,ppid,pgrp,session,tty,tpgid,priority,nice)|pid_t(pid)
|
void|proc_uid|long(uid,euid,gid,egid,pid,ppid,pgrp,session,tty,tpgid,priority,nice)|pid_t(pid)
|
||||||
void|proc_mem|long(size,vsize,resident,share,rss,rss_rlim)|pid_t(pid)
|
void|proc_mem|long(size,vsize,resident,share,rss,rss_rlim)|pid_t(pid)
|
||||||
void|proc_time|long(start_time,rtime,utime,stime,cutime,cstime,timeout,it_real_value,frequency)|pid_t(pid)
|
void|proc_time|long(start_time,rtime,utime,stime,cutime,cstime,timeout,it_real_value,frequency)|pid_t(pid)
|
||||||
void|proc_signal|ulong(signal,blocked,sigignore,sigcatch)|pid_t(pid)
|
void|proc_signal|ulong(signal[2],blocked[2],sigignore[2],sigcatch[2])|pid_t(pid)
|
||||||
void|proc_kernel|ulong(k_flags,min_flt,maj_flt,cmin_flt,cmaj_flt,kstk_esp,kstk_eip,nwchan):str(wchan)|pid_t(pid)
|
void|proc_kernel|ulong(k_flags,min_flt,maj_flt,cmin_flt,cmaj_flt,kstk_esp,kstk_eip,nwchan):str(wchan)|pid_t(pid)
|
||||||
void|proc_segment|ulong(text_rss,shlib_rss,data_rss,stack_rss,dirty_size,start_code,end_code,start_stack)|pid_t(pid)
|
void|proc_segment|ulong(text_rss,shlib_rss,data_rss,stack_rss,dirty_size,start_code,end_code,start_stack)|pid_t(pid)
|
||||||
glibtop_map_entry *|proc_map|ulong(number,size,total)|pid_t(pid)
|
glibtop_map_entry *|proc_map|ulong(number,size,total)|pid_t(pid)
|
||||||
|
@@ -41,10 +41,10 @@ typedef struct _glibtop_proc_signal glibtop_proc_signal;
|
|||||||
struct _glibtop_proc_signal
|
struct _glibtop_proc_signal
|
||||||
{
|
{
|
||||||
u_int64_t flags,
|
u_int64_t flags,
|
||||||
signal, /* mask of pending signals */
|
signal [2], /* mask of pending signals */
|
||||||
blocked, /* mask of blocked signals */
|
blocked [2], /* mask of blocked signals */
|
||||||
sigignore, /* mask of ignored signals */
|
sigignore [2], /* mask of ignored signals */
|
||||||
sigcatch; /* mask of caught signals */
|
sigcatch [2]; /* mask of caught signals */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define glibtop_get_proc_signal(p1, p2) glibtop_get_proc_signal_l(glibtop_global_server, p1, p2)
|
#define glibtop_get_proc_signal(p1, p2) glibtop_get_proc_signal_l(glibtop_global_server, p1, p2)
|
||||||
|
@@ -63,22 +63,22 @@ glibtop_get_proc_signal_p (glibtop *server,
|
|||||||
/* signal: mask of pending signals.
|
/* signal: mask of pending signals.
|
||||||
* pinfo [0].kp_proc.p_siglist
|
* pinfo [0].kp_proc.p_siglist
|
||||||
*/
|
*/
|
||||||
buf->signal = pinfo [0].kp_proc.p_siglist;
|
buf->signal [0] = pinfo [0].kp_proc.p_siglist;
|
||||||
|
|
||||||
/* blocked: mask of blocked signals.
|
/* blocked: mask of blocked signals.
|
||||||
* pinfo [0].kp_proc.p_sigmask
|
* pinfo [0].kp_proc.p_sigmask
|
||||||
*/
|
*/
|
||||||
buf->blocked = pinfo [0].kp_proc.p_sigmask;
|
buf->blocked [0] = pinfo [0].kp_proc.p_sigmask;
|
||||||
|
|
||||||
/* sigignore: mask of ignored signals.
|
/* sigignore: mask of ignored signals.
|
||||||
* pinfo [0].kp_proc.p_sigignore
|
* pinfo [0].kp_proc.p_sigignore
|
||||||
*/
|
*/
|
||||||
buf->sigignore = pinfo [0].kp_proc.p_sigignore;
|
buf->sigignore [0] = pinfo [0].kp_proc.p_sigignore;
|
||||||
|
|
||||||
/* sigcatch: mask of caught signals.
|
/* sigcatch: mask of caught signals.
|
||||||
* pinfo [0].kp_proc.p_sigcatch
|
* pinfo [0].kp_proc.p_sigcatch
|
||||||
*/
|
*/
|
||||||
buf->sigcatch = pinfo [0].kp_proc.p_sigcatch;
|
buf->sigcatch [0] = pinfo [0].kp_proc.p_sigcatch;
|
||||||
|
|
||||||
buf->flags = _glibtop_sysdeps_proc_signal;
|
buf->flags = _glibtop_sysdeps_proc_signal;
|
||||||
}
|
}
|
||||||
|
@@ -1,3 +1,9 @@
|
|||||||
|
1998-10-20 Martin Baulig <martin@home-of-linux.org>
|
||||||
|
|
||||||
|
* guile.awk: If the features.def contains something like
|
||||||
|
`fieldname[number]' we interpret this as an array and add all
|
||||||
|
members of this array.
|
||||||
|
|
||||||
1998-10-12 Martin Baulig <martin@home-of-linux.org>
|
1998-10-12 Martin Baulig <martin@home-of-linux.org>
|
||||||
|
|
||||||
* Makefile.am: Let the `Makefile' depend upon $(BUILT_SOURCES).
|
* Makefile.am: Let the `Makefile' depend upon $(BUILT_SOURCES).
|
||||||
|
@@ -95,7 +95,17 @@ function make_output(line) {
|
|||||||
sub(/^.*\(/, "", list); sub(/\)$/, "", list);
|
sub(/^.*\(/, "", list); sub(/\)$/, "", list);
|
||||||
count = split (list, fields, /,/);
|
count = split (list, fields, /,/);
|
||||||
for (field = 1; field <= count; field++) {
|
for (field = 1; field <= count; field++) {
|
||||||
output = output""convert[type]" ("feature"."fields[field]"),\n\t\t\t";
|
if (fields[field] ~ /^(\w+)\[([0-9]+)\]$/) {
|
||||||
|
split(fields[field], field_parts, /\[/);
|
||||||
|
fields[field] = field_parts[1];
|
||||||
|
sub(/\]/, "", field_parts[2]);
|
||||||
|
number = field_parts[2];
|
||||||
|
for (nr = 0; nr < number; nr++) {
|
||||||
|
output = output""convert[type]" ("feature"."fields[field]" ["nr"]),\n\t\t\t";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
output = output""convert[type]" ("feature"."fields[field]"),\n\t\t\t";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
output = output"SCM_UNDEFINED);\n";
|
output = output"SCM_UNDEFINED);\n";
|
||||||
|
@@ -54,8 +54,8 @@ glibtop_get_proc_signal_s (glibtop *server, glibtop_proc_signal *buf,
|
|||||||
|
|
||||||
buf->flags = _glibtop_sysdeps_proc_signal;
|
buf->flags = _glibtop_sysdeps_proc_signal;
|
||||||
|
|
||||||
buf->signal = tbl.proc_signal.signal;
|
buf->signal [0] = tbl.proc_signal.signal;
|
||||||
buf->blocked = tbl.proc_signal.blocked;
|
buf->blocked [0] = tbl.proc_signal.blocked;
|
||||||
buf->sigignore = tbl.proc_signal.ignored;
|
buf->sigignore [0] = tbl.proc_signal.ignored;
|
||||||
buf->sigcatch = tbl.proc_signal.caught;
|
buf->sigcatch [0] = tbl.proc_signal.caught;
|
||||||
}
|
}
|
||||||
|
@@ -54,10 +54,10 @@ glibtop_get_proc_signal_s (glibtop *server, glibtop_proc_signal *buf, pid_t pid)
|
|||||||
|
|
||||||
p = skip_multiple_token (p, 28);
|
p = skip_multiple_token (p, 28);
|
||||||
|
|
||||||
buf->signal = strtoul (p, &p, 0);
|
buf->signal [0] = strtoul (p, &p, 0);
|
||||||
buf->blocked = strtoul (p, &p, 0);
|
buf->blocked [0] = strtoul (p, &p, 0);
|
||||||
buf->sigignore = strtoul (p, &p, 0);
|
buf->sigignore [0] = strtoul (p, &p, 0);
|
||||||
buf->sigcatch = strtoul (p, &p, 0);
|
buf->sigcatch [0] = strtoul (p, &p, 0);
|
||||||
|
|
||||||
buf->flags = _glibtop_sysdeps_proc_signal;
|
buf->flags = _glibtop_sysdeps_proc_signal;
|
||||||
}
|
}
|
||||||
|
@@ -63,10 +63,10 @@ glibtop_get_proc_signal_p (glibtop *server, glibtop_proc_signal *buf,
|
|||||||
|
|
||||||
if (ret != 1) return;
|
if (ret != 1) return;
|
||||||
|
|
||||||
buf->signal = procinfo.pi_sig;
|
buf->signal [0] = procinfo.pi_sig;
|
||||||
buf->blocked = procinfo.pi_sigmask;
|
buf->blocked [0] = procinfo.pi_sigmask;
|
||||||
buf->sigignore = procinfo.pi_sigignore;
|
buf->sigignore [0] = procinfo.pi_sigignore;
|
||||||
buf->sigcatch = procinfo.pi_sigcatch;
|
buf->sigcatch [0] = procinfo.pi_sigcatch;
|
||||||
|
|
||||||
buf->flags = _glibtop_sysdeps_proc_signal;
|
buf->flags = _glibtop_sysdeps_proc_signal;
|
||||||
}
|
}
|
||||||
|
@@ -52,10 +52,10 @@ glibtop_get_proc_signal_p (glibtop *server, glibtop_proc_signal *buf,
|
|||||||
|
|
||||||
/* Fill in data fields. */
|
/* Fill in data fields. */
|
||||||
|
|
||||||
buf->signal = pp->p_sig;
|
buf->signal [0] = pp->p_sig;
|
||||||
buf->blocked = pp->p_sigmask;
|
buf->blocked [0] = pp->p_sigmask;
|
||||||
buf->sigignore = pp->p_sigignore;
|
buf->sigignore [0] = pp->p_sigignore;
|
||||||
buf->sigcatch = pp->p_sigcatch;
|
buf->sigcatch [0] = pp->p_sigcatch;
|
||||||
|
|
||||||
buf->flags = _glibtop_sysdeps_proc_signal;
|
buf->flags = _glibtop_sysdeps_proc_signal;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user