debuggers.hg

annotate tools/xenmon/xenbaked.h @ 22848:6341fe0f4e5a

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