From patchwork Thu Jun 1 17:34:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 9760725 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 F313D60363 for ; Thu, 1 Jun 2017 17:37:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF74A204BD for ; Thu, 1 Jun 2017 17:37:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D448D28518; Thu, 1 Jun 2017 17:37:17 +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 56007204BD for ; Thu, 1 Jun 2017 17:37:17 +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 1dGTzv-0000VN-18; Thu, 01 Jun 2017 17:34:59 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGTzu-0000UP-0e for xen-devel@lists.xenproject.org; Thu, 01 Jun 2017 17:34:58 +0000 Received: from [85.158.143.35] by server-11.bemta-6.messagelabs.com id C7/9D-03587-14050395; Thu, 01 Jun 2017 17:34:57 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOIsWRWlGSWpSXmKPExsXiVRvkqOsQYBB pMOOIlsX3LZOZHBg9Dn+4whLAGMWamZeUX5HAmrHl1yz2gl9yFY/m9zA2MF4X7WLk5BASmMko 8fq8dxcjFweLwBpWiT83DrOCOBICl1glzv96ztbFyAHkxEl0NOWDNEgIlEucuH+EGaJZReLm9 lVMIPVCAr8YJRYvnQSWEBbQkzhy9Ac7hB0ksav3PFicTcBA4s2OvawgtoiAksS9VZOZQGxmgQ qJFS9vgNksAqoSz2ceA+vlFfCRWLfvFAuIzSngKzHp1BlGiMU+Et9+TQCrFxWQk1h5uYUVol5 Q4uTMJywgNzMLaEqs36UPMV5eYvvbOcwTGEVmIamahVA1C0nVAkbmVYwaxalFZalFuobGeklF mekZJbmJmTm6hgZmermpxcWJ6ak5iUnFesn5uZsYgcHPAAQ7GL8sCzjEKMnBpCTKu0DeIFKIL yk/pTIjsTgjvqg0J7X4EKMMB4eSBO8FP6CcYFFqempFWmYOMA5h0hIcPEoivCkgad7igsTc4s x0iNQpRmOODavXf2HimHRg+xcmIZa8/LxUKXHepSClAiClGaV5cINg6eESo6yUMC8j0GlCPAW pRbmZJajyrxjFORiVhHlXgkzhycwrgdv3CugUJqBTXmzTBzmlJBEhJdXAuDH3yfe9C7faxHYo nuhbfjuw13OxXm66rVD60/SKSZUz3m6W+8T85Nkypr0tu3Nk8q9+n+KsnpXFHftAn7fS8802t sts9Vmif86nPGDfMYenP2/hC7voR76nt2wIC1ByMl/8KqJm50ue6IWWt6ZkTc68kjez12zX58 LIZsdYZ74FUtteOhxIUGIpzkg01GIuKk4EAKirapwKAwAA X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-7.tower-21.messagelabs.com!1496338496!71905066!1 X-Originating-IP: [74.125.82.65] 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 21678 invoked from network); 1 Jun 2017 17:34:56 -0000 Received: from mail-wm0-f65.google.com (HELO mail-wm0-f65.google.com) (74.125.82.65) by server-7.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 1 Jun 2017 17:34:56 -0000 Received: by mail-wm0-f65.google.com with SMTP id d127so13019099wmf.1 for ; Thu, 01 Jun 2017 10:34:56 -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=Ftxo8SvuRP+bS+B91HrGo9+YoE2nGPCwQ6tsj3SF4G4=; b=IaWRo7+ss0PhM4v3+55xMrxQJvkd5YuSlPD2Va+PY3yGZFaBt1Mz8gIFahr+TsoE73 MwZjpTWLUE9k1dCBl6CnVt7J1sqORlS0ewP3cp5nshmY+868pVCdDg5pzj1Uqp3C8Jte K0afyKWI+STTsBUTMv+FQnY/Ooo9uOREc6NoD5khbxljnuZEwJCb2Q4vG6hryT0Ss6l2 3tzKfe9a+2RIG4++/toJvKxyoymuzI3xkbzKUA5EvSzPG5dnM9vjDrVd3Ez2pXIhagBp tV2Hc8Coph3OXH1bdvIQuMG96rqCNkfIOhLXAOgfn4W0aNBnr8ZOd6vsTRaiEvmHlpzF J4OQ== 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=Ftxo8SvuRP+bS+B91HrGo9+YoE2nGPCwQ6tsj3SF4G4=; b=hjs3bbh4Km1LkwAkXWJIMTo77bIFuE+7eekfpR49N4NxpwRxKbw/XepSUcLEw1GSFd nOWg8F9NcLVUstoVNatTHZffcIdsasRqsB9GiRT8aMn0dIBkKtkDEpFaAzv3F6nlpN4D lFYhcipce7/0BnRj1ZiFIG6ukrn+arJKTTcvBidDk3zEPdBddX2YqOfqrq1EcG0KY5Lp G9oxWvH8BXHppk+0IPq47EH4mUxpLmu5cK+tEOZmmI5JuhaN8fpEVHL5fo7iQLsS2D6b 6cxqZ/mG+4ZdXPLSBRGFORPFFU31HbkqGlwekP62dhCAo8tVYnyaXfe+lDQhpEU9ODWC WkoA== X-Gm-Message-State: AODbwcAXFgwM1TUqKXGB1PCQNv6xeM6+tP4uwB8y3cKX7WU3fC/LtXXV Ki3AzqWs0ld8bQ== X-Received: by 10.223.129.4 with SMTP id 4mr2142586wrm.153.1496338496318; Thu, 01 Jun 2017 10:34:56 -0700 (PDT) Received: from Solace.fritz.box ([80.66.223.25]) by smtp.gmail.com with ESMTPSA id w96sm19845647wrc.14.2017.06.01.10.34.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Jun 2017 10:34:55 -0700 (PDT) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Thu, 01 Jun 2017 19:34:54 +0200 Message-ID: <149633849433.12814.15219347529727531333.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 11/15] tools: tracing: handle RCU 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 | 5 +++ tools/xentrace/xenalyze.c | 82 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) diff --git a/tools/xentrace/formats b/tools/xentrace/formats index 77dbd93..615ba7d 100644 --- a/tools/xentrace/formats +++ b/tools/xentrace/formats @@ -214,6 +214,11 @@ 0x01001007 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) rcu_do_callbacks [ ] 0x01001008 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) rcu_pending [ %(1)d ] +0x01002001 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) softirq_handler [ nr:pending_mask = 0x%(1)08x ] +0x01002002 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) softirq_raise_cpumask [ nr = %(1)d, CPU mask: 0x%(7)08x%(6)08x%(5)08x%(4)08x%(3)08x%(2)08x ] +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 ] + 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 e98596a..5cb0f3b 100644 --- a/tools/xentrace/xenalyze.c +++ b/tools/xentrace/xenalyze.c @@ -8684,6 +8684,84 @@ void rcu_process(struct pcpu_info *p) { } } +void softirq_process(struct pcpu_info *p) { + struct record_info *ri = &p->ri; + + switch ( ri->event ) + { + case TRC_XEN_SIRQ_RAISE: + { + struct { + uint32_t nr; + } *r = (typeof(r))ri->d; + + if ( opt.dump_all ) + { + printf(" %s raise_softirq nr %u\n", + ri->dump_header, + r->nr); + } + break; + } + case TRC_XEN_SIRQ_RAISE_CPU: + { + struct { + uint16_t cpu, nr; + } *r = (typeof(r))ri->d; + + if ( opt.dump_all ) + { + printf(" %s raise_softirq nr %u on cpu %u\n", + ri->dump_header, + r->nr, + r->cpu); + } + break; + } + case TRC_XEN_SIRQ_RAISE_MASK: + { + struct { + uint32_t nr; + uint32_t mask[6]; + } *r = (typeof(r))ri->d; + + if ( opt.dump_all ) + { + int i; + + i = 5; + while ( i >= 0 && !r->mask[i] ) i--; + printf(" %s raise_softirq nr %u on cpumask 0x", + ri->dump_header, + r->nr); + for ( ; i >= 0 ; i-- ) + printf("%08x", r->mask[i]); + printf("\n"); + } + break; + } + case TRC_XEN_SIRQ_HANDLER: + { + struct { + uint16_t pending, nr; + } *r = (typeof(r))ri->d; + + if ( opt.dump_all ) + { + printf(" %s softirq_handler nr %u, pending = 0x%08x\n", + ri->dump_header, + r->nr, + r->pending); + } + 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) @@ -8703,6 +8781,7 @@ void hw_process(struct pcpu_info *p) } #define TRC_XEN_SUB_RCU 1 +#define TRC_XEN_SUB_SIRQ 2 void xen_process(struct pcpu_info *p) { struct record_info *ri = &p->ri; @@ -8712,6 +8791,9 @@ void xen_process(struct pcpu_info *p) case TRC_XEN_SUB_RCU: rcu_process(p); break; + case TRC_XEN_SUB_SIRQ: + softirq_process(p); + break; } }