From patchwork Thu Jan 26 00:30:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 9538199 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 866E3604A7 for ; Thu, 26 Jan 2017 00:32:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7754426B39 for ; Thu, 26 Jan 2017 00:32:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A51927F85; Thu, 26 Jan 2017 00:32:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1AACB26B39 for ; Thu, 26 Jan 2017 00:32:36 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWXxY-0005yR-63; Thu, 26 Jan 2017 00:30:40 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWXxX-0005xf-4S for xen-devel@lists.xenproject.org; Thu, 26 Jan 2017 00:30:39 +0000 Received: from [193.109.254.147] by server-1.bemta-6.messagelabs.com id 83/14-27678-E2349885; Thu, 26 Jan 2017 00:30:38 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpkleJIrShJLcpLzFFi42Lxqg1y0tV17ow wmDtH3eL7lslMDowehz9cYQlgjGLNzEvKr0hgzbj3fjtTwQr1ihcHfjE1ME6U7GLk4hASmMEo cenIfCYQh0VgDavEn/arrCCOhMAlVom51xcwdjFyAjkxEl+nP2KHsMsknj6cywxiCwmoSNzcv ooJwp7GJHH2bAaILSygJ3Hk6A92CNtXovfachYQm03AQOLNjr2sILaIgJLEvVWTgXo5OJgF9C VWf+UBMVkEVCUWflEAqeAV8JbYd2od2BROIHvG5A9g1UICXhLTDuSAhEUF5CRWXm5hhSgXlDg 58wkLxEBNifW79EHCzALyEtvfzmGewCgyC0nVLISqWUiqFjAyr2LUKE4tKkst0jUy0ksqykzP KMlNzMzRNTQw08tNLS5OTE/NSUwq1kvOz93ECAx8BiDYwbhmfuAhRkkOJiVR3pvanRFCfEn5K ZUZicUZ8UWlOanFhxg1ODgEJpydO51JiiUvPy9VSYLXxgmoTrAoNT21Ii0zBxibMKUSHDxKIr yeIGne4oLE3OLMdIjUKUZjjlM3Tr9k4ti16/JLJiGwSVLivHYgpQIgpRmleXCDYCnjEqOslDA vI9CZQjwFqUW5mSWo8q8YxTkYlYR5PUCm8GTmlcDtewV0ChPQKReY20FOKUlESEk1MCq+mjh1 w/xuGYv+ButgS/bVJfpJKoa8k7jv1TBPFZdpbv30xc1cqpxtRtD61Es/3/74HBp9Tft+/sz9f xf6nXz50f5S2fMvm3lemLnxijrLH98tY99/yXWS1bvVyT2JlQnZOzI2rrxjfz8g857+z5kelz i2fFi5983ui4bajxza5vnbaqcz7FBiKc5INNRiLipOBADZoeCfFAMAAA== X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-15.tower-27.messagelabs.com!1485390637!30913417!1 X-Originating-IP: [74.125.82.66] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 19491 invoked from network); 26 Jan 2017 00:30:37 -0000 Received: from mail-wm0-f66.google.com (HELO mail-wm0-f66.google.com) (74.125.82.66) by server-15.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 26 Jan 2017 00:30:37 -0000 Received: by mail-wm0-f66.google.com with SMTP id c85so46335213wmi.1 for ; Wed, 25 Jan 2017 16:30:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=fyAlEwh/l0/BnRt1aEqYngd1qgS5BJvB6psO4l1hWdg=; b=RGDTK6crt+ppL3Qyns2jQalKdhsGuNLAJQXAxRzPe0N0vmVxWNOM8TwshErem3A6Ey 59fR6OFmqi1K+XbiRHTds4bezsxyM41sPJaCnj33UU5AhqP1Z/fcUTkF81wf11/aB+GW cua21556IygJhzIse8lgY6xi1yWgOlg1gTfoU0BrYDVzcEPPZs1yAhZhtPKmTN8LjVyL ANPLtatwLFPqHCQgu/ghviCYKD92HJwgmKhcUP7IsWULZfj0SmSoScIswoQnt7POBOGH U/N/v0bCt7UD12/AufUabV5kL6qvweiNwppA8GMZ89tg9Y0C9Lwn8fVJdhXnf1LeL5Ds 1aXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:cc:date:message-id :in-reply-to:references:user-agent:mime-version :content-transfer-encoding; bh=fyAlEwh/l0/BnRt1aEqYngd1qgS5BJvB6psO4l1hWdg=; b=tgMxiycco2CY7CSIf1sLcQQeDMB1nBIh+XcBX8AXGsHc8dYJcl1vxN1sszOYR5LrY3 I6bgf7Nz6PVIngLA5yjvIh3WqTvwpRerH7ikYUqMotF0LvwOrBpdHrHwqlTSFU2DtYZh W23GXimVXNfQ6anH928gL0xmH3QzLAiS0sU1s7qxyzJx4mzeC/iiBAQMvHGpnQkttj3m 67Gp2QQm06sSOhNorcCwB3vyQNLx5+igQQsqIHcIsg3ZNCa3jHMsxcBjiUL30v7Kxa4B BQam/QWqbviIHc5cFP3L9vG5+xw4p9NvCS2hVTwG3CXW9yuvoGwWlEzw69qkKRl+ZTpy ILhQ== X-Gm-Message-State: AIkVDXJmu88ezq3SCO/CJe2x8Pz5jqbbSM6fw1NVyr7Jz23CAFHLQIc7NKWlQAXYLQrFlg== X-Received: by 10.28.13.16 with SMTP id 16mr321220wmn.101.1485390637196; Wed, 25 Jan 2017 16:30:37 -0800 (PST) Received: from Solace.fritz.box (58-209-66-80.hosts.abilene.it. [80.66.209.58]) by smtp.gmail.com with ESMTPSA id g71sm970950wmc.9.2017.01.25.16.30.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jan 2017 16:30:36 -0800 (PST) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Thu, 26 Jan 2017 01:30:35 +0100 Message-ID: <148539063552.5464.11983958099406902513.stgit@Solace.fritz.box> In-Reply-To: <148539008889.5464.5896389113741708672.stgit@Solace.fritz.box> References: <148539008889.5464.5896389113741708672.stgit@Solace.fritz.box> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Cc: George Dunlap Subject: [Xen-devel] [PATCH 7/9] xen/tools: tracing: credits can go negative, so use int. X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP For Credit2, in both the trace records, inside Xen, and in their parsing, in xenalyze. In fact, it is a lot easier to figure out how much negative credits have gone for a certain vCPU by looking at a negative integer, rather than to an overflowed unsigned. Signed-off-by: Dario Faggioli --- Cc: George Dunlap --- tools/xentrace/xenalyze.c | 20 ++++++++++---------- xen/common/sched_credit2.c | 10 +++++----- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c index f006804..a90da20 100644 --- a/tools/xentrace/xenalyze.c +++ b/tools/xentrace/xenalyze.c @@ -7651,11 +7651,11 @@ void sched_process(struct pcpu_info *p) case TRC_SCHED_CLASS_EVT(CSCHED2, 3): /* CREDIT_BURN */ if(opt.dump_all) { struct { - unsigned int vcpuid:16, domid:16, credit; - int delta; + unsigned int vcpuid:16, domid:16; + int credit, delta; } *r = (typeof(r))ri->d; - printf(" %s csched2:burn_credits d%uv%u, credit = %u, delta = %d\n", + printf(" %s csched2:burn_credits d%uv%u, credit = %d, delta = %d\n", ri->dump_header, r->domid, r->vcpuid, r->credit, r->delta); } @@ -7664,10 +7664,10 @@ void sched_process(struct pcpu_info *p) if(opt.dump_all) { struct { unsigned int vcpuid:16, domid:16; - unsigned int credit; + int credit; } *r = (typeof(r))ri->d; - printf(" %s csched2:tickle_check d%uv%u, credit = %u\n", + printf(" %s csched2:tickle_check d%uv%u, credit = %d\n", ri->dump_header, r->domid, r->vcpuid, r->credit); } break; @@ -7685,12 +7685,12 @@ void sched_process(struct pcpu_info *p) if(opt.dump_all) { struct { unsigned int vcpuid:16, domid:16; - unsigned int credit_start, credit_end; + int credit_start, credit_end; unsigned int multiplier; } *r = (typeof(r))ri->d; printf(" %s csched2:reset_credits d%uv%u, " - "credit_start = %u, credit_end = %u, mult = %u\n", + "credit_start = %d, credit_end = %d, mult = %u\n", ri->dump_header, r->domid, r->vcpuid, r->credit_start, r->credit_end, r->multiplier); } @@ -7752,12 +7752,12 @@ void sched_process(struct pcpu_info *p) case TRC_SCHED_CLASS_EVT(CSCHED2, 13): /* TICKLE_NEW */ if (opt.dump_all) { struct { - unsigned vcpuid:16, domid:16; - unsigned processor, credit; + unsigned int vcpuid:16, domid:16, processor; + int credit; } *r = (typeof(r))ri->d; printf(" %s csched2:runq_tickle_new d%uv%u, " - "processor = %u, credit = %u\n", + "processor = %u, credit = %d\n", ri->dump_header, r->domid, r->vcpuid, r->processor, r->credit); } diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c index 07e0a6d..43db669 100644 --- a/xen/common/sched_credit2.c +++ b/xen/common/sched_credit2.c @@ -1165,7 +1165,8 @@ runq_tickle(const struct scheduler *ops, struct csched2_vcpu *new, s_time_t now) { struct { unsigned vcpu:16, dom:16; - unsigned processor, credit; + unsigned processor; + int credit; } d; d.dom = new->vcpu->domain->domain_id; d.vcpu = new->vcpu->vcpu_id; @@ -1264,7 +1265,7 @@ runq_tickle(const struct scheduler *ops, struct csched2_vcpu *new, s_time_t now) { struct { unsigned vcpu:16, dom:16; - unsigned credit; + int credit; } d; d.dom = cur->vcpu->domain->domain_id; d.vcpu = cur->vcpu->vcpu_id; @@ -1378,7 +1379,7 @@ static void reset_credit(const struct scheduler *ops, int cpu, s_time_t now, { struct { unsigned vcpu:16, dom:16; - unsigned credit_start, credit_end; + int credit_start, credit_end; unsigned multiplier; } d; d.dom = svc->vcpu->domain->domain_id; @@ -1428,8 +1429,7 @@ void burn_credits(struct csched2_runqueue_data *rqd, { struct { unsigned vcpu:16, dom:16; - unsigned credit; - int delta; + int credit, delta; } d; d.dom = svc->vcpu->domain->domain_id; d.vcpu = svc->vcpu->vcpu_id;