Files
xen/tools/xenmon/xenbaked.h
T
kaf24@firebug.cl.cam.ac.uk e4287d87ae This is a patch for XenMon which only applies to the userspace tools.
The primary purpose of this patch is to add support for non-polling 
access to the xen trace buffers. The hypervisor changes have already 
been accepted.

Also included are a few bug fixes and some minor new features:

1. If xenmon is run without first allocating trace buffers (via 
'setsize') and enabling them (via 'tbctl'), then this is done 
automatically using sensible defaults.

2. There was a bug that caused the first second's worth of data output 
from xenmon to be erroneous; This has been fixed.

3. There was a bug that caused xenmon to sometimes not display data for 
newly created domains; This has also been fixed.

4. The xenmon display has a 'heartbeat' which flickers once per second. 
This is to show that xenmon is still alive, even though the display 
isn't changing at all, a situation that can happen sometimes when there 
is nothing at all happening on a particular cpu.

5. Added cpu utilization display to the top of the xenmon window.

6. Added a bunch of options in xenmon to control exactly which metrics 
are displayed, so the screen doesn't get cluttered with stuff you're not 
interested in. The new options are:
  --allocated
  --noallocated
  --blocked
  --noblocked
  --waited
  --nowaited
  --excount
  --noexcount
  --iocount
  --noiocount

7. Added an option ("--cpu=N") to xenmon to specify which physical cpu 
you'd like data displayed for.

8. Updated the README with information about default trace buffer size, etc.

Signed-off-by: Rob Gardner <rob.gardner@hp.com>
2006-04-14 14:21:12 +01:00

105 lines
3.4 KiB
C

/******************************************************************************
* TOOLS/xenbaked.h
*
* Header file for xenbaked
*
* Copyright (C) 2005 by Hewlett Packard, Palo Alto and Fort Collins
*
* Authors: Diwaker Gupta, diwaker.gupta@hp.com
* Rob Gardner, rob.gardner@hp.com
* Lucy Cherkasova, lucy.cherkasova.hp.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; under version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __QOS_H__
#define __QOS_H__
///// qos stuff
#define million 1000000LL
#define billion 1000000000LL
// caution: don't use QOS_ADD with negative numbers!
#define QOS_ADD(N,A) ((N+A)<(NSAMPLES-1) ? (N+A) : A)
#define QOS_INCR(N) ((N<(NSAMPLES-2)) ? (N+1) : 0)
#define QOS_DECR(N) ((N==0) ? (NSAMPLES-1) : (N-1))
#define MAX_NAME_SIZE 32
#define IDLE_DOMAIN_ID 32767
/* Number of domains we can keep track of in memory */
#define NDOMAINS 32
/* Number of data points to keep */
#define NSAMPLES 100
#define ID(X) ((X>NDOMAINS-1)?(NDOMAINS-1):X)
#define DEFAULT_TBUF_SIZE 20
// per domain stuff
typedef struct
{
uint64_t last_update_time;
uint64_t start_time; // when the thread started running
uint64_t runnable_start_time; // when the thread became runnable
uint64_t blocked_start_time; // when the thread became blocked
uint64_t ns_since_boot; // time gone by since boot
uint64_t ns_oncpu_since_boot; // total cpu time used by thread since boot
// uint64_t ns_runnable_since_boot;
int runnable_at_last_update; // true if the thread was runnable last time we checked.
int runnable; // true if thread is runnable right now
// tells us something about what happened during the
// sample period that we are analysing right now
int in_use; //
domid_t id;
char name[MAX_NAME_SIZE];
} _domain_info;
typedef struct
{
struct
{
// data point:
// stuff that is recorded once for each measurement interval
uint64_t ns_gotten[NDOMAINS]; // ns used in the last sample period
uint64_t ns_allocated[NDOMAINS]; // ns allocated by scheduler
uint64_t ns_waiting[NDOMAINS]; // ns spent waiting to execute, ie, time from
// becoming runnable until actually running
uint64_t ns_blocked[NDOMAINS]; // ns spent blocked
uint64_t switchin_count[NDOMAINS]; // number of executions of the domain
uint64_t io_count[NDOMAINS];
uint64_t ns_passed; // ns gone by on the wall clock, ie, the sample period
uint64_t timestamp;
uint64_t lost_records; // # of lost trace records this time period
uint64_t flip_free_periods; // # of executions of dom0 in which no page flips happened
} qdata[NSAMPLES];
_domain_info domain_info[NDOMAINS];
// control information
int next_datapoint;
int ncpu;
int structlen;
// parameters
int measurement_frequency; // for example
} _new_qos_data;
#endif