Initial dockapps git repo
[dockapps.git] / wmSMPmon-3.1 / wmSMPmon / sysinfo-linux.h
blob73850d7a3c4c6a570f61694112dc47fc78284a07
1 #ifndef LINUX_SYSINFO_H
2 #define LINUX_SYSINFO_H
3 #include <string.h>
4 #include <fcntl.h>
5 #include <sys/utsname.h>
8 /* These are the possible fscanf formats used in /proc/stat
9 reads during history processing.
10 ( 5th number only for Linux 2.5.41 and above ) */
11 #define CPU_FMTS_JUST1 "cpu %Lu %Lu %Lu %Lu %Lu %Lu %Lu"
12 #define CPU_FMTS_MULTI "cpu%*d %Lu %Lu %Lu %Lu %Lu %Lu %Lu"
14 /* Summary Lines specially formatted string(s) -- see 'show_special' for syntax details + other cautions. */
15 #define STATES_line2x4 "%s\03" \
16 " %#5.1f%% \02user,\03 %#5.1f%% \02system,\03 %#5.1f%% \02nice,\03 %#5.1f%% \02idle\03\n"
17 #define STATES_line2x5 "%s\03" \
18 " %#5.1f%% \02user,\03 %#5.1f%% \02system,\03 %#5.1f%% \02nice,\03 %#5.1f%% \02idle,\03 %#5.1f%% \02IO-wait\03\n"
19 #define STATES_line2x6 "%s\03" \
20 " %#4.1f%% \02us,\03 %#4.1f%% \02sy,\03 %#4.1f%% \02ni,\03 %#4.1f%% \02id,\03 %#4.1f%% \02wa,\03 %#4.1f%% \02hi,\03 %#4.1f%% \02si\03\n"
22 /* These typedefs attempt to ensure consistent 'ticks' handling */
23 typedef unsigned long long TIC_t;
25 /* This structure stores a frame's cpu tics used in history
26 calculations. It exists primarily for SMP support but serves
27 all environments. */
28 typedef struct CPU_t {
29 TIC_t u, n, s, i, w, x, y; // as represented in /proc/stat
30 TIC_t charge, total;
31 } CPU_t;
33 #endif /* SYSINFO_H */