From patchwork Fri Feb 5 18:33:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 8238181 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BB6AA9F3CD for ; Fri, 5 Feb 2016 18:36:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D594520375 for ; Fri, 5 Feb 2016 18:36:28 +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 DA7F42034A for ; Fri, 5 Feb 2016 18:36:27 +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 1aRlCl-0003su-2L; Fri, 05 Feb 2016 18:34:03 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aRlCj-0003s8-Vd for xen-devel@lists.xenproject.org; Fri, 05 Feb 2016 18:34:02 +0000 Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id C7/B6-12946-91BE4B65; Fri, 05 Feb 2016 18:34:01 +0000 X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-13.tower-31.messagelabs.com!1454697240!20114163!1 X-Originating-IP: [74.125.82.68] 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 36711 invoked from network); 5 Feb 2016 18:34:00 -0000 Received: from mail-wm0-f68.google.com (HELO mail-wm0-f68.google.com) (74.125.82.68) by server-13.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 5 Feb 2016 18:34:00 -0000 Received: by mail-wm0-f68.google.com with SMTP id 128so4175578wmz.3 for ; Fri, 05 Feb 2016 10:34:00 -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=tdUL07bKwFNPL8Bef2jmKC8oyS6UowPow3jmq4rN6JE=; b=VyorM12o57Iwq5XlvlZfuWiIJuw1D7+etF23f4XhF79kTXdRXXrDe3z6aIAocQId5g PGZRwcAZYyRfpXwJMuseRL3qxjop9l4zyxE3UxHpDcvl63SfsvR4YuJnUv6GEJXgHofL oZklUOixzNZdoQ8cx1tQ2+PF58fJz/dGvsA2nhXqi7SLvG0ODbFNUS7U8nCuINhkjrVl 5AvFsl5ZF7vOwgjpNBW6yQP+lHMa7tY/uX1J0BQZ6WgVTsEkp9KD+R8o04E0S0je/7C7 vbKur+Pj12lNBRkaiJQNPNfPc7kM2izKIXS5IZ81BFNYVObTVDUcGoTH+vexDIMkMW6G weMw== 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=tdUL07bKwFNPL8Bef2jmKC8oyS6UowPow3jmq4rN6JE=; b=A1HRNciiUphGZAF2W80W9OR7vNOaNg8f2LDz8clqYBOX2L+PIgZyjWG51L23JcrGw8 QSo7SwKFAWbPl01PHQgOfrcKDQVKmNo4bhPjfB4H3Hc9pc2bU/0VVuxWWPJMZoTOBX6g 1y3hPsu1+M17tNFLRsOp2orl+ZKi55ZGEQ8vROQ10bfJLtK4dTw4ms6RqAJ75Tpmx3cz rZNW3WvlgWJyhr9DwKAyvOjJysHQsE1X9sZJ+uuIFRrp0lkPu/TOtpw2L92FoI9IzUJX CzGf6MyIMY5DFt/zkD0PnKKFDA9WFULiIW7Tv9UXTYe0V1SHBzALLoxE1twTF10o6G3t ehrA== X-Gm-Message-State: AG10YOT2qZYSmH0SW1OKLX5fUZbOt8zEef+iNXipAWDJt9Ep5wMsg1JhzvkTmoJLyUCARw== X-Received: by 10.28.216.134 with SMTP id p128mr35693558wmg.59.1454697240232; Fri, 05 Feb 2016 10:34:00 -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 bg1sm17086204wjc.27.2016.02.05.10.33.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Feb 2016 10:33:59 -0800 (PST) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Fri, 05 Feb 2016 19:33:57 +0100 Message-ID: <20160205183357.4543.57665.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 , George Dunlap Subject: [Xen-devel] [PATCH 04/14] xen: credit2: 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 Credit2 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. Signed-off-by: Dario Faggioli Reviewed-by: Konrad Rzeszutek Wilk --- Cc: George Dunlap Cc: Olaf Hering --- xen/common/sched_credit2.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c index 78220a7..cf40f68 100644 --- a/xen/common/sched_credit2.c +++ b/xen/common/sched_credit2.c @@ -382,7 +382,7 @@ __update_svc_load(const struct scheduler *ops, { struct { - unsigned dom:16,vcpu:16; + unsigned vcpu:16, dom:16; unsigned v_avgload:32; } d; d.dom = svc->vcpu->domain->domain_id; @@ -450,7 +450,7 @@ runq_insert(const struct scheduler *ops, unsigned int cpu, struct csched2_vcpu * { struct { - unsigned dom:16,vcpu:16; + unsigned vcpu:16, dom:16; unsigned pos; } d; d.dom = svc->vcpu->domain->domain_id; @@ -536,7 +536,7 @@ runq_tickle(const struct scheduler *ops, unsigned int cpu, struct csched2_vcpu * /* TRACE */ { struct { - unsigned dom:16,vcpu:16; + unsigned vcpu:16, dom:16; unsigned credit; } d; d.dom = cur->vcpu->domain->domain_id; @@ -561,9 +561,9 @@ tickle: /* TRACE */ { struct { - unsigned cpu:8; + unsigned cpu:16, pad:16; } d; - d.cpu = ipid; + d.cpu = ipid; d.pad = 0; trace_var(TRC_CSCHED2_TICKLE, 0, sizeof(d), (unsigned char *)&d); @@ -634,7 +634,7 @@ static void reset_credit(const struct scheduler *ops, int cpu, s_time_t now, /* TRACE */ { struct { - unsigned dom:16,vcpu:16; + unsigned vcpu:16, dom:16; unsigned credit_start, credit_end; unsigned multiplier; } d; @@ -683,7 +683,7 @@ void burn_credits(struct csched2_runqueue_data *rqd, struct csched2_vcpu *svc, s /* TRACE */ { struct { - unsigned dom:16,vcpu:16; + unsigned vcpu:16, dom:16; unsigned credit; int delta; } d; @@ -812,7 +812,7 @@ __runq_assign(struct csched2_vcpu *svc, struct csched2_runqueue_data *rqd) /* TRACE */ { struct { - unsigned dom:16,vcpu:16; + unsigned vcpu:16, dom:16; unsigned rqi:16; } d; d.dom = svc->vcpu->domain->domain_id;