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.
16 * the statics struct is filled in by machine_init
20 char **procstate_names;
21 char **cpustate_names;
31 * the system_info struct is filled in by a machine dependent routine.
37 double load_avg[NUM_AVERAGES];
39 int p_pactive; /* number of procs considered "active" */
46 struct timeval boottime;
50 /* cpu_states is an array of percentages * 10. For example,
51 the (integer) value 105 is 10.5% (or .105).
55 * the process_select struct tells get_process_info what processes we
56 * are interested in seeing
61 int idle; /* show idle processes */
62 int self; /* show self */
63 int system; /* show system processes */
64 int thread; /* show threads */
65 #define TOP_MAX_UIDS 8
66 int uid[TOP_MAX_UIDS]; /* only these uids (unless uid[0] == -1) */
67 int wcpu; /* show weighted cpu */
68 int jid; /* only this jid (unless jid == -1) */
69 int jail; /* show jail ID */
70 int swap; /* show swap usage */
71 int kidle; /* show per-CPU idle threads */
72 char *command; /* only this command (unless == NULL) */
75 /* routines defined by the machine dependent module */
77 char *format_header(char *uname_field);
78 char *format_next_process(caddr_t handle, char *(*get_userid)(uid_t),
80 void toggle_pcpustats(void);
81 void get_system_info(struct system_info *si);
82 int machine_init(struct statics *statics);
83 int proc_owner(int pid);
85 /* non-int routines typically used by the machine dependent module */
86 extern struct process_select ps;
89 get_process_info(struct system_info *si, struct process_select *sel,
90 int (*compare)(const void *, const void *));
92 #endif /* MACHINE_H */