[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] xentrace 1/7: Trace runstate changes.
# HG changeset patch # User Keir Fraser <keir.fraser@xxxxxxxxxx> # Date 1220885267 -3600 # Node ID 1a7705924dbe5c55139d64783794bd7a130cfb41 # Parent 10c630645d133441c5319584e58cbd8533adbd65 xentrace 1/7: Trace runstate changes. Also, introduce SCHED_MIN and SCHED_VERBOSE, so that we can trace just runstate changes if we want to. Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx> Signed-off-by: Trolle Selander <trolle.selander@xxxxxxxxxxxxx> --- xen/common/schedule.c | 20 ++++++++++++++++++++ xen/include/public/trace.h | 34 +++++++++++++++++++--------------- 2 files changed, 39 insertions(+), 15 deletions(-) diff -r 10c630645d13 -r 1a7705924dbe xen/common/schedule.c --- a/xen/common/schedule.c Mon Sep 08 14:01:35 2008 +0100 +++ b/xen/common/schedule.c Mon Sep 08 15:47:47 2008 +0100 @@ -63,11 +63,31 @@ static struct scheduler ops; (( ops.fn != NULL ) ? ops.fn( __VA_ARGS__ ) \ : (typeof(ops.fn(__VA_ARGS__)))0 ) +static inline void trace_runstate_change(struct vcpu *v, int new_state) +{ + struct { uint32_t vcpu:16, domain:16; } d; + uint32_t event; + + if ( likely(!tb_init_done) ) + return; + + d.vcpu = v->vcpu_id; + d.domain = v->domain->domain_id; + + event = TRC_SCHED_RUNSTATE_CHANGE; + event |= ( v->runstate.state & 0x3 ) << 8; + event |= ( new_state & 0x3 ) << 4; + + __trace_var(event, 1/*tsc*/, sizeof(d), (unsigned char *)&d); +} + static inline void vcpu_runstate_change( struct vcpu *v, int new_state, s_time_t new_entry_time) { ASSERT(v->runstate.state != new_state); ASSERT(spin_is_locked(&per_cpu(schedule_data,v->processor).schedule_lock)); + + trace_runstate_change(v, new_state); v->runstate.time[v->runstate.state] += new_entry_time - v->runstate.state_entry_time; diff -r 10c630645d13 -r 1a7705924dbe xen/include/public/trace.h --- a/xen/include/public/trace.h Mon Sep 08 14:01:35 2008 +0100 +++ b/xen/include/public/trace.h Mon Sep 08 15:47:47 2008 +0100 @@ -50,26 +50,30 @@ #define TRC_HVM_ENTRYEXIT 0x00081000 /* VMENTRY and #VMEXIT */ #define TRC_HVM_HANDLER 0x00082000 /* various HVM handlers */ +#define TRC_SCHED_MIN 0x00021000 /* Just runstate changes */ +#define TRC_SCHED_VERBOSE 0x00028000 /* More inclusive scheduling */ + /* Trace events per class */ #define TRC_LOST_RECORDS (TRC_GEN + 1) #define TRC_TRACE_WRAP_BUFFER (TRC_GEN + 2) #define TRC_TRACE_CPU_CHANGE (TRC_GEN + 3) -#define TRC_SCHED_DOM_ADD (TRC_SCHED + 1) -#define TRC_SCHED_DOM_REM (TRC_SCHED + 2) -#define TRC_SCHED_SLEEP (TRC_SCHED + 3) -#define TRC_SCHED_WAKE (TRC_SCHED + 4) -#define TRC_SCHED_YIELD (TRC_SCHED + 5) -#define TRC_SCHED_BLOCK (TRC_SCHED + 6) -#define TRC_SCHED_SHUTDOWN (TRC_SCHED + 7) -#define TRC_SCHED_CTL (TRC_SCHED + 8) -#define TRC_SCHED_ADJDOM (TRC_SCHED + 9) -#define TRC_SCHED_SWITCH (TRC_SCHED + 10) -#define TRC_SCHED_S_TIMER_FN (TRC_SCHED + 11) -#define TRC_SCHED_T_TIMER_FN (TRC_SCHED + 12) -#define TRC_SCHED_DOM_TIMER_FN (TRC_SCHED + 13) -#define TRC_SCHED_SWITCH_INFPREV (TRC_SCHED + 14) -#define TRC_SCHED_SWITCH_INFNEXT (TRC_SCHED + 15) +#define TRC_SCHED_RUNSTATE_CHANGE (TRC_SCHED_MIN + 1) +#define TRC_SCHED_DOM_ADD (TRC_SCHED_VERBOSE + 1) +#define TRC_SCHED_DOM_REM (TRC_SCHED_VERBOSE + 2) +#define TRC_SCHED_SLEEP (TRC_SCHED_VERBOSE + 3) +#define TRC_SCHED_WAKE (TRC_SCHED_VERBOSE + 4) +#define TRC_SCHED_YIELD (TRC_SCHED_VERBOSE + 5) +#define TRC_SCHED_BLOCK (TRC_SCHED_VERBOSE + 6) +#define TRC_SCHED_SHUTDOWN (TRC_SCHED_VERBOSE + 7) +#define TRC_SCHED_CTL (TRC_SCHED_VERBOSE + 8) +#define TRC_SCHED_ADJDOM (TRC_SCHED_VERBOSE + 9) +#define TRC_SCHED_SWITCH (TRC_SCHED_VERBOSE + 10) +#define TRC_SCHED_S_TIMER_FN (TRC_SCHED_VERBOSE + 11) +#define TRC_SCHED_T_TIMER_FN (TRC_SCHED_VERBOSE + 12) +#define TRC_SCHED_DOM_TIMER_FN (TRC_SCHED_VERBOSE + 13) +#define TRC_SCHED_SWITCH_INFPREV (TRC_SCHED_VERBOSE + 14) +#define TRC_SCHED_SWITCH_INFNEXT (TRC_SCHED_VERBOSE + 15) #define TRC_MEM_PAGE_GRANT_MAP (TRC_MEM + 1) #define TRC_MEM_PAGE_GRANT_UNMAP (TRC_MEM + 2) _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |