debuggers.hg
changeset 16650:8aa377fb1b1f
xenoprof: flush remaining smples when sampling is stopped.
Xenoprof notifies guest kernel via VIRQ_XENOPROF when sampled.
But it does coarsly based on heuristic so that sometimes VIRQ_XENOPROF
isn't delivered resulting in that oprofile daemon collects no sample.
To avoid that situation, always send VIRQ_XENOPROF when sampling is
stopped.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Xenoprof notifies guest kernel via VIRQ_XENOPROF when sampled.
But it does coarsly based on heuristic so that sometimes VIRQ_XENOPROF
isn't delivered resulting in that oprofile daemon collects no sample.
To avoid that situation, always send VIRQ_XENOPROF when sampling is
stopped.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Fri Dec 14 10:25:00 2007 +0000 (2007-12-14) |
parents | 75b56d086b26 |
children | 61ff9b393c83 |
files | xen/common/xenoprof.c |
line diff
1.1 --- a/xen/common/xenoprof.c Fri Dec 14 10:22:08 2007 +0000 1.2 +++ b/xen/common/xenoprof.c Fri Dec 14 10:25:00 2007 +0000 1.3 @@ -12,6 +12,7 @@ 1.4 #ifndef COMPAT 1.5 #include <xen/guest_access.h> 1.6 #include <xen/sched.h> 1.7 +#include <xen/event.h> 1.8 #include <public/xenoprof.h> 1.9 #include <xen/paging.h> 1.10 #include <xsm/xsm.h> 1.11 @@ -747,14 +748,30 @@ int do_xenoprof_op(int op, XEN_GUEST_HAN 1.12 break; 1.13 1.14 case XENOPROF_stop: 1.15 + { 1.16 + struct domain *d; 1.17 + struct vcpu *v; 1.18 + int i; 1.19 + 1.20 if ( xenoprof_state != XENOPROF_PROFILING ) 1.21 { 1.22 ret = -EPERM; 1.23 break; 1.24 } 1.25 xenoprof_arch_stop(); 1.26 + 1.27 + /* Flush remaining samples. */ 1.28 + for ( i = 0; i < adomains; i++ ) 1.29 + { 1.30 + if ( !active_ready[i] ) 1.31 + continue; 1.32 + d = active_domains[i]; 1.33 + for_each_vcpu(d, v) 1.34 + send_guest_vcpu_virq(v, VIRQ_XENOPROF); 1.35 + } 1.36 xenoprof_state = XENOPROF_READY; 1.37 break; 1.38 + } 1.39 1.40 case XENOPROF_disable_virq: 1.41 {