From patchwork Tue Feb 16 18:11:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 8330481 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 97D369F399 for ; Tue, 16 Feb 2016 18:14:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B68B120268 for ; Tue, 16 Feb 2016 18:14:06 +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 A786A202D1 for ; Tue, 16 Feb 2016 18:14:05 +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 1aVk6A-0003Nf-Lp; Tue, 16 Feb 2016 18:11:42 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aVk69-0003N4-7x for xen-devel@lists.xenproject.org; Tue, 16 Feb 2016 18:11:41 +0000 Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id DF/A3-07651-C5663C65; Tue, 16 Feb 2016 18:11:40 +0000 X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-3.tower-31.messagelabs.com!1455646299!22886598!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 28709 invoked from network); 16 Feb 2016 18:11:40 -0000 Received: from mail-wm0-f67.google.com (HELO mail-wm0-f67.google.com) (74.125.82.67) by server-3.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 16 Feb 2016 18:11:40 -0000 Received: by mail-wm0-f67.google.com with SMTP id a4so16749026wme.3 for ; Tue, 16 Feb 2016 10:11:39 -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=7wm9023981fP6P+nx59RduBWEQ7fbMgpPhW/UACWdYU=; b=EyYyTorAew5h2IF26e3R2jJMLgD8VsTq2RoDUmfQXyfd41tubcggGDmmx0tLIFW8nf otsLNQKDeDuXefwpj8L7eqWA+TIYrf8bJLJsoxAyeEsOjrUKuY//nFRRvRr9Fq2Wf3wW hXTwVMWG4E+9aGUhbYHcXM/CJOMlOXzxkr7Qp5lbK/2R7EApaBJOxvtu6wzSGliD3Wy4 gDtU9xvLOgMxSy5ndbSicg6udQtFu8fI8nqTYc0QNkB93JNXUMfI6CJeUeVZGnUiW5BK 3q3W7w+jVwTEDI5IH9kWWUQYNasNun5uleDZKsunZJ+d2fAoHN4RXpcC/rB2rWUX5x7T UYDQ== 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=7wm9023981fP6P+nx59RduBWEQ7fbMgpPhW/UACWdYU=; b=OY9oKVxKNFitXq77Fzdo1thpqdOCaTArLNvVNJ+0HJ2mNEMk9r8X5Jn4vJ/B8gg7PZ aWhKVFlhaO3X0lhJ8FyjCT7f6g3AgSs8rZXyfRAQNHcMWF5xw1id8NMIvbZ58zJwwYM0 suDdxJebjioxkaZdaWXlDahHQDxv0F+lmcgjcTyFY51CGGdkZq8uaOTt1/2sKM403IxX 2yv5E3QKpz/K2j3J9R+MM11DUQaF/MLwJH0FQXCruR5Dvoc2S6huUxmT9SQIxA1HT9Un MJwea2f4NwizSgw0p5ckldZTctdgBIz9dOHhJr7l0ZU2ZO/k4UzpaNB/JFwIBAFj6guG X1Ig== X-Gm-Message-State: AG10YOSF4zdfxPo25kYqpyAh+x+0noKKBx4So8NfnwiQF1625DBjtNB/i0zgzqpvBZSMKw== X-Received: by 10.194.92.226 with SMTP id cp2mr23059927wjb.180.1455646299794; Tue, 16 Feb 2016 10:11:39 -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 u4sm31361245wjz.4.2016.02.16.10.11.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Feb 2016 10:11:39 -0800 (PST) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Tue, 16 Feb 2016 19:11:37 +0100 Message-ID: <20160216181136.27876.29825.stgit@Solace.station> In-Reply-To: <20160216180550.27876.22680.stgit@Solace.station> References: <20160216180550.27876.22680.stgit@Solace.station> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Cc: Olaf Hering , George Dunlap Subject: [Xen-devel] [PATCH v2 04/16] 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 Acked-by: George Dunlap --- 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;