1 #ifndef LINUX_SYSINFO_H
2 #define LINUX_SYSINFO_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) --
15 see 'show_special' for syntax details + other cautions. */
16 #define STATES_line2x4 "%s\03" \
17 " %#5.1f%% \02user,\03 %#5.1f%% \02system,\03 %#5.1f%% \02nice,\03 %#5.1f%% \02idle\03\n"
18 #define STATES_line2x5 "%s\03" \
19 " %#5.1f%% \02user,\03 %#5.1f%% \02system,\03 %#5.1f%% \02nice,\03 %#5.1f%% \02idle,\03 %#5.1f%% \02IO-wait\03\n"
20 #define STATES_line2x6 "%s\03" \
21 " %#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"
23 /* These typedefs attempt to ensure consistent 'ticks' handling */
24 typedef unsigned long long TIC_t
;
26 /* This structure stores a frame's cpu tics used in history
27 calculations. It exists primarily for SMP support but serves
29 typedef struct CPU_t
{
30 TIC_t u
, n
, s
, i
, w
, x
, y
; // as represented in /proc/stat
34 #endif /* LINUX_SYSINFO_H */