machine.h revision 169257
124139Sjoerg/*
289758Sdwmalone * $FreeBSD: head/contrib/top/machine.h 169257 2007-05-04 15:42:58Z rafan $
389758Sdwmalone */
489758Sdwmalone
589758Sdwmalone/*
624139Sjoerg *  This file defines the interface between top and the machine-dependent
724139Sjoerg *  module.  It is NOT machine dependent and should not need to be changed
824139Sjoerg *  for any specific machine.
924139Sjoerg */
1024139Sjoerg
1124139Sjoerg/*
1224139Sjoerg * the statics struct is filled in by machine_init
1324139Sjoerg */
1424139Sjoergstruct statics
1524139Sjoerg{
1624139Sjoerg    char **procstate_names;
1724139Sjoerg    char **cpustate_names;
1824139Sjoerg    char **memory_names;
1924142Sjoerg    char **swap_names;
2024139Sjoerg#ifdef ORDER
2124139Sjoerg    char **order_names;
2224139Sjoerg#endif
2324139Sjoerg};
2424139Sjoerg
2524139Sjoerg/*
2624139Sjoerg * the system_info struct is filled in by a machine dependent routine.
2724139Sjoerg */
2824139Sjoerg
2989758Sdwmalone#ifdef p_active     /* uw7 define macro p_active */
3089758Sdwmalone#define P_ACTIVE p_pactive
3189758Sdwmalone#else
3289758Sdwmalone#define P_ACTIVE p_active
3389758Sdwmalone#endif
3489758Sdwmalone
3524139Sjoergstruct system_info
3624139Sjoerg{
3724139Sjoerg    int    last_pid;
3824139Sjoerg    double load_avg[NUM_AVERAGES];
3924139Sjoerg    int    p_total;
4089758Sdwmalone    int    P_ACTIVE;     /* number of procs considered "active" */
4124139Sjoerg    int    *procstates;
4224139Sjoerg    int    *cpustates;
4324139Sjoerg    int    *memory;
4424142Sjoerg    int    *swap;
4542447Sobrien    struct timeval boottime;
4624139Sjoerg};
4724139Sjoerg
4824139Sjoerg/* cpu_states is an array of percentages * 10.  For example,
4924139Sjoerg   the (integer) value 105 is 10.5% (or .105).
5024139Sjoerg */
5124139Sjoerg
5224139Sjoerg/*
5324139Sjoerg * the process_select struct tells get_process_info what processes we
5424139Sjoerg * are interested in seeing
5524139Sjoerg */
5624139Sjoerg
5724139Sjoergstruct process_select
5824139Sjoerg{
5924139Sjoerg    int idle;		/* show idle processes */
6038090Sdes    int self;		/* show self */
6124139Sjoerg    int system;		/* show system processes */
62117709Sjulian    int thread;		/* show threads */
6324139Sjoerg    int uid;		/* only this uid (unless uid == -1) */
64146342Skeramida    int wcpu;		/* show weighted cpu */
65169257Srafan    int jail;		/* show jail ID */
6624139Sjoerg    char *command;	/* only this command (unless == NULL) */
6724139Sjoerg};
6824139Sjoerg
6924139Sjoerg/* routines defined by the machine dependent module */
7024139Sjoerg
7124139Sjoergchar *format_header();
7224139Sjoergchar *format_next_process();
7324139Sjoerg
7424139Sjoerg/* non-int routines typically used by the machine dependent module */
7524139Sjoergchar *printable();
76