From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH v2 03/16] xen: sched: improve domain creation tracing Date: Thu, 18 Feb 2016 11:04:49 +0000 Message-ID: <56C5A551.4050303@citrix.com> References: <20160216180550.27876.22680.stgit@Solace.station> <20160216181129.27876.21579.stgit@Solace.station> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aWMOE-0001pu-8F for xen-devel@lists.xenproject.org; Thu, 18 Feb 2016 11:04:54 +0000 In-Reply-To: <20160216181129.27876.21579.stgit@Solace.station> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dario Faggioli , xen-devel@lists.xenproject.org Cc: George Dunlap , Ian Campbell , Jan Beulich List-Id: xen-devel@lists.xenproject.org On 16/02/16 18:11, Dario Faggioli wrote: > by doing the following two things: > > - move TRC_SCHED_DOM_{ADD,REM}, into the functions > that do the actual scheduling-related domain > initialization; > > - add two 'generic' DOM_{ADD,REM} events. They're > made part of the TRC_DOM0 tracing class, as Dom0 > is, usually, from where domains are created and > destroyed. > > Signed-off-by: Dario Faggioli Reviewed-by: George Dunlap Since this changes domain.c, I guess this would need an ack from "The Rest" -- probably either from Jan or Ian, since they're somewhat familiar with this code...? -George > --- > Cc: George Dunlap > Cc: Konrad Rzeszutek Wilk > --- > Changes from v1: > * added generic domain creation and destruction events, as > suggested during review. > --- > xen/common/domain.c | 5 ++++- > xen/common/schedule.c | 4 ++-- > xen/include/public/trace.h | 6 ++++++ > 3 files changed, 12 insertions(+), 3 deletions(-) > > diff --git a/xen/common/domain.c b/xen/common/domain.c > index 425767c..45273d4 100644 > --- a/xen/common/domain.c > +++ b/xen/common/domain.c > @@ -270,6 +270,8 @@ struct domain *domain_create(domid_t domid, unsigned int domcr_flags, > > d->domain_id = domid; > > + TRACE_1D(TRC_DOM0_DOM_ADD, d->domain_id); > + > lock_profile_register_struct(LOCKPROF_TYPE_PERDOM, d, domid, "Domain"); > > if ( (err = xsm_alloc_security_domain(d)) != 0 ) > @@ -864,10 +866,11 @@ void domain_destroy(struct domain *d) > if ( atomic_cmpxchg(&d->refcnt, 0, DOMAIN_DESTROYED) != 0 ) > return; > > + TRACE_1D(TRC_DOM0_DOM_REM, d->domain_id); > + > cpupool_rm_domain(d); > > /* Delete from task list and task hashtable. */ > - TRACE_1D(TRC_SCHED_DOM_REM, d->domain_id); > spin_lock(&domlist_update_lock); > pd = &domain_list; > while ( *pd != d ) > diff --git a/xen/common/schedule.c b/xen/common/schedule.c > index c87922f..27695e3 100644 > --- a/xen/common/schedule.c > +++ b/xen/common/schedule.c > @@ -241,8 +241,6 @@ int sched_init_vcpu(struct vcpu *v, unsigned int processor) > if ( v->sched_priv == NULL ) > return 1; > > - TRACE_2D(TRC_SCHED_DOM_ADD, v->domain->domain_id, v->vcpu_id); > - > /* Idle VCPUs are scheduled immediately, so don't put them in runqueue. */ > if ( is_idle_domain(d) ) > { > @@ -369,12 +367,14 @@ void sched_destroy_vcpu(struct vcpu *v) > int sched_init_domain(struct domain *d) > { > SCHED_STAT_CRANK(dom_init); > + TRACE_1D(TRC_SCHED_DOM_ADD, d->domain_id); > return SCHED_OP(DOM2OP(d), init_domain, d); > } > > void sched_destroy_domain(struct domain *d) > { > SCHED_STAT_CRANK(dom_destroy); > + TRACE_1D(TRC_SCHED_DOM_REM, d->domain_id); > SCHED_OP(DOM2OP(d), destroy_domain, d); > } > > diff --git a/xen/include/public/trace.h b/xen/include/public/trace.h > index 274f8f6..5ef9c37 100644 > --- a/xen/include/public/trace.h > +++ b/xen/include/public/trace.h > @@ -85,6 +85,9 @@ > ((TRC_SCHED_##_c << TRC_SCHED_ID_SHIFT) & TRC_SCHED_ID_MASK) ) + \ > (_e & TRC_SCHED_EVT_MASK) ) > > +/* Trace classes for DOM0 operations */ > +#define TRC_DOM0_DOMOPS 0x00041000 /* Domains manipulations */ > + > /* Trace classes for Hardware */ > #define TRC_HW_PM 0x00801000 /* Power management traces */ > #define TRC_HW_IRQ 0x00802000 /* Traces relating to the handling of IRQs */ > @@ -113,6 +116,9 @@ > #define TRC_SCHED_SWITCH_INFNEXT (TRC_SCHED_VERBOSE + 15) > #define TRC_SCHED_SHUTDOWN_CODE (TRC_SCHED_VERBOSE + 16) > > +#define TRC_DOM0_DOM_ADD (TRC_DOM0_DOMOPS + 1) > +#define TRC_DOM0_DOM_REM (TRC_DOM0_DOMOPS + 2) > + > #define TRC_MEM_PAGE_GRANT_MAP (TRC_MEM + 1) > #define TRC_MEM_PAGE_GRANT_UNMAP (TRC_MEM + 2) > #define TRC_MEM_PAGE_GRANT_TRANSFER (TRC_MEM + 3) >