source: trunk/packages/xen-3.1/xen-3.1/tools/xenstat/libxenstat/src/xenstat_priv.h @ 34

Last change on this file since 34 was 34, checked in by hartmans, 18 years ago

Add xen and xen-common

File size: 2.9 KB
Line 
1/* libxenstat: statistics-collection library for Xen
2 * Copyright (C) International Business Machines Corp., 2005
3 * Authors: Josh Triplett <josht@us.ibm.com>
4 *          Judy Fischbach <jfisch@us.ibm.com>
5 *          David Hendricks <dhendrix@us.ibm.com>
6 *
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.
11 *
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.
16 */
17
18/*
19 * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
20 * Use is subject to license terms.
21 */
22
23#ifndef XENSTAT_PRIV_H
24#define XENSTAT_PRIV_H
25
26#include <sys/types.h>
27#include <xs.h>
28#include "xenstat.h"
29
30#include "xenctrl.h"
31
32#define SHORT_ASC_LEN 5                 /* length of 65535 */
33#define VERSION_SIZE (2 * SHORT_ASC_LEN + 1 + sizeof(xen_extraversion_t) + 1)
34
35struct xenstat_handle {
36        int xc_handle;
37        struct xs_handle *xshandle; /* xenstore handle */
38        int page_size;
39        void *priv;
40        char xen_version[VERSION_SIZE]; /* xen version running on this node */
41};
42
43struct xenstat_node {
44        xenstat_handle *handle;
45        unsigned int flags;
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 */
52};
53
54struct xenstat_domain {
55        unsigned int id;
56        char *name;
57        unsigned int state;
58        unsigned long long cpu_ns;
59        unsigned int num_vcpus;         /* No. vcpus configured for domain */
60        xenstat_vcpu *vcpus;            /* Array of length num_vcpus */
61        unsigned long long cur_mem;     /* Current memory reservation */
62        unsigned long long max_mem;     /* Total memory allowed */
63        unsigned int ssid;
64        unsigned int num_networks;
65        xenstat_network *networks;      /* Array of length num_networks */
66        unsigned int num_vbds;
67        xenstat_vbd *vbds;
68};
69
70struct xenstat_vcpu {
71        unsigned int online;
72        unsigned long long ns;
73};
74
75struct xenstat_network {
76        unsigned int id;
77        /* Received */
78        unsigned long long rbytes;
79        unsigned long long rpackets;
80        unsigned long long rerrs;
81        unsigned long long rdrop;
82        /* Transmitted */
83        unsigned long long tbytes;
84        unsigned long long tpackets;
85        unsigned long long terrs;
86        unsigned long long tdrop;
87};
88
89struct xenstat_vbd {
90       unsigned int dev;
91       unsigned long long oo_reqs;
92       unsigned long long rd_reqs;
93       unsigned long long wr_reqs;
94};
95
96extern int xenstat_collect_networks(xenstat_node * node);
97extern void xenstat_uninit_networks(xenstat_handle * handle);
98extern int xenstat_collect_vbds(xenstat_node * node);
99extern void xenstat_uninit_vbds(xenstat_handle * handle);
100
101#endif /* XENSTAT_PRIV_H */
Note: See TracBrowser for help on using the repository browser.