ia64/xen-unstable

view tools/xenmon/xenbaked.h @ 8740:3d7ea7972b39

Update patches for linux 2.6.15.

Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Thu Feb 02 17:16:00 2006 +0000 (2006-02-02)
parents 394390f6ff85
children 7b9dacaf3340
line source
1 /******************************************************************************
2 * tools/xenbaked.h
3 *
4 * Header file for xenbaked
5 *
6 * Copyright (C) 2005 by Hewlett Packard, Palo Alto and Fort Collins
7 *
8 * Authors: Diwaker Gupta, diwaker.gupta@hp.com
9 * Rob Gardner, rob.gardner@hp.com
10 * Lucy Cherkasova, lucy.cherkasova.hp.com
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; under version 2 of the License.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 */
26 #ifndef __QOS_H__
27 #define __QOS_H__
29 ///// qos stuff
30 #define million 1000000LL
31 #define billion 1000000000LL
33 #define QOS_ADD(N,A) ((N+A)<(NSAMPLES-1) ? (N+A) : A)
34 #define QOS_INCR(N) ((N<(NSAMPLES-2)) ? (N+1) : 0)
35 #define QOS_DECR(N) ((N==0) ? (NSAMPLES-1) : (N-1))
37 #define MAX_NAME_SIZE 32
38 #define IDLE_DOMAIN_ID 32767
40 /* Number of domains we can keep track of in memory */
41 #define NDOMAINS 32
43 /* Number of data points to keep */
44 #define NSAMPLES 100
47 // per domain stuff
48 typedef struct
49 {
50 uint64_t last_update_time;
51 uint64_t start_time; // when the thread started running
52 uint64_t runnable_start_time; // when the thread became runnable
53 uint64_t blocked_start_time; // when the thread became blocked
54 uint64_t ns_since_boot; // time gone by since boot
55 uint64_t ns_oncpu_since_boot; // total cpu time used by thread since boot
56 // uint64_t ns_runnable_since_boot;
57 int runnable_at_last_update; // true if the thread was runnable last time we checked.
58 int runnable; // true if thread is runnable right now
59 // tells us something about what happened during the
60 // sample period that we are analysing right now
61 int in_use; //
62 domid_t id;
63 char name[MAX_NAME_SIZE];
64 } _domain_info;
68 typedef struct
69 {
70 struct
71 {
72 // data point:
73 // stuff that is recorded once for each measurement interval
74 uint64_t ns_gotten[NDOMAINS]; // ns used in the last sample period
75 uint64_t ns_allocated[NDOMAINS]; // ns allocated by scheduler
76 uint64_t ns_waiting[NDOMAINS]; // ns spent waiting to execute, ie, time from
77 // becoming runnable until actually running
78 uint64_t ns_blocked[NDOMAINS]; // ns spent blocked
79 uint64_t switchin_count[NDOMAINS]; // number of executions of the domain
80 uint64_t io_count[NDOMAINS];
81 uint64_t ns_passed; // ns gone by on the wall clock, ie, the sample period
82 uint64_t timestamp;
83 uint64_t lost_records; // # of lost trace records this time period
84 uint64_t flip_free_periods; // # of executions of dom0 in which no page flips happened
85 } qdata[NSAMPLES];
87 _domain_info domain_info[NDOMAINS];
89 // control information
90 int next_datapoint;
91 int ncpu;
92 int structlen;
94 // parameters
95 int measurement_frequency; // for example
97 } _new_qos_data;
101 #endif