From patchwork Fri Feb 5 18:34:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 8238201 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 475C6BEEE5 for ; Fri, 5 Feb 2016 18:36:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4EA4820384 for ; Fri, 5 Feb 2016 18:36:45 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 56B2E2034A for ; Fri, 5 Feb 2016 18:36:44 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aRlCy-0003xs-Jy; Fri, 05 Feb 2016 18:34:16 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aRlCw-0003xF-Dl for xen-devel@lists.xenproject.org; Fri, 05 Feb 2016 18:34:14 +0000 Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id C8/6B-31122-52BE4B65; Fri, 05 Feb 2016 18:34:13 +0000 X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-6.tower-21.messagelabs.com!1454697253!14250336!1 X-Originating-IP: [74.125.82.67] X-SpamReason: No, hits=0.2 required=7.0 tests=RCVD_ILLEGAL_IP X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 14518 invoked from network); 5 Feb 2016 18:34:13 -0000 Received: from mail-wm0-f67.google.com (HELO mail-wm0-f67.google.com) (74.125.82.67) by server-6.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 5 Feb 2016 18:34:13 -0000 Received: by mail-wm0-f67.google.com with SMTP id 128so4176420wmz.3 for ; Fri, 05 Feb 2016 10:34:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:from:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=CKJyOfsDmZLF1IEzHYAyOmiMIaVaZtkiJIdHjsrh8ps=; b=ninE9ai8UsRP2aDjN6+ZDul9mXycZniKUCmySB2XP2c3sg9NKOJrjWvboz+TrexaQK uKks8zNDMyZ12w4x/xhZ0kn7vrsYkqfqmdT5TEC1EgF9yuQSyHNL5QuQ474KU49miu/u UchGOdKNG5FXxDTtMyWBddder4gY46EVSIpiC2OcfUFZL49aQ+s3DfnHf7y/tPHXFRzh bObBsuVIAQXlpWVhIUY26b0IcHm/jtVWHf3SIP7Bfd14+zHqUfB532RdS2HcmQN0+PCN afig4oanNPj9Lmm/F1NHzMtIeO/St888vuiPz19F2DYPdQ+Z+9HQ6ajVv4LG4+q6EZP3 pEiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:from:to:cc:date:message-id :in-reply-to:references:user-agent:mime-version:content-type :content-transfer-encoding; bh=CKJyOfsDmZLF1IEzHYAyOmiMIaVaZtkiJIdHjsrh8ps=; b=EuLgFpunsWlXz/7Of3Gisq100o3Jgc6i+nzY1mPVkXGDnyUr9n2247pnwogxdWpqke A3izq7TMDIEbN4nrcXHay1FSf8ei0KOoSII1o0rFtIxJ8Francr50AC4tOSFQGeG/3BT YKaqpEB/eOLFPewGmylfW1JzjxbwnaWEYxYSM/sse02vgWGKlGC+TYDUYwQci/rMqPLg ioxsdUdhj5ojPg1TfH63ySLy5CV/b6NUiyIbZvd0IliT/Cyi7U+ujrWhHXbr8uwmTTqg M2JhDon1p4SbbIvJgoDCuHMskXAEsOtgXthoZPTsRd+mCIo80hfeCFBmC5gmM+a76b2b vS/g== X-Gm-Message-State: AG10YORc2H5LcEbc+f96kMpLSRJ5DcdW91BujSrZb9FwDajhujgW5Tr4gkk/jQnM/wRJKw== X-Received: by 10.28.187.198 with SMTP id l189mr30992613wmf.0.1454697252965; Fri, 05 Feb 2016 10:34:12 -0800 (PST) Received: from Solace.station (net-2-35-170-8.cust.vodafonedsl.it. [2.35.170.8]) by smtp.gmail.com with ESMTPSA id i1sm2118806wjs.45.2016.02.05.10.34.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Feb 2016 10:34:11 -0800 (PST) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Fri, 05 Feb 2016 19:34:05 +0100 Message-ID: <20160205183405.4543.28487.stgit@Solace.station> In-Reply-To: <20160205183137.4543.56523.stgit@Solace.station> References: <20160205183137.4543.56523.stgit@Solace.station> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Cc: Olaf Hering , Tianyang Chen , Meng Xu , George Dunlap Subject: [Xen-devel] [PATCH 05/14] xen: RTDS: pack trace data better for xentrace_format X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP when tracing runstate changes, the vcpu and domain IDs are encoded in the lower and higher, respectively, parts of a 32 bits integer. When decoding a trace with xentrace_format, this makes it possible to display such events like this: CPU0 833435853624 (+ 768) running_to_runnable [ dom:vcpu = 0x7fff0000 ] CPU0 833435854416 (+ 792) runnable_to_running [ dom:vcpu = 0x00000007 ] For consistency, we should do the same when displaying the events coming from the RTDS scheduler (when using the same tool), and to do that, we need to invert the order in which the fields are being put in the trace struct right now. While there, we also: - fix the use of TRC_RTDS_SCHED_TASKLET (it should only be involved when a tasklet is scheduled, not _every_ time rt_schedule() is invoked!); - remove a very chatty and useless (nothing has been picked!) use of TRC_RTDS_RUNQ_PICK. Signed-off-by: Dario Faggioli Reviewed-by: Konrad Rzeszutek Wilk --- Cc: George Dunlap Cc: Meng Xu Cc: Tianyang Chen Cc: Olaf Hering --- xen/common/sched_rt.c | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c index 2e5430f..53de6d6 100644 --- a/xen/common/sched_rt.c +++ b/xen/common/sched_rt.c @@ -362,7 +362,7 @@ rt_update_deadline(s_time_t now, struct rt_vcpu *svc) /* TRACE */ { struct { - unsigned dom:16,vcpu:16; + unsigned vcpu:16, dom:16; unsigned cur_deadline_lo, cur_deadline_hi; unsigned cur_budget_lo, cur_budget_hi; } d; @@ -711,7 +711,7 @@ burn_budget(const struct scheduler *ops, struct rt_vcpu *svc, s_time_t now) /* TRACE */ { struct { - unsigned dom:16, vcpu:16; + unsigned vcpu:16, dom:16; unsigned cur_budget_lo; unsigned cur_budget_hi; int delta; @@ -763,7 +763,7 @@ __runq_pick(const struct scheduler *ops, const cpumask_t *mask) if( svc != NULL ) { struct { - unsigned dom:16, vcpu:16; + unsigned vcpu:16, dom:16; unsigned cur_deadline_lo, cur_deadline_hi; unsigned cur_budget_lo, cur_budget_hi; } d; @@ -777,8 +777,6 @@ __runq_pick(const struct scheduler *ops, const cpumask_t *mask) sizeof(d), (unsigned char *) &d); } - else - trace_var(TRC_RTDS_RUNQ_PICK, 1, 0, NULL); } return svc; @@ -845,6 +843,7 @@ rt_schedule(const struct scheduler *ops, s_time_t now, bool_t tasklet_work_sched if ( tasklet_work_scheduled ) { + trace_var(TRC_RTDS_SCHED_TASKLET, 1, 0, NULL); snext = rt_vcpu(idle_vcpu[cpu]); } else @@ -885,24 +884,6 @@ rt_schedule(const struct scheduler *ops, s_time_t now, bool_t tasklet_work_sched ret.time = MIN(snext->budget, MAX_SCHEDULE); /* sched quantum */ ret.task = snext->vcpu; - /* TRACE */ - { - struct { - unsigned dom:16,vcpu:16; - unsigned cur_deadline_lo, cur_deadline_hi; - unsigned cur_budget_lo, cur_budget_hi; - } d; - d.dom = snext->vcpu->domain->domain_id; - d.vcpu = snext->vcpu->vcpu_id; - d.cur_deadline_lo = (unsigned) snext->cur_deadline; - d.cur_deadline_hi = (unsigned) (snext->cur_deadline >> 32); - d.cur_budget_lo = (unsigned) snext->cur_budget; - d.cur_budget_hi = (unsigned) (snext->cur_budget >> 32); - trace_var(TRC_RTDS_SCHED_TASKLET, 1, - sizeof(d), - (unsigned char *)&d); - } - return ret; }