From patchwork Thu Jun 1 17:35:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 9760729 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 CAE9C60363 for ; Thu, 1 Jun 2017 17:37:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B75AE204BD for ; Thu, 1 Jun 2017 17:37:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC4A028518; Thu, 1 Jun 2017 17:37:27 +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 4230C204BD for ; Thu, 1 Jun 2017 17:37:27 +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 1dGU0A-0000hP-H1; Thu, 01 Jun 2017 17:35:14 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGU09-0000gQ-Cs for xen-devel@lists.xenproject.org; Thu, 01 Jun 2017 17:35:13 +0000 Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id 9C/04-01732-05050395; Thu, 01 Jun 2017 17:35:12 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOIsWRWlGSWpSXmKPExsXiVRvkrBsQYBB pMHc9q8X3LZOZHBg9Dn+4whLAGMWamZeUX5HAmnHp+mXWghfKFU8mdjI2MP6X7GLk4hASmMEo MeXUZ8YuRk4OFoE1rBLndvGCJCQELrFKLJrzCSwhIRAncfDsK2YIu1zi/JezYLaQgIrEze2rm CAm/WCU2N1+nQUkISygJ3Hk6A92CDtc4vDnHWwgNpuAgcSbHXtZQWwRASWJe6smM4HYzAIVEi te3mCCuEJVovHRdSCbg4NXwEfi8FQvkDCngK/EpFNnGCH2+kh8+zUBrFxUQE5i5eUWsJG8AoI SJ2c+YQFpZRbQlFi/Sx9iurzE9rdzmCcwisxCUjULoWoWkqoFjMyrGDWKU4vKUot0DQ31kooy 0zNKchMzc3QNDYz1clOLixPTU3MSk4r1kvNzNzECg58BCHYwrv7tdIhRkoNJSZR3gbxBpBBfU n5KZUZicUZ8UWlOavEhRhkODiUJ3gt+QDnBotT01Iq0zBxgHMKkJTh4lER4U0DSvMUFibnFme kQqVOMxhwbVq//wsQx6cD2L0xCLHn5ealS4rxLQUoFQEozSvPgBsHSwyVGWSlhXkag04R4ClK LcjNLUOVfMYpzMCoJ8z4BmcKTmVcCt+8V0ClMQKe82KYPckpJIkJKqoGxZ06Nws3OO2LyIj6X HTNi6ur0RGTOLw2sD6/S1nsWKXdq5pxJ+tHqrn/N9Taz1v2bINi7e2XCB4W53wxrHR2e5Re+3 rzQcfX2Mrl3uY0nFxv3Bj7q9bHUij/74PrG5F9c55u+TRbn+2HNwOvqbJX79u/B6+WPrXsmxG zZynOkb7urgNzOyyeUWIozEg21mIuKEwHV4TAGCgMAAA== X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-15.tower-31.messagelabs.com!1496338511!99614684!1 X-Originating-IP: [74.125.82.67] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 3518 invoked from network); 1 Jun 2017 17:35:12 -0000 Received: from mail-wm0-f67.google.com (HELO mail-wm0-f67.google.com) (74.125.82.67) by server-15.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 1 Jun 2017 17:35:12 -0000 Received: by mail-wm0-f67.google.com with SMTP id k15so13068230wmh.3 for ; Thu, 01 Jun 2017 10:35:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=pahjPVW7jNgw4X46hBMltPQLUqa2FSUsKJpmDEzmhMA=; b=EleIRdbr4LpksVE+fmQk/CLQAJ88PZbWyGPrONP/ujmMKEkiBdaQ+IFEOpZ3mIK0pV V5iHw4LFOSBxs8ceVdBdzEKIQUrD09yosnaLg9tL4JgxJE0f6KTj2w9FsnbsyPpQxfyu Pf3xdDigxLiDj43TV4dv3VmkjKGECeVY6KOazQsTBGhC6iZWKObQCJVN2VU6oDR4905z /Us8pl5eVL6Ok2WF1xVIU0UIDORQP7/S8qEuR2Ff0joD2+Tb3vI2jvOu7GeN5hXe4D1X vu7tuwY9vAO+Blw42jZ+pZ+Fkt2ON+anKEfHIob+HD74HsKH1I83nRIYImHbLn4vJU7F jjBw== 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 :in-reply-to:references:user-agent:mime-version :content-transfer-encoding; bh=pahjPVW7jNgw4X46hBMltPQLUqa2FSUsKJpmDEzmhMA=; b=URa3kyYKNTKg4a0FfUxM3VwAA9gtYLFuebNV3LjLmJ12F+BmPAqSZ+GDxkzTiTwst5 HPmJgOuS+jGKM536cmSO2vSoMaWezIDPhCczorCQXI94rCFFDJ3sxoYoQ6MAfS/3ucmm x90+tl1dOweew7PKNVorm/aTyIPzIqL4iJOBbhHxADL7e8a59UYgrx1ip/1n8M6Uu6C2 vyzgruoz9YDvjhkiqLdgYXON1Ms1xYTxiNQ4iIs1QgF+t3IHtNwBTF9dat7dAYGQq/au 5pJqrsttEB0d9VaipCA5QT69rrluWCONfJcNsdpgxKnGZ0mvga/buOd/F2UPcIm/r+A/ Op1w== X-Gm-Message-State: AODbwcDnBFcPxegKvTFE/ssBTPW52ZSmk89aT9DRHlfmK4HXzAHAaS/+ KUBGctasJgvjTw== X-Received: by 10.28.191.89 with SMTP id p86mr205603wmf.27.1496338511692; Thu, 01 Jun 2017 10:35:11 -0700 (PDT) Received: from Solace.fritz.box ([80.66.223.25]) by smtp.gmail.com with ESMTPSA id 97sm15052532wrc.5.2017.06.01.10.35.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Jun 2017 10:35:11 -0700 (PDT) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Thu, 01 Jun 2017 19:35:09 +0200 Message-ID: <149633850903.12814.13022904151874996238.stgit@Solace.fritz.box> In-Reply-To: <149633614204.12814.14390287626133023934.stgit@Solace.fritz.box> References: <149633614204.12814.14390287626133023934.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 13/15] tools: tracing: handle tasklets events in xentrace and xenalyze 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 Signed-off-by: Dario Faggioli --- Cc: George Dunlap Cc: Ian Jackson Cc: Wei Liu --- tools/xentrace/formats | 7 +++ tools/xentrace/xenalyze.c | 92 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+) diff --git a/tools/xentrace/formats b/tools/xentrace/formats index 615ba7d..7d59db7 100644 --- a/tools/xentrace/formats +++ b/tools/xentrace/formats @@ -219,6 +219,13 @@ 0x01002003 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) softirq_raise_cpu [ nr:cpu = 0x%(1)08x ] 0x01002004 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) softirq_raise [ nr = %(1)d ] +0x01004001 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) tasklet_enqueue [ fn = 0x%(2)08x%(1)08x ] +0x01004002 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) tasklet_schedule [ fn = 0x%(2)08x%(1)08x, is_sirq:sched_on = 0x%(3)08x ] +0x01004003 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) tasklet_work [ fn = 0x%(2)08x%(1)08x ] +0x01004004 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) tasklet_kill [ fn = 0x%(2)08x%(1)08x, is_run:sched_on = 0x%(3)08x ] +0x01004005 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) tasklet_init [ fn = 0x%(2)08x%(1)08x, is_sirq = %(3)d ] +0x01004006 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) tasklet_migr [ ] + 0x00084001 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) hpet create [ tn = %(1)d, irq = %(2)d, delta = 0x%(4)08x%(3)08x, period = 0x%(6)08x%(5)08x ] 0x00084002 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) pit create [ delta = 0x%(1)016x, period = 0x%(2)016x ] 0x00084003 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) rtc create [ delta = 0x%(1)016x , period = 0x%(2)016x ] diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c index 5cb0f3b..eecdd61 100644 --- a/tools/xentrace/xenalyze.c +++ b/tools/xentrace/xenalyze.c @@ -8762,6 +8762,94 @@ void softirq_process(struct pcpu_info *p) { } } +void tasklet_process(struct pcpu_info *p) { + struct record_info *ri = &p->ri; + + switch ( ri->event ) + { + case TRC_XEN_TASKLET_ENQUEUE: + { + struct { + uint64_t addr; + } *r = (typeof(r))ri->d; + + if ( opt.dump_all ) + { + printf(" %s tasklet_enqueue fn=%p\n", + ri->dump_header, (void*)r->addr); + } + break; + } + case TRC_XEN_TASKLET_SCHEDULE: + { + struct { + uint64_t addr; + int16_t sched_on, is_sirq; + } *r = (typeof(r))ri->d; + + if ( opt.dump_all ) + { + printf(" %s tasklet_schedule fn=%p, sched_on=%d%s\n", + ri->dump_header, (void*)r->addr, r->sched_on, + r->is_sirq ? " (softirq)" : ""); + } + break; + } + case TRC_XEN_TASKLET_WORK: + { + struct { + uint64_t addr; + } *r = (typeof(r))ri->d; + + if ( opt.dump_all ) + { + printf(" %s tasklet_do_work fn=%p\n", + ri->dump_header, (void*)r->addr); + } + break; + } + case TRC_XEN_TASKLET_KILL: + { + struct { + uint64_t addr; + int16_t sched_on, is_run; + } *r = (typeof(r))ri->d; + + if ( opt.dump_all ) + { + printf(" %s tasklet_kill fn=%p\n, sched_on=%d, is_running=%d\n", + ri->dump_header, (void*)r->addr, r->sched_on, r->is_run); + } + break; + } + case TRC_XEN_TASKLET_INIT: + { + struct { + uint64_t addr; + uint32_t is_sirq; + } *r = (typeof(r))ri->d; + + if ( opt.dump_all ) + { + printf(" %s tasklet_init fn=%p%s\n", + ri->dump_header, (void*)r->addr, + r->is_sirq ? ", (softirq)" : ""); + } + break; + } + case TRC_XEN_TASKLET_MIGR: + { + if ( opt.dump_all ) + printf(" %s tasklet_migrate\n", ri->dump_header); + break; + } + default: + if( opt.dump_all ) + dump_generic(stdout, ri); + break; + } +} + #define TRC_HW_SUB_PM 1 #define TRC_HW_SUB_IRQ 2 void hw_process(struct pcpu_info *p) @@ -8782,6 +8870,7 @@ void hw_process(struct pcpu_info *p) #define TRC_XEN_SUB_RCU 1 #define TRC_XEN_SUB_SIRQ 2 +#define TRC_XEN_SUB_TSKLT 4 void xen_process(struct pcpu_info *p) { struct record_info *ri = &p->ri; @@ -8794,6 +8883,9 @@ void xen_process(struct pcpu_info *p) case TRC_XEN_SUB_SIRQ: softirq_process(p); break; + case TRC_XEN_SUB_TSKLT: + tasklet_process(p); + break; } }