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