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.
14 #include <sys/types.h>
16 #define NUM_AVERAGES 3
18 /* Log base 2 of 1024 is 10 (2^10 == 1024) */
22 * the statics struct is filled in by machine_init
26 const char * const *procstate_names;
27 const char * const *cpustate_names;
28 const char * const *memory_names;
29 const char * const *arc_names;
30 const char * const *carc_names;
31 const char * const *swap_names;
32 const char * const *order_names;
37 * the system_info struct is filled in by a machine dependent routine.
43 double load_avg[NUM_AVERAGES];
45 int p_pactive; /* number of procs considered "active" */
52 struct timeval boottime;
57 * the process_select struct tells get_process_info what processes
58 * and information we are interested in seeing
63 bool idle; /* show idle processes */
64 bool self; /* show self */
65 bool system; /* show system processes */
66 bool thread; /* show threads */
67 bool thread_id; /* show thread ids */
68 #define TOP_MAX_UIDS 8
69 int uid[TOP_MAX_UIDS]; /* only these uids (unless uid[0] == -1) */
70 bool wcpu; /* show weighted cpu */
71 int jid; /* only this jid (unless jid == -1) */
72 bool jail; /* show jail ID */
73 bool swap; /* show swap usage */
74 bool kidle; /* show per-CPU idle threads */
75 int pid; /* only this pid (unless pid == -1) */
76 const char *command; /* only this command (unless == NULL) */
79 /* routines defined by the machine dependent module */
83 char *format_header(const char *uname_field);
84 char *format_next_process(struct handle* handle, char *(*get_userid)(int),
86 void toggle_pcpustats(void);
87 void get_system_info(struct system_info *si);
88 int machine_init(struct statics *statics);
90 /* non-int routines typically used by the machine dependent module */
91 extern struct process_select ps;
94 get_process_info(struct system_info *si, struct process_select *sel,
95 int (*compare)(const void *, const void *));
97 #endif /* MACHINE_H */