From patchwork Wed Aug 17 17:18:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 9286221 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 5A64860839 for ; Wed, 17 Aug 2016 17:21:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 496A1294B8 for ; Wed, 17 Aug 2016 17:21:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3DC2B294CF; Wed, 17 Aug 2016 17:21:16 +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 995B9294B8 for ; Wed, 17 Aug 2016 17:21:15 +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 1ba4UR-0000H1-5i; Wed, 17 Aug 2016 17:18:55 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ba4UQ-0000G7-BR for xen-devel@lists.xenproject.org; Wed, 17 Aug 2016 17:18:54 +0000 Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id 5B/D1-12874-D7C94B75; Wed, 17 Aug 2016 17:18:53 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrIIsWRWlGSWpSXmKPExsXiVRvkolszZ0u 4weZrhhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bND4dYC166VByYfJGlgfGcXhcjF4eQwExG iROP/zKCOCwCa1gl9j64wQLiSAhcYpXYevYYkMMJ5MRILP/7iA3CLpfontjPCmILCahI3Ny+i gli1DwmiZvL9oAVCQvoSRw5+oO9i5EDyPaVOPZNHyTMJmAg8WbHXrBeEQEliXurJjOB2MwCFR IrXt4As1kEVCVWHH3NDmLzCvhI/Dj+BayeE8i+tfo3C8Reb4nDk3vAVokKyEmsvNzCClEvKHF y5hMWkLXMApoS63fpQ4yXl9j+dg7zBEaRWUiqZiFUzUJStYCReRWjenFqUVlqka65XlJRZnpG SW5iZo6uoYGpXm5qcXFiempOYlKxXnJ+7iZGYPAzAMEOxmOTnQ8xSnIwKYny3qneEi7El5SfU pmRWJwRX1Sak1p8iFGGg0NJgrdnNlBOsCg1PbUiLTMHGIcwaQkOHiUR3p0gad7igsTc4sx0iN QpRl2OLVPvrWUSYsnLz0uVEue9AlIkAFKUUZoHNwKWEi4xykoJ8zICHSXEU5BalJtZgir/ilG cg1FJmHcZyBSezLwSuE2vgI5gAjqClx/siJJEhJRUA6O92Huh7LJHoUIi05d8eXDrTVng/4mX xaa5L10bKWbB4Pc+z+Hzsz1HF1i8+i0RpS/l9/FExeVpoi6M64WVG5Xedy+O7Lw9ldfjtN/3R R+XNZdM2snq/LTi6gydtb4RVj+0u1+XrDr1M3LpzFuvW71UMv3ieN587Wb0L1ab+Md/fUhidM MElkNKLMUZiYZazEXFiQDRkrrwBAMAAA== X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-9.tower-206.messagelabs.com!1471454332!55088906!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: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 59997 invoked from network); 17 Aug 2016 17:18:52 -0000 Received: from mail-wm0-f68.google.com (HELO mail-wm0-f68.google.com) (74.125.82.68) by server-9.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 17 Aug 2016 17:18:52 -0000 Received: by mail-wm0-f68.google.com with SMTP id i138so26178605wmf.3 for ; Wed, 17 Aug 2016 10:18:52 -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=DktPvE14KiyX36uNQ1yMGsssMoDbR6vyoFVIAxJ10wo=; b=xUaWVBVSuodXhEqON5U8KBDaRKSMeBAd0uZU+4lRHDa7ejJllUlGY6kqj1Z7hIfzSi H/yCsV69UTOhjGtbu7zDh8H9UH58zakAvlh+Sou0ZVJ+B7lIUF0Mx6trM2vTHMW48pWG ANmSQbV9En5PHPuAiYtnKIUUuyeXfk/d/idjds01ZbH/QYAhNNRURhU/QWl3xTyFqZZh liW5CXfi+Hz9mvECLr0ABsBrnUXd69fjMgXoa+3h2/UrdM6gaiHfHBSDlvLNs3ky8tpB ZhJ49KtzmUxw92fZBOBVF92vV0IPCDJmKDgw5T14Psc23sAlT0Dmo0ixJoKNoXV91xjY CwQw== 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=DktPvE14KiyX36uNQ1yMGsssMoDbR6vyoFVIAxJ10wo=; b=XTgFyeVqUgrG8VfdOMPHwB4RSagt+/CiJzSTjQYCbFjE24y+hUcca0ooafMiPLx/S0 56veqnQMFAq8Z3b7P1FuFoGpCrwUCIldkXYYD6EKiQbwLa69a9KblGBy45YmSq0HFiQv RWpp8G7UWyic8ZXiPEK8ldqOsoVNR0z3KyNNH2t5sBp33im/li8ojkmP+7Bz/t9h6Oo6 O6cKEMrjC/rfY++lc8CBz6qP1xKYCjf4j+FA58jGpGcPqMNJhPS0V9L+cNLNGtv3SdlP DxAWZyPYXNSJsAawkTWSdeZCDG3Mm/XXN3eoUoK0Mh4aYE+UiFf6p+suOFP1OWPOwIVj BCfQ== X-Gm-Message-State: AEkooutdS0CSKcNbz/g/KXtvh+ruxXFot3CH9dN+Hlb2BMPocauxool1x9zGhMtqAjYBAQ== X-Received: by 10.28.26.69 with SMTP id a66mr27097063wma.8.1471454332354; Wed, 17 Aug 2016 10:18:52 -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 uo4sm32469649wjc.36.2016.08.17.10.18.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Aug 2016 10:18:51 -0700 (PDT) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Wed, 17 Aug 2016 19:18:50 +0200 Message-ID: <147145433038.25877.16124577573706461350.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 11/24] tools: tracing: handle more scheduling related events. 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 There are some scheduling related trace records that are not being taken care of (and hence only dumped as raw records). Some of them are being introduced in this series, while other were just neglected by previous patches. Add support for them. Signed-off-by: Dario Faggioli Acked-by: George Dunlap --- Cc: George Dunlap Cc: Ian Jackson Cc: Wei Liu --- tools/xentrace/formats | 8 ++++ tools/xentrace/xenalyze.c | 101 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+) diff --git a/tools/xentrace/formats b/tools/xentrace/formats index adff681..3488a06 100644 --- a/tools/xentrace/formats +++ b/tools/xentrace/formats @@ -42,6 +42,10 @@ 0x00022004 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) csched:stolen_vcpu [ dom:vcpu = 0x%(2)04x%(3)04x, from = %(1)d ] 0x00022005 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) csched:picked_cpu [ dom:vcpu = 0x%(1)04x%(2)04x, cpu = %(3)d ] 0x00022006 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) csched:tickle [ cpu = %(1)d ] +0x00022007 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) csched:boost [ dom:vcpu = 0x%(1)04x%(2)04x ] +0x00022008 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) csched:unboost [ dom:vcpu = 0x%(1)04x%(2)04x ] +0x00022009 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) csched:schedule [ cpu = %(1)d, tasklet_scheduled = %(2)d, was_idle = %(3)d ] +0x0002200A CPU%(cpu)d %(tsc)d (+%(reltsc)8d) csched:ratelimit [ dom:vcpu = 0x%(1)04x%(2)04x, runtime = %(3)d ] 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] @@ -61,12 +65,16 @@ 0x00022210 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) csched2:load_check [ lrq_id[16]:orq_id[16] = 0x%(1)08x, delta = %(2)d ] 0x00022211 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) csched2:load_balance [ l_bavgload = 0x%(2)08x%(1)08x, o_bavgload = 0x%(4)08x%(3)08x, lrq_id[16]:orq_id[16] = 0x%(5)08x ] 0x00022212 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) csched2:pick_cpu [ b_avgload = 0x%(2)08x%(1)08x, dom:vcpu = 0x%(3)08x, rq_id[16]:new_cpu[16] = %(4)d ] +0x00022213 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) csched2:runq_candidate [ dom:vcpu = 0x%(1)08x, runq_pos = %(2)d tickled_cpu = %(3)d ] +0x00022214 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) csched2:schedule [ rq:cpu = 0x%(1)08x, tasklet[8]:idle[8]:smt_idle[8]:tickled[8] = %(2)08x ] +0x00022215 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) csched2:ratelimit [ dom:vcpu = 0x%(1)08x, runtime = %(2)d ] 0x00022801 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) rtds:tickle [ cpu = %(1)d ] 0x00022802 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) rtds:runq_pick [ dom:vcpu = 0x%(1)08x, cur_deadline = 0x%(3)08x%(2)08x, cur_budget = 0x%(5)08x%(4)08x ] 0x00022803 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) rtds:burn_budget [ dom:vcpu = 0x%(1)08x, cur_budget = 0x%(3)08x%(2)08x, delta = %(4)d ] 0x00022804 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) rtds:repl_budget [ dom:vcpu = 0x%(1)08x, cur_deadline = 0x%(3)08x%(2)08x, cur_budget = 0x%(5)08x%(4)08x ] 0x00022805 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) rtds:sched_tasklet +0x00022806 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) rtds:schedule [ cpu[16]:tasklet[8]:idle[4]:tickled[4] = %(1)08x ] 0x00041001 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) domain_create [ dom = 0x%(1)08x ] 0x00041002 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) domain_destroy [ dom = 0x%(1)08x ] diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c index 58a8d41..aaff1d9 100644 --- a/tools/xentrace/xenalyze.c +++ b/tools/xentrace/xenalyze.c @@ -7590,6 +7590,50 @@ void sched_process(struct pcpu_info *p) ri->dump_header, r->cpu); } break; + case TRC_SCHED_CLASS_EVT(CSCHED, 7): /* BOOST_START */ + if(opt.dump_all) { + struct { + unsigned int domid, vcpuid; + } *r = (typeof(r))ri->d; + + printf(" %s csched: d%uv%u boosted\n", + ri->dump_header, r->domid, r->vcpuid); + } + break; + case TRC_SCHED_CLASS_EVT(CSCHED, 8): /* BOOST_END */ + if(opt.dump_all) { + struct { + unsigned int domid, vcpuid; + } *r = (typeof(r))ri->d; + + printf(" %s csched: d%uv%u unboosted\n", + ri->dump_header, r->domid, r->vcpuid); + } + break; + case TRC_SCHED_CLASS_EVT(CSCHED, 9): /* SCHEDULE */ + if(opt.dump_all) { + struct { + unsigned int cpu, tasklet, idle; + } *r = (typeof(r))ri->d; + + printf(" %s csched:schedule cpu %u, %s%s\n", + ri->dump_header, r->cpu, + r->tasklet ? ", tasklet scheduled" : "", + r->idle ? ", idle" : ", busy"); + } + break; + case TRC_SCHED_CLASS_EVT(CSCHED, 10): /* RATELIMIT */ + if(opt.dump_all) { + struct { + unsigned int domid, vcpuid; + unsigned int runtime; + } *r = (typeof(r))ri->d; + + printf(" %s csched:ratelimit, d%uv%u run only %u.%uus\n", + ri->dump_header, r->domid, r->vcpuid, + r->runtime / 1000, r->runtime % 1000); + } + break; /* CREDIT 2 (TRC_CSCHED2_xxx) */ case TRC_SCHED_CLASS_EVT(CSCHED2, 1): /* TICK */ case TRC_SCHED_CLASS_EVT(CSCHED2, 4): /* CREDIT_ADD */ @@ -7779,6 +7823,50 @@ void sched_process(struct pcpu_info *p) ri->dump_header, r->domid, r->vcpuid, r->rqi, r->cpu); } break; + case TRC_SCHED_CLASS_EVT(CSCHED2, 20): /* RUNQ_CANDIDATE */ + if (opt.dump_all) { + struct { + unsigned vcpuid:16, domid:16; + unsigned tickled_cpu, position; + } *r = (typeof(r))ri->d; + + printf(" %s csched2:runq_candidate d%uv%u, " + "pos in runq %u, ", + ri->dump_header, r->domid, r->vcpuid, + r->position); + if (r->tickled_cpu == (unsigned)-1) + printf("no cpu was tickled"); + else + printf("cpu %u was tickled\n", r->tickled_cpu); + } + break; + case TRC_SCHED_CLASS_EVT(CSCHED2, 21): /* SCHEDULE */ + if (opt.dump_all) { + struct { + unsigned cpu:16, rqi:16; + unsigned tasklet:8, idle:8, smt_idle:8, tickled:8; + } *r = (typeof(r))ri->d; + + printf(" %s csched2:schedule cpu %u, rq# %u%s%s%s%s\n", + ri->dump_header, r->cpu, r->rqi, + r->tasklet ? ", tasklet scheduled" : "", + r->idle ? ", idle" : ", busy", + r->idle ? (r->smt_idle ? ", SMT idle" : ", SMT busy") : "", + r->tickled ? ", tickled" : ", not tickled"); + } + break; + case TRC_SCHED_CLASS_EVT(CSCHED2, 22): /* RATELIMIT */ + if (opt.dump_all) { + struct { + unsigned int vcpuid:16, domid:16; + unsigned int runtime; + } *r = (typeof(r))ri->d; + + printf(" %s csched2:ratelimit, d%uv%u run only %u.%uus\n", + ri->dump_header, r->domid, r->vcpuid, + r->runtime / 1000, r->runtime % 1000); + } + break; /* RTDS (TRC_RTDS_xxx) */ case TRC_SCHED_CLASS_EVT(RTDS, 1): /* TICKLE */ if(opt.dump_all) { @@ -7831,6 +7919,19 @@ void sched_process(struct pcpu_info *p) if(opt.dump_all) printf(" %s rtds:sched_tasklet\n", ri->dump_header); break; + case TRC_SCHED_CLASS_EVT(RTDS, 6): /* SCHEDULE */ + if (opt.dump_all) { + struct { + unsigned cpu:16, tasklet:8, idle:4, tickled:4; + } __attribute__((packed)) *r = (typeof(r))ri->d; + + printf(" %s rtds:schedule cpu %u, %s%s%s\n", + ri->dump_header, r->cpu, + r->tasklet ? ", tasklet scheduled" : "", + r->idle ? ", idle" : ", busy", + r->tickled ? ", tickled" : ", not tickled"); + } + break; default: process_generic(ri); }