blob: 62688976118ac2f269462bc40983140f12d185a5 [file] [log] [blame]
Dave Shield05b54d22005-06-27 08:57:52 +00001typedef struct netsnmp_cpu_info_s netsnmp_cpu_info;
Dave Shield467d0d12006-08-24 12:49:00 +00002extern int cpu_num;
Dave Shield05b54d22005-06-27 08:57:52 +00003
Dave Shieldd70a05d2005-06-30 08:35:49 +00004 /* For rolling averages */
5struct netsnmp_cpu_history {
Jan Safranek3e5fedd2011-11-03 09:45:27 +01006 unsigned long long user_hist;
7 unsigned long long sys_hist;
8 unsigned long long idle_hist;
9 unsigned long long nice_hist;
10 unsigned long long total_hist;
Dave Shielda019f442006-08-18 15:58:31 +000011
Jan Safranek3e5fedd2011-11-03 09:45:27 +010012 unsigned long long ctx_hist;
13 unsigned long long intr_hist;
14 unsigned long long swpi_hist;
15 unsigned long long swpo_hist;
16 unsigned long long pagei_hist;
17 unsigned long long pageo_hist;
Dave Shieldd70a05d2005-06-30 08:35:49 +000018};
19
Dave Shield05b54d22005-06-27 08:57:52 +000020struct netsnmp_cpu_info_s {
21 int idx;
22 /* For hrDeviceTable */
23 char name[ SNMP_MAXBUF ];
24 char descr[ SNMP_MAXBUF ];
Dave Shield5a102a12006-08-27 16:43:39 +000025 int status;
Dave Shield05b54d22005-06-27 08:57:52 +000026
27 /* For UCD cpu stats */
Jan Safranek3e5fedd2011-11-03 09:45:27 +010028 unsigned long long user_ticks;
29 unsigned long long nice_ticks;
30 unsigned long long sys_ticks;
31 unsigned long long idle_ticks;
32 unsigned long long wait_ticks;
33 unsigned long long kern_ticks;
34 unsigned long long intrpt_ticks;
35 unsigned long long sirq_ticks;
Dave Shield05b54d22005-06-27 08:57:52 +000036
Jan Safranek3e5fedd2011-11-03 09:45:27 +010037 unsigned long long total_ticks;
38 unsigned long long sys2_ticks; /* For non-atomic system counts */
Dave Shielda019f442006-08-18 15:58:31 +000039
Dave Shield05b54d22005-06-27 08:57:52 +000040 /* For paging-related UCD stats */
41 /* XXX - Do these belong elsewhere ?? */
Dave Shield467d0d12006-08-24 12:49:00 +000042 /* XXX - Do Not Use - Subject to Change */
Jan Safranek3e5fedd2011-11-03 09:45:27 +010043 unsigned long long pageIn;
44 unsigned long long pageOut;
45 unsigned long long swapIn;
46 unsigned long long swapOut;
47 unsigned long long nInterrupts;
48 unsigned long long nCtxSwitches;
Dave Shield05b54d22005-06-27 08:57:52 +000049
Dave Shieldd70a05d2005-06-30 08:35:49 +000050 struct netsnmp_cpu_history *history;
51
Dave Shield05b54d22005-06-27 08:57:52 +000052 netsnmp_cpu_info *next;
53};
54
55
56 /*
57 * Possibly not all needed ??
58 */
59netsnmp_cpu_info *netsnmp_cpu_get_first( void );
60netsnmp_cpu_info *netsnmp_cpu_get_next( netsnmp_cpu_info* );
61netsnmp_cpu_info *netsnmp_cpu_get_byIdx( int, int );
62netsnmp_cpu_info *netsnmp_cpu_get_byName( char*, int );
63
64netsnmp_cache *netsnmp_cpu_get_cache( void );
65int netsnmp_cpu_load( void );