From patchwork Wed Jan 18 11:32:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 9523475 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 DFA67601B7 for ; Wed, 18 Jan 2017 11:34:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB9582841C for ; Wed, 18 Jan 2017 11:34:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C07CC284EF; Wed, 18 Jan 2017 11:34:25 +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 48BC52841C for ; Wed, 18 Jan 2017 11:34:25 +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 1cToTb-0000N3-VX; Wed, 18 Jan 2017 11:32:27 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cToTb-0000Mu-2L for xen-devel@lists.xenproject.org; Wed, 18 Jan 2017 11:32:27 +0000 Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id 55/09-25657-A425F785; Wed, 18 Jan 2017 11:32:26 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrAIsWRWlGSWpSXmKPExsVyMfTSEV3PoPo Ig0/rtC2+b5nM5MDocfjDFZYAxijWzLyk/IoE1ozG66wFe9UrHnR1MTcwLpLsYuTiEBKYxijx e94xxi5GTg4WgamsEn8X1IMkJAQ2skpMWdvCCpKQEIiROLDpPjuEXSXx5eUXFhBbSEBF4ub2V UwQk2YySTRfvAc2SVhAT+LI0R/sELanxLHu2UwgNpuAgcSbHXvBhooIKEncWzUZKM7BwSygL7 H6Kw/EEaoSV2eeBGvlFfCS2DtvGlirqICcxMrLEPfwCghKnJz5hAWiVVNi/S59kDCzgLzE9rd zmCcwCs1CUjULoWoWkqoFjMyrGDWKU4vKUot0jQz0kooy0zNKchMzc3QNDYz1clOLixPTU3MS k4r1kvNzNzECQ7megYFxB2PzCb9DjJIcTEqivMut6iOE+JLyUyozEosz4otKc1KLDzFqcHAIT Dg7dzqTFEtefl6qkgTvtwCgOsGi1PTUirTMHGC0wZRKcPAoifCGBgKleYsLEnOLM9MhUqcYLT l6uk6/ZOI4dQNE7tl1+SWTENg8KXHeoyDzBEAaMkrz4MbBEsIlRlkpYV5GBgYGIZ6C1KLczBJ U+VeM4hyMSsK8OiBreTLzSuC2vgI6iAnoICtlsINKEhFSUg2Mq+WFdhaLrD+93uPf42CdxcbV nZLcM6O/9z0Xqi5kqP8bwXjhTvyXNU+OVR6T8tSaGvHlccXp1w/0BZr1raLUuxw3as2IW+c6q eXirJ0XJLg5s0+yrxWc3vHiG9MC+zvSQmErVwvImtQ1qFVHq2eZLinrYiqVqu4Vdrwlscv/9a fNDw9sbw1RYinOSDTUYi4qTgQAYTKc0wMDAAA= X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-7.tower-31.messagelabs.com!1484739145!73603760!1 X-Originating-IP: [209.85.210.196] 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 16688 invoked from network); 18 Jan 2017 11:32:25 -0000 Received: from mail-wj0-f196.google.com (HELO mail-wj0-f196.google.com) (209.85.210.196) by server-7.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 18 Jan 2017 11:32:25 -0000 Received: by mail-wj0-f196.google.com with SMTP id kq3so70449wjc.3 for ; Wed, 18 Jan 2017 03:32:25 -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:user-agent:mime-version :content-transfer-encoding; bh=wnphqnz4klfauvTgfmg29GcNOzEPajQZKXsTFmzct68=; b=JtYHd07DPekp/E8IBYkp7QhBKdHoWUnSrRvlpqroBUq8kW+JZX4dWx2lHbp0xO2xKH gaahL/7UDvThiS0aFNupipKjCmGNQbzRJjhHw2Yg5IRuZ96ps2qwtv2VoDEkbSevMofY 95rSY5KOVrUqyjM5oRAKP1+KlR7sgWrSNI5Q85KApWHV67ch60hXWK//8UTBqmt7z43m 0bVOa60hKSKk847deo5TA5w2GpuyfreWuF0esCH6v1phCK/NBkA4kj7bKyePGe0J9Dq1 svCQhrlJtenTHp9TazSJcUVzObVz6C5cmi4ej0Hr2k1ijcdM3ZtUd3dJVYKi4IivTMG9 GcRA== 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 :user-agent:mime-version:content-transfer-encoding; bh=wnphqnz4klfauvTgfmg29GcNOzEPajQZKXsTFmzct68=; b=a9iIkxdvA9Pk3mprpdcVcch5XrAKp2jg6rKjVODUkbEWfKGZZrwDhbrta5Nq3eiMtv 1nqErin7kyotd53YA8AwdfIG4bKx0mVODs33/shkFiiG/+prtGzByw/RGlh6J+Wf1i3S XsOJJHw0oTF9nN8rpoNraN5l1vvjTgxhlKK7UTUF+DkTRlanQzB33GwCc7Ym6rRNkRRO dl9Gnj9mACLAO2yUj1Z3lxvzLuT81avioUeV10/o/Cu3vq7LvSFA41TvBsYwsOgfNuVe JDtnRTnnm9MiHfl7lvrH3NOLJ1L+GEnkGdZSOE+4JAfLPP+rGBVj5VM2V/cCEDQcHA80 v3Qg== X-Gm-Message-State: AIkVDXLf27D8bD49z+c6JBcO84+gEPDyPXe8IRZz8T8+RpZm1+z5aT+P/lsbnmYvlkI0+g== X-Received: by 10.223.161.130 with SMTP id u2mr2877427wru.127.1484739145132; Wed, 18 Jan 2017 03:32:25 -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 w197sm4223775wmd.11.2017.01.18.03.32.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jan 2017 03:32:24 -0800 (PST) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Wed, 18 Jan 2017 12:32:21 +0100 Message-ID: <148473914164.9335.6204473573821205058.stgit@Solace.fritz.box> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Cc: George Dunlap Subject: [Xen-devel] [PATCH] 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, as it is quite a bit better, in order to understand how much negative credits have gone for a certain vCPU, to see an actual negative number, as compared to a wrapped around unsigned! Signed-off-by: Dario Faggioli Reviewed-by: George Dunlap --- 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 ef8e0d8..50a5115 100644 --- a/xen/common/sched_credit2.c +++ b/xen/common/sched_credit2.c @@ -930,7 +930,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; @@ -1026,7 +1027,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; @@ -1131,7 +1132,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; @@ -1181,8 +1182,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;