From 17e7f04c8d144e0e0598464806dcb111ed5386d7 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Thu, 25 Sep 2008 10:48:06 +0000 Subject: top: optional SMP support by Vineet Gupta (vineetg76 AT gmail.com) --- include/libbb.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/libbb.h b/include/libbb.h index 3b4715e33..951ff2f1a 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -1225,6 +1225,9 @@ typedef struct procps_status_t { * by link target or interpreter name) */ char comm[COMM_LEN]; /* user/group? - use passwd/group parsing functions */ +#if ENABLE_FEATURE_TOP_SMP_PROCESS + int last_seen_on_cpu; +#endif } procps_status_t; enum { PSSCAN_PID = 1 << 0, @@ -1246,12 +1249,16 @@ enum { PSSCAN_ARGVN = (1 << 16) * (ENABLE_PGREP || ENABLE_PKILL || ENABLE_PIDOF), USE_SELINUX(PSSCAN_CONTEXT = 1 << 17,) PSSCAN_START_TIME = 1 << 18, + PSSCAN_CPU = 1 << 19, /* These are all retrieved from proc/NN/stat in one go: */ PSSCAN_STAT = PSSCAN_PPID | PSSCAN_PGID | PSSCAN_SID - | PSSCAN_COMM | PSSCAN_STATE - | PSSCAN_VSZ | PSSCAN_RSS - | PSSCAN_STIME | PSSCAN_UTIME | PSSCAN_START_TIME - | PSSCAN_TTY, + /**/ | PSSCAN_COMM | PSSCAN_STATE + /**/ | PSSCAN_VSZ | PSSCAN_RSS + /**/ | PSSCAN_STIME | PSSCAN_UTIME | PSSCAN_START_TIME + /**/ | PSSCAN_TTY +#if ENABLE_FEATURE_TOP_SMP_PROCESS + /**/ | PSSCAN_CPU +#endif }; //procps_status_t* alloc_procps_scan(void) FAST_FUNC; void free_procps_scan(procps_status_t* sp) FAST_FUNC; -- cgit v1.2.3