]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/top/machine.h
Fix multiple vulnerabilities in bzip2.
[FreeBSD/FreeBSD.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 #ifndef MACHINE_H
11 #define MACHINE_H
12
13 #include "top.h"
14
15 /*
16  * the statics struct is filled in by machine_init
17  */
18 struct statics
19 {
20     char **procstate_names;
21     char **cpustate_names;
22     char **memory_names;
23     char **arc_names;
24     char **carc_names;
25     char **swap_names;
26 #ifdef ORDER
27     char **order_names;
28 #endif
29     int ncpus;
30 };
31
32 /*
33  * the system_info struct is filled in by a machine dependent routine.
34  */
35
36 #ifdef p_active     /* uw7 define macro p_active */
37 #define P_ACTIVE p_pactive
38 #else
39 #define P_ACTIVE p_active
40 #endif
41
42 struct system_info
43 {
44     int    last_pid;
45     double load_avg[NUM_AVERAGES];
46     int    p_total;
47     int    P_ACTIVE;     /* number of procs considered "active" */
48     int    *procstates;
49     int    *cpustates;
50     int    *memory;
51     int    *arc;
52     int    *carc;
53     int    *swap;
54     struct timeval boottime;
55     int    ncpus;
56 };
57
58 /* cpu_states is an array of percentages * 10.  For example, 
59    the (integer) value 105 is 10.5% (or .105).
60  */
61
62 /*
63  * the process_select struct tells get_process_info what processes we
64  * are interested in seeing
65  */
66
67 struct process_select
68 {
69     int idle;           /* show idle processes */
70     int self;           /* show self */
71     int system;         /* show system processes */
72     int thread;         /* show threads */
73 #define TOP_MAX_UIDS 8
74     int uid[TOP_MAX_UIDS];      /* only these uids (unless uid[0] == -1) */
75     int wcpu;           /* show weighted cpu */
76     int jid;            /* only this jid (unless jid == -1) */
77     int jail;           /* show jail ID */
78     int swap;           /* show swap usage */
79     int kidle;          /* show per-CPU idle threads */
80     char *command;      /* only this command (unless == NULL) */
81 };
82
83 /* routines defined by the machine dependent module */
84
85 char    *format_header();
86 char    *format_next_process();
87 void     toggle_pcpustats(void);
88 void     get_system_info(struct system_info *si);
89 int      machine_init(struct statics *statics, char do_unames);
90 int      proc_owner(int pid);
91
92 /* non-int routines typically used by the machine dependent module */
93 char    *printable();
94
95 #endif /* MACHINE_H */