ia64/xen-unstable
changeset 19304:d035b66b5b4d
xentrace: trace when we continue with the same task
Trace when the scheduler decides to continue running the same process.
This lets us see that this is happening for one; it also lets us see
domains in a trace which are actively running on pcpu but never
scheduled out.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Trace when the scheduler decides to continue running the same process.
This lets us see that this is happening for one; it also lets us see
domains in a trace which are actively running on pcpu but never
scheduled out.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Mon Mar 09 15:01:34 2009 +0000 (2009-03-09) |
parents | e7702951fc09 |
children | dee5bc89873e b5d074255c38 |
files | xen/common/schedule.c xen/include/public/trace.h |
line diff
1.1 --- a/xen/common/schedule.c Mon Mar 09 13:52:59 2009 +0000 1.2 +++ b/xen/common/schedule.c Mon Mar 09 15:01:34 2009 +0000 1.3 @@ -81,6 +81,20 @@ static inline void trace_runstate_change 1.4 __trace_var(event, 1/*tsc*/, sizeof(d), (unsigned char *)&d); 1.5 } 1.6 1.7 +static inline void trace_continue_running(struct vcpu *v) 1.8 +{ 1.9 + struct { uint32_t vcpu:16, domain:16; } d; 1.10 + 1.11 + if ( likely(!tb_init_done) ) 1.12 + return; 1.13 + 1.14 + d.vcpu = v->vcpu_id; 1.15 + d.domain = v->domain->domain_id; 1.16 + 1.17 + __trace_var(TRC_SCHED_CONTINUE_RUNNING, 1/*tsc*/, sizeof(d), 1.18 + (unsigned char *)&d); 1.19 +} 1.20 + 1.21 static inline void vcpu_runstate_change( 1.22 struct vcpu *v, int new_state, s_time_t new_entry_time) 1.23 { 1.24 @@ -803,6 +817,7 @@ static void schedule(void) 1.25 if ( unlikely(prev == next) ) 1.26 { 1.27 spin_unlock_irq(&sd->schedule_lock); 1.28 + trace_continue_running(next); 1.29 return continue_running(prev); 1.30 } 1.31
2.1 --- a/xen/include/public/trace.h Mon Mar 09 13:52:59 2009 +0000 2.2 +++ b/xen/include/public/trace.h Mon Mar 09 15:01:34 2009 +0000 2.3 @@ -60,7 +60,8 @@ 2.4 #define TRC_TRACE_WRAP_BUFFER (TRC_GEN + 2) 2.5 #define TRC_TRACE_CPU_CHANGE (TRC_GEN + 3) 2.6 2.7 -#define TRC_SCHED_RUNSTATE_CHANGE (TRC_SCHED_MIN + 1) 2.8 +#define TRC_SCHED_RUNSTATE_CHANGE (TRC_SCHED_MIN + 1) 2.9 +#define TRC_SCHED_CONTINUE_RUNNING (TRC_SCHED_MIN + 2) 2.10 #define TRC_SCHED_DOM_ADD (TRC_SCHED_VERBOSE + 1) 2.11 #define TRC_SCHED_DOM_REM (TRC_SCHED_VERBOSE + 2) 2.12 #define TRC_SCHED_SLEEP (TRC_SCHED_VERBOSE + 3)