From patchwork Wed Aug 17 17:18:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 9286215 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 E1F3260839 for ; Wed, 17 Aug 2016 17:20:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D1E12294CD for ; Wed, 17 Aug 2016 17:20:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C669B294DC; Wed, 17 Aug 2016 17:20:59 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,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 5972B294CD for ; Wed, 17 Aug 2016 17:20:59 +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 1ba4UJ-0000Bw-Tz; Wed, 17 Aug 2016 17:18:47 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ba4UJ-0000B3-0f for xen-devel@lists.xenproject.org; Wed, 17 Aug 2016 17:18:47 +0000 Received: from [193.109.254.147] by server-1.bemta-6.messagelabs.com id FA/52-21406-67C94B75; Wed, 17 Aug 2016 17:18:46 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpkleJIrShJLcpLzFFi42Lxqg1y0i2dsyX c4HOLjsX3LZOZHBg9Dn+4whLAGMWamZeUX5HAmrH543Smgkb1ig+PLRsYd0l3MXJxCAlMZ5TY uqmPuYuRk4NFYA2rxNIlWSC2hMAlVok1tyMg7BiJa6//skPYFRL/PpwCs4UEVCRubl/FBDFoH pPEgrZNbCAJYQE9iSNHf7BD2LESE7f1MILYbAIGEm927GUFsUUElCTurZrMBGIzAw1d8fIGE8 QRqhI7ls4F6+UV8JC4enwa2ExOAR+JW6t/s0As9pY4PLkHLC4qICex8nILK0S9oMTJmU+Aaji AZmpKrN+lDzFeXmL72znMExhFZiGpmoVQNQtJ1QJG5lWM6sWpRWWpRbrmeklFmekZJbmJmTm6 hgZmermpxcWJ6ak5iUnFesn5uZsYgYHPAAQ7GGde9j/EKMnBpCTKe6d6S7gQX1J+SmVGYnFGf FFpTmrxIUYNDg6BCWfnTmeSYsnLz0tVkuDdOAuoTrAoNT21Ii0zBxibMKUSHDxKIryss4HSvM UFibnFmekQqVOMxhxnXt5ey8SxZeq9tUxCYJOkxHmfgUwSACnNKM2DGwRLGZcYZaWEeRmBzhT iKUgtys0sQZV/xSjOwagkzPsJZApPZl4J3L5XQKcwAZ3Cyw92SkkiQkqqgTFswx//sJdq7TsV zTausk5vuVmzKNFBUri1ZTuDbpaNSoBJg1XCsS+XtAz6ZpZIruvNv2Opkdh//KtBuFAT46Nzn 2bs3vfsY45M3fX/kto7yy+XsF6xvLBb2Hz2ip1PJ/0WX5wV4KOs/CJwz3vT7Oqzd5zcfwu35r xc8CZ/au+OUCd//Vk+HEosxRmJhlrMRcWJACSWbxgUAwAA X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-4.tower-27.messagelabs.com!1471454325!53622598!1 X-Originating-IP: [74.125.82.66] X-SpamReason: No, hits=0.2 required=7.0 tests=RCVD_ILLEGAL_IP X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 5746 invoked from network); 17 Aug 2016 17:18:45 -0000 Received: from mail-wm0-f66.google.com (HELO mail-wm0-f66.google.com) (74.125.82.66) by server-4.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 17 Aug 2016 17:18:45 -0000 Received: by mail-wm0-f66.google.com with SMTP id i5so26283050wmg.2 for ; Wed, 17 Aug 2016 10:18:45 -0700 (PDT) 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-transfer-encoding; bh=rq/gOYEgHXKi8/0KiFtBb4zX7zoWc80ZjtakaFvzNoU=; b=hsGb3HOzz/1UX2KZQNLH/XJxnhw2lf9JZZBBNH87IWS5FEGol7LwBXU2NYwFQjk0iH FhH/s3QITRgmr4sGvPy1XElPinC38BKmXr1196/O+zmRWOmb9h5td4DU+/zXGuyQTQ+j z7phnUyHxU9P5LJXggKqN/eEFuhtco1+ujTmneLKpsHIw9SOu0G8NKyYBI5oilHW4jyj X8xqAVkWvcGTiJC2utEoDV5YYj6iMsbIv4rivdcqxkHAM/YtzzgRnFhIb4QanwWz47px E6/g6YMplFuj05dNpoqY6lb8kdaYDg/ctUaLzoai4cfetDwgkjMxKNr8KCpi5d08H4Az C0QA== 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-transfer-encoding; bh=rq/gOYEgHXKi8/0KiFtBb4zX7zoWc80ZjtakaFvzNoU=; b=J02eJwtwbf5cfwWblR9pt/Hr6G2EDa0PSgwolSXQTqZG/uEFaK3+llpAKlQZNsOapA Y2k4/9M/zLpUUqNVbLzeR5a42OB7sjAImq0asVxYI5pA08mnzCCZx0xLIE4IyhwdfGGi dCDrBO7U9SwSKqJn/ycBNV8tLXu6V8dY82WaOgEG8QGjaJmHjTnqmFNb5qocMK1A5+UP DU+qCoTOWFezDNC0eSu0rW8faBSR9LbCdhAFiXqN1dnnfj8tsTMTmFEWKwM30tgjT5l4 w5g9svozJ3Yow8b/UAsOjXHCicG2iWq5uLj08vS99SYoNSaFA1TwJnaEsD1v7pFqmfZT aS4Q== X-Gm-Message-State: AEkooutD2vZKChVU9+HWFBFyOKrIYQEnk+CVvd3tleoaHD9C8D/a2FnKQ+j0EhJoX5OmrA== X-Received: by 10.28.0.203 with SMTP id 194mr27547484wma.29.1471454325296; Wed, 17 Aug 2016 10:18:45 -0700 (PDT) Received: from Solace.fritz.box (net-2-32-14-104.cust.vodafonedsl.it. [2.32.14.104]) by smtp.gmail.com with ESMTPSA id ly9sm32503668wjb.44.2016.08.17.10.18.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Aug 2016 10:18:44 -0700 (PDT) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Wed, 17 Aug 2016 19:18:43 +0200 Message-ID: <147145432341.25877.7540974364706702.stgit@Solace.fritz.box> In-Reply-To: <147145358844.25877.7490417583264534196.stgit@Solace.fritz.box> References: <147145358844.25877.7490417583264534196.stgit@Solace.fritz.box> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Cc: George Dunlap , Wei Liu , Ian Jackson Subject: [Xen-devel] [PATCH 10/24] xen: tracing: improve Credit2's tickle_check and burn_credits records 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 In both Credit2's trace records relative to checking whether we want to preempt a vcpu (in runq_tickle()), and to credits being burn, make it explicit on which pcpu the vcpu being considered is running. Such information isn't currently available, not even by looking at on which pcpu the events happen, as we do both the above operation from a certain pcpu on vcpus running on different pcpus. Signed-off-by: Dario Faggioli --- Cc: George Dunlap Cc: Ian Jackson Cc: Wei Liu --- tools/xentrace/formats | 4 ++-- tools/xentrace/xenalyze.c | 15 +++++++++------ xen/common/sched_credit2.c | 6 ++++-- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/tools/xentrace/formats b/tools/xentrace/formats index 0de7990..adff681 100644 --- a/tools/xentrace/formats +++ b/tools/xentrace/formats @@ -45,9 +45,9 @@ 0x00022201 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) csched2:tick 0x00022202 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) csched2:runq_pos [ dom:vcpu = 0x%(1)08x, pos = %(2)d] -0x00022203 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) csched2:credit burn [ dom:vcpu = 0x%(1)08x, credit = %(2)d, delta = %(3)d ] +0x00022203 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) csched2:credit burn [ dom:vcpu = 0x%(1)08x, cpu = %(3)d, credit = %(2)d, delta = %(4)d ] 0x00022204 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) csched2:credit_add -0x00022205 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) csched2:tickle_check [ dom:vcpu = 0x%(1)08x, credit = %(2)d ] +0x00022205 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) csched2:tickle_check [ dom:vcpu = 0x%(1)08x, cpu = %(2)d, credit = %(3)d ] 0x00022206 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) csched2:tickle [ cpu = %(1)d ] 0x00022207 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) csched2:credit_reset [ dom:vcpu = 0x%(1)08x, cr_start = %(2)d, cr_end = %(3)d, mult = %(4)d ] 0x00022208 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) csched2:sched_tasklet diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c index 0b697d0..58a8d41 100644 --- a/tools/xentrace/xenalyze.c +++ b/tools/xentrace/xenalyze.c @@ -7607,24 +7607,27 @@ 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; + unsigned int vcpuid:16, domid:16, credit, cpu; int 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, " + "on cpu = %u, credit = %u, delta = %d\n", ri->dump_header, r->domid, r->vcpuid, - r->credit, r->delta); + r->cpu, r->credit, r->delta); } break; case TRC_SCHED_CLASS_EVT(CSCHED2, 5): /* TICKLE_CHECK */ if(opt.dump_all) { struct { unsigned int vcpuid:16, domid:16; - unsigned int credit; + unsigned int cpu, credit; } *r = (typeof(r))ri->d; - printf(" %s csched2:tickle_check d%uv%u, credit = %u\n", - ri->dump_header, r->domid, r->vcpuid, r->credit); + printf(" %s csched2:tickle_check d%uv%u, " + "on cpu = %u, credits = %u\n", + ri->dump_header, r->domid, r->vcpuid, + r->cpu, r->credit); } break; case TRC_SCHED_CLASS_EVT(CSCHED2, 6): /* TICKLE */ diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c index 164296b..c8396a8 100644 --- a/xen/common/sched_credit2.c +++ b/xen/common/sched_credit2.c @@ -1027,11 +1027,12 @@ runq_tickle(const struct scheduler *ops, struct csched2_vcpu *new, s_time_t now) { struct { unsigned vcpu:16, dom:16; - unsigned credit; + unsigned cpu, credit; } d; d.dom = cur->vcpu->domain->domain_id; d.vcpu = cur->vcpu->vcpu_id; d.credit = cur->credit; + d.cpu = i; __trace_var(TRC_CSCHED2_TICKLE_CHECK, 1, sizeof(d), (unsigned char *)&d); @@ -1181,12 +1182,13 @@ void burn_credits(struct csched2_runqueue_data *rqd, { struct { unsigned vcpu:16, dom:16; - unsigned credit; + unsigned credit, cpu; int delta; } d; d.dom = svc->vcpu->domain->domain_id; d.vcpu = svc->vcpu->vcpu_id; d.credit = svc->credit; + d.cpu = svc->vcpu->processor; d.delta = delta; __trace_var(TRC_CSCHED2_CREDIT_BURN, 1, sizeof(d),