]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - contrib/top/machine.h
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / contrib / top / machine.h
1 /*
2  * $FreeBSD$
3  */
4
5 /*
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.
9  */
10
11 /*
12  * the statics struct is filled in by machine_init
13  */
14 struct statics
15 {
16     char **procstate_names;
17     char **cpustate_names;
18     char **memory_names;
19     char **swap_names;
20 #ifdef ORDER
21     char **order_names;
22 #endif
23     int ncpus;
24 };
25
26 /*
27  * the system_info struct is filled in by a machine dependent routine.
28  */
29
30 #ifdef p_active     /* uw7 define macro p_active */
31 #define P_ACTIVE p_pactive
32 #else
33 #define P_ACTIVE p_active
34 #endif
35
36 struct system_info
37 {
38     int    last_pid;
39     double load_avg[NUM_AVERAGES];
40     int    p_total;
41     int    P_ACTIVE;     /* number of procs considered "active" */
42     int    *procstates;
43     int    *cpustates;
44     int    *memory;
45     int    *swap;
46     struct timeval boottime;
47     int    ncpus;
48 };
49
50 /* cpu_states is an array of percentages * 10.  For example, 
51    the (integer) value 105 is 10.5% (or .105).
52  */
53
54 /*
55  * the process_select struct tells get_process_info what processes we
56  * are interested in seeing
57  */
58
59 struct process_select
60 {
61     int idle;           /* show idle processes */
62     int self;           /* show self */
63     int system;         /* show system processes */
64     int thread;         /* show threads */
65     int uid;            /* only this uid (unless uid == -1) */
66     int wcpu;           /* show weighted cpu */
67     int jail;           /* show jail ID */
68     char *command;      /* only this command (unless == NULL) */
69 };
70
71 /* routines defined by the machine dependent module */
72
73 char *format_header();
74 char *format_next_process();
75
76 /* non-int routines typically used by the machine dependent module */
77 char *printable();