From patchwork Fri Sep 30 02:54:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 9357469 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 2EDEB6077A for ; Fri, 30 Sep 2016 02:56:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 230FE29D3E for ; Fri, 30 Sep 2016 02:56:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 179EB29D43; Fri, 30 Sep 2016 02:56:19 +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 47F2429D3E for ; Fri, 30 Sep 2016 02:56:18 +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 1bpnxk-00024Z-FQ; Fri, 30 Sep 2016 02:54:12 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bpnxj-000242-Eb for xen-devel@lists.xenproject.org; Fri, 30 Sep 2016 02:54:11 +0000 Received: from [85.158.143.35] by server-3.bemta-6.messagelabs.com id 91/E1-04595-2D3DDE75; Fri, 30 Sep 2016 02:54:10 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrAIsWRWlGSWpSXmKPExsXiVRvkpHvp8tt wg6M/2Cy+b5nM5MDocfjDFZYAxijWzLyk/IoE1ow5O6cxF5xxq+h5vZClgbHDoIuRi0NIYAaj xK0Jn9m6GDk5WATWsEp8PGgEkpAQuMQqMfXnVmaQhIRAjMTU7tOMEHaFxI6eFiYQW0hAReLm9 lVMEJN+MUpsPfEEbJKwgJ7EkaM/2LsYOYDsQIkFq1VBwmwCBhJvduxlBbFFBJQk7q2aDDaHGW jmipc3mCCOUJX4vuMQ2C5eAW+J7tvvwOKcAr4Sv7a9YIHY6yPxe/lysFWiAnISKy+3sELUC0q cnPmEBWQts4CmxPpd+hDj5SW2v53DPIFRZBaSqlkIVbOQVC1gZF7FqF6cWlSWWqRrrpdUlJme UZKbmJmja2hgppebWlycmJ6ak5hUrJecn7uJERj6DECwg3HmZf9DjJIcTEqivLJH34YL8SXlp 1RmJBZnxBeV5qQWH2KU4eBQkuBdewkoJ1iUmp5akZaZA4xCmLQEB4+SCK8CMBKFeIsLEnOLM9 MhUqcYdTm2TL23lkmIJS8/L1VKnLcJZIYASFFGaR7cCFhCuMQoKyXMywh0lBBPQWpRbmYJqvw rRnEORiVh3k8gU3gy80rgNr0COoIJ6Ij8o29AjihJREhJNTAe2Nk1IZfhluOWnVuXc1jts1jE 2SF2VvmvTrQrO6vUO2cd0bvBHLGdvlvPaf894t7rM4H329cH6goZ3zRc7q2+kp00p+1u7JqdH 7ZpM5XffBilGHWv5XawiMZvzUe2AhI7F1t/esT4srD1b7V9jsF9GQeXeQsU5hq4qInO4upOms HVx7R1ubkSS3FGoqEWc1FxIgCzYPpJAwMAAA== X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-10.tower-21.messagelabs.com!1475204049!29130816!1 X-Originating-IP: [74.125.82.66] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 44494 invoked from network); 30 Sep 2016 02:54:10 -0000 Received: from mail-wm0-f66.google.com (HELO mail-wm0-f66.google.com) (74.125.82.66) by server-10.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 30 Sep 2016 02:54:10 -0000 Received: by mail-wm0-f66.google.com with SMTP id b184so1385479wma.3 for ; Thu, 29 Sep 2016 19:54:10 -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=EsPCbQJwfUYVL/xAt3LRv+IjQAqsLunEqlilEUlFbcs=; b=lXTm+FUyNj6w9bhuni2Ra1iMAr0xQkpcYMeEzvuxn0C4TjrVd6c+GUj8etC3EHiMDj ADgpNWQrs3uMdEiLUQ7NSGbrBny0+LFzZfSZrAFyQ08QHggw2Pl7VcAEGHP3T+dU4qJl rI1Y/AmAMWAkTozVmCUV2Bbvwcq5OZkpaisBec3kPi6Dd3o8xjQWySud6KQzbb5fvnOg 8CrsCjjlHm00+Rd5EFNK0YDvtojyNY3eQHdlI1aEA1HhqsKS4xm5tcdFywDU6Rc3/AUl 35PP9rvavy58rftUfR27kJ8NzOyQcl/bKdVKtWczv7mRnr4/cD9wBvJz0W8OOYXcXzE6 zfZw== 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=EsPCbQJwfUYVL/xAt3LRv+IjQAqsLunEqlilEUlFbcs=; b=PvL+OzgV8AHcLphGhxMZA6FzIh93WVeQ9Pn9wNx5pbWa64+krHum3JZiVuoSHn5xhR MQYBQl5mIVCesFjrJYmp0QvXpwC+wgjRP7dvkyTIMJMVrLRsJFELkhMZJEWCPjfRA/gP cv3/5+Nkxh21SlPENsDIsAu5W29GoF+GiVerMQH9J5/hf2XwQSFQ9Q4/qEhhP4XA4K5P S6eodRKWRCzAdPC/rfP/qSNz3bUQzpchE8u9luYfAjd7JSToCBVgF+N1ZsA16ItXGdwD iS7DqDXX0DumlA/R+Oev7h6mK0y+xtzBfmWfwtdvTcw86iCBO6YntXUKdFvj6uaz7ZKN arjw== X-Gm-Message-State: AA6/9RnWESzlJNe/2a+NaWcRLcsydMNs7H2aScqFcJRVBBxsgQMKfnlN1Qj4tpB8jyESww== X-Received: by 10.28.206.65 with SMTP id e62mr1358407wmg.85.1475204049724; Thu, 29 Sep 2016 19:54:09 -0700 (PDT) Received: from Solace.fritz.box ([80.66.223.126]) by smtp.gmail.com with ESMTPSA id o5sm17044964wjj.46.2016.09.29.19.54.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Sep 2016 19:54:08 -0700 (PDT) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Fri, 30 Sep 2016 04:54:07 +0200 Message-ID: <147520404731.22544.7519219925656124086.stgit@Solace.fritz.box> In-Reply-To: <147520253247.22544.10673844222866363947.stgit@Solace.fritz.box> References: <147520253247.22544.10673844222866363947.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 v2 07/10] 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: Ian Jackson Cc: Wei Liu --- Changes from v1: * only the one made necessary by the packing done to Credit1 records. Those were requested by George himself, and the effect on this patch is small, and purely mechanic, so I decided to keep his Ack. --- 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 0de7990..db89f92 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[16]:tasklet[8]:idle[8] = %(1)08x ] +0x0002200A CPU%(cpu)d %(tsc)d (+%(reltsc)8d) csched:ratelimit [ dom:vcpu = 0x%(1)08x, runtime = %(2)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, skipped_vcpus = %(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 0b697d0..f006804 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:16, tasklet:8, idle:8; + } *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 vcpuid:16, domid:16; + 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 */ @@ -7776,6 +7820,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, skipped; + } *r = (typeof(r))ri->d; + + printf(" %s csched2:runq_candidate d%uv%u, " + "%u vcpus skipped, ", + ri->dump_header, r->domid, r->vcpuid, + r->skipped); + if (r->tickled_cpu == (unsigned)-1) + printf("no cpu was tickled\n"); + 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) { @@ -7828,6 +7916,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); }