1
/* libxenstat: statistics-collection library for Xen
2
* Copyright (C) International Business Machines Corp., 2005
3
* Authors: Josh Triplett <josh@kernel.org>
4
* Judy Fischbach <jfisch@cs.pdx.edu>
5
* David Hendricks <cro_marmot@comcast.net>
7
* This library is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Lesser General Public
9
* License as published by the Free Software Foundation; either
10
* version 2.1 of the License, or (at your option) any later version.
12
* This library is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Lesser General Public License for more details.
19
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
20
* Use is subject to license terms.
23
#ifndef XENSTAT_PRIV_H
24
#define XENSTAT_PRIV_H
26
#include <sys/types.h>
32
#define SHORT_ASC_LEN 5 /* length of 65535 */
33
#define VERSION_SIZE (2 * SHORT_ASC_LEN + 1 + sizeof(xen_extraversion_t) + 1)
35
struct xenstat_handle {
37
struct xs_handle *xshandle; /* xenstore handle */
40
char xen_version[VERSION_SIZE]; /* xen version running on this node */
44
xenstat_handle *handle;
46
unsigned long long cpu_hz;
47
unsigned int num_cpus;
48
unsigned long long tot_mem;
49
unsigned long long free_mem;
50
unsigned int num_domains;
51
xenstat_domain *domains; /* Array of length num_domains */
56
unsigned long long curr_eph_pages;
57
unsigned long long succ_eph_gets;
58
unsigned long long succ_pers_puts;
59
unsigned long long succ_pers_gets;
62
struct xenstat_domain {
66
unsigned long long cpu_ns;
67
unsigned int num_vcpus; /* No. vcpus configured for domain */
68
xenstat_vcpu *vcpus; /* Array of length num_vcpus */
69
unsigned long long cur_mem; /* Current memory reservation */
70
unsigned long long max_mem; /* Total memory allowed */
72
unsigned int num_networks;
73
xenstat_network *networks; /* Array of length num_networks */
74
unsigned int num_vbds;
76
xenstat_tmem tmem_stats;
81
unsigned long long ns;
84
struct xenstat_network {
87
unsigned long long rbytes;
88
unsigned long long rpackets;
89
unsigned long long rerrs;
90
unsigned long long rdrop;
92
unsigned long long tbytes;
93
unsigned long long tpackets;
94
unsigned long long terrs;
95
unsigned long long tdrop;
99
unsigned int back_type;
101
unsigned long long oo_reqs;
102
unsigned long long rd_reqs;
103
unsigned long long wr_reqs;
104
unsigned long long rd_sects;
105
unsigned long long wr_sects;
108
extern int xenstat_collect_networks(xenstat_node * node);
109
extern void xenstat_uninit_networks(xenstat_handle * handle);
110
extern int xenstat_collect_vbds(xenstat_node * node);
111
extern void xenstat_uninit_vbds(xenstat_handle * handle);
113
#endif /* XENSTAT_PRIV_H */