6 * This file defines the interface between top and the machine-dependent
7 * module. It is NOT machine dependent and should not need to be changed
8 * for any specific machine.
13 #define NUM_AVERAGES 3
15 /* Log base 2 of 1024 is 10 (2^10 == 1024) */
19 * the statics struct is filled in by machine_init
23 const char * const *procstate_names;
24 const char * const *cpustate_names;
25 const char * const *memory_names;
26 const char * const *arc_names;
27 const char * const *carc_names;
28 const char * const *swap_names;
29 const char * const *order_names;
34 * the system_info struct is filled in by a machine dependent routine.
40 double load_avg[NUM_AVERAGES];
42 int p_pactive; /* number of procs considered "active" */
49 struct timeval boottime;
53 /* cpu_states is an array of percentages * 10. For example,
54 the (integer) value 105 is 10.5% (or .105).
58 * the process_select struct tells get_process_info what processes we
59 * are interested in seeing
64 int idle; /* show idle processes */
65 int self; /* show self */
66 int system; /* show system processes */
67 int thread; /* show threads */
68 #define TOP_MAX_UIDS 8
69 int uid[TOP_MAX_UIDS]; /* only these uids (unless uid[0] == -1) */
70 int wcpu; /* show weighted cpu */
71 int jid; /* only this jid (unless jid == -1) */
72 int jail; /* show jail ID */
73 int swap; /* show swap usage */
74 int kidle; /* show per-CPU idle threads */
75 pid_t pid; /* only this pid (unless pid == -1) */
76 char *command; /* only this command (unless == NULL) */
79 /* routines defined by the machine dependent module */
81 const char *format_header(const char *uname_field);
82 char *format_next_process(void* handle, char *(*get_userid)(int),
84 void toggle_pcpustats(void);
85 void get_system_info(struct system_info *si);
86 int machine_init(struct statics *statics);
87 int proc_owner(int pid);
89 /* non-int routines typically used by the machine dependent module */
90 extern struct process_select ps;
93 get_process_info(struct system_info *si, struct process_select *sel,
94 int (*compare)(const void *, const void *));
96 #endif /* MACHINE_H */