From patchwork Tue Feb 16 18:13:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 8330651 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0F8C19F399 for ; Tue, 16 Feb 2016 18:15:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0FDA82027D for ; Tue, 16 Feb 2016 18:15:42 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DBA1720268 for ; Tue, 16 Feb 2016 18:15:40 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aVk7l-0004GN-Nv; Tue, 16 Feb 2016 18:13:21 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aVk7j-0004Ew-D6 for xen-devel@lists.xenproject.org; Tue, 16 Feb 2016 18:13:19 +0000 Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id E4/6D-08347-EB663C65; Tue, 16 Feb 2016 18:13:18 +0000 X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-13.tower-27.messagelabs.com!1455646397!24321341!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: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 35647 invoked from network); 16 Feb 2016 18:13:17 -0000 Received: from mail-wm0-f66.google.com (HELO mail-wm0-f66.google.com) (74.125.82.66) by server-13.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 16 Feb 2016 18:13:17 -0000 Received: by mail-wm0-f66.google.com with SMTP id c200so21908438wme.0 for ; Tue, 16 Feb 2016 10:13:17 -0800 (PST) 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-type:content-transfer-encoding; bh=jvLtiyQnKPAcxsm7K2zj17i2SyNGiDuNpYHtgg6uCxg=; b=SpQNmkqL+LN/RRgKuloUm2DU8Hnvb4UhR9dEh8dYfKxgLJzf7gwQejrv0uD4QYDtvZ lwb4e9DkWdAr8VxuiM0XTVQOd+cW5uZzODopLCq9ZWvlB+u75hbNLuCXLBwEwK57XNHw XEhDlHjoZpEqdFIXHDd3+VQAsl0XD0/VeVpfE5sZ7H312/jFdGFhruySX7gLD3UTBJdU a5HPNrDpOYQYqKOJc4r877uotEDEo6HU9U8WIIEH2jthCcAW7RVEwqbzNhmrpCzIXVEZ Phy4CmkMNyDcuURNOdViM4qb/G46/z9YGBg7ZgpmftJ3GFCJrtRGLjl1xSTrR7Z2m5JR Kbww== 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-type :content-transfer-encoding; bh=jvLtiyQnKPAcxsm7K2zj17i2SyNGiDuNpYHtgg6uCxg=; b=A/aC160Xzln+r3JI4xpwiqIyy9XNIckpNnBwyF3ekwfaD/Xf6H2MRA7AbSrC4H++Fy NEqzWWrdF0gvdAFfGVDEeaKdhazVYh38pkXhUNnnQ2TgszUXmtIDLFdFnMuEhCdBfc13 5GbROjkfM5N8MgDeXW0eOOh9cKfnmfiuWawIvs5gBHDqWc7MdRqo0meAHtQAoBTe+mEJ 2RCRl9aaoJDeKJZP4iXv6vABT14W4ULIDdsD6WjPVO8SYWTgWkpVre3TU8KYWY4svKYC ZB9ELN+f4YhtSnV2HgImZPvguETATgeZy6LOTznGom8u0y3jM5hw/KhdFoQCTs4MhIXt Sa7w== X-Gm-Message-State: AG10YOQOJJ957nhhej9VgESUsuVcPs7zEofh4/VoZoBgiHHrPgWJB8nolm6n82PsZeJaJg== X-Received: by 10.28.227.134 with SMTP id a128mr21905825wmh.67.1455646397341; Tue, 16 Feb 2016 10:13:17 -0800 (PST) Received: from Solace.station (net-2-35-170-8.cust.vodafonedsl.it. [2.35.170.8]) by smtp.gmail.com with ESMTPSA id v1sm3358168wjf.49.2016.02.16.10.13.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Feb 2016 10:13:16 -0800 (PST) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Tue, 16 Feb 2016 19:13:11 +0100 Message-ID: <20160216181310.27876.36504.stgit@Solace.station> In-Reply-To: <20160216180550.27876.22680.stgit@Solace.station> References: <20160216180550.27876.22680.stgit@Solace.station> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Cc: Olaf Hering , Wei Liu , Ian Campbell , George Dunlap , Ian Jackson Subject: [Xen-devel] [PATCH v2 14/16] xenalyze: handle Credit2 scheduler events X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP so the trace will show properly decoded info, rather than just a bunch of hex codes. Signed-off-by: Dario Faggioli Reviewed-by: Konrad Rzeszutek Wilk Acked-by: George Dunlap --- Cc: George Dunlap Cc: Ian Jackson Cc: Ian Campbell Cc: Wei Liu Cc: Olaf Hering Cc: Konrad Rzeszutek Wilk --- Changes from v1: * '} * r =' turned into '} *r =', as requested during review. --- tools/xentrace/xenalyze.c | 101 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c index 4ab2dba..8f97f3a 100644 --- a/tools/xentrace/xenalyze.c +++ b/tools/xentrace/xenalyze.c @@ -7727,6 +7727,107 @@ void sched_process(struct pcpu_info *p) ri->dump_header, r->cpu); } break; + /* CREDIT 2 (TRC_CSCHED2_xxx) */ + case TRC_SCHED_CLASS_EVT(CSCHED2, 1): /* TICK */ + case TRC_SCHED_CLASS_EVT(CSCHED2, 4): /* CREDIT_ADD */ + case TRC_SCHED_CLASS_EVT(CSCHED2, 9): /* UPDATE_LOAD */ + break; + case TRC_SCHED_CLASS_EVT(CSCHED2, 2): /* RUNQ_POS */ + if(opt.dump_all) { + struct { + unsigned int vcpuid:16, domid:16, pos; + } *r = (typeof(r))ri->d; + + printf(" %s csched2:runq_insert d%uv%u, position %u\n", + ri->dump_header, r->domid, r->vcpuid, r->pos); + } + break; + case TRC_SCHED_CLASS_EVT(CSCHED2, 3): /* CREDIT_BURN */ + if(opt.dump_all) { + struct { + unsigned int vcpuid:16, domid:16, credit; + int delta; + } *r = (typeof(r))ri->d; + + printf(" %s csched2:burn_credits d%uv%u, credit = %u, delta = %d\n", + ri->dump_header, r->domid, r->vcpuid, + 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; + } *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); + } + break; + case TRC_SCHED_CLASS_EVT(CSCHED2, 6): /* TICKLE */ + if(opt.dump_all) { + struct { + unsigned int cpu:16; + } *r = (typeof(r))ri->d; + + printf(" %s csched2:runq_tickle cpu %u\n", + ri->dump_header, r->cpu); + } + break; + case TRC_SCHED_CLASS_EVT(CSCHED2, 7): /* CREDIT_RESET */ + if(opt.dump_all) { + struct { + unsigned int vcpuid:16, domid:16; + unsigned 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", + ri->dump_header, r->domid, r->vcpuid, + r->credit_start, r->credit_end, r->multiplier); + } + break; + case TRC_SCHED_CLASS_EVT(CSCHED2, 8): /* SCHED_TASKLET */ + if(opt.dump_all) + printf(" %s csched2:sched_tasklet\n", ri->dump_header); + break; + case TRC_SCHED_CLASS_EVT(CSCHED2, 10): /* RUNQ_ASSIGN */ + if(opt.dump_all) { + struct { + unsigned int vcpuid:16, domid:16; + unsigned int rqi; + } *r = (typeof(r))ri->d; + + printf(" %s csched2:runq_assign d%uv%u on rq# %u\n", + ri->dump_header, r->domid, r->vcpuid, r->rqi); + } + break; + case TRC_SCHED_CLASS_EVT(CSCHED2, 11): /* UPDATE_VCPU_LOAD */ + if(opt.dump_all) { + struct { + unsigned int vcpuid:16, domid:16; + unsigned int avgload; + } *r = (typeof(r))ri->d; + + printf(" %s csched2:update_vcpu_load d%uv%u, avg_load = %u\n", + ri->dump_header, r->domid, r->vcpuid, r->avgload); + } + break; + case TRC_SCHED_CLASS_EVT(CSCHED2, 12): /* UPDATE_RUNQ_LOAD */ + if(opt.dump_all) { + struct { + unsigned int rq_load:4, rq_avgload:28; + unsigned int rq_id:4, b_avgload:28; + } *r = (typeof(r))ri->d; + + printf(" %s csched2:update_rq_load rq# %u, load = %u, " + "avgload = %u, b_avgload = %u\n", + ri->dump_header, r->rq_id, r->rq_load, + r->rq_avgload, r->b_avgload); + } + break; default: process_generic(ri); }