From patchwork Thu Jun 1 17:35:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 9760731 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 AF2B560363 for ; Thu, 1 Jun 2017 17:37:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A148204BD for ; Thu, 1 Jun 2017 17:37:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E50528518; Thu, 1 Jun 2017 17:37:34 +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 01E95204BD for ; Thu, 1 Jun 2017 17:37:34 +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 1dGU0Q-0000v3-5Y; Thu, 01 Jun 2017 17:35:30 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGU0O-0000tg-Mg for xen-devel@lists.xenproject.org; Thu, 01 Jun 2017 17:35:28 +0000 Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id A0/73-17076-F5050395; Thu, 01 Jun 2017 17:35:27 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrJIsWRWlGSWpSXmKPExsXiVRvkrBsfYBB p8PaOsMX3LZOZHBg9Dn+4whLAGMWamZeUX5HAmnFn+Uy2gvOGFV+X3GdrYFyk3MXIxSEkMINR 4tjS22wgDovAGlaJw78nM4I4EgKXgJwLL1i6GDmBnDiJHdv3MkLYFRI3ZxxhA7GFBFQkbm5fx QQx6iejxK2Ty5lBEsICehJHjv5gh7BDJR5vmAYWZxMwkHizYy8riC0ioCRxb9VkJhCbGWjoip c3wGwWAVWJY88vgdXzCnhLLD/2H2wZp4CvxKRTZxghFvtIfPs1AaxeVEBOYuXlFlaIekGJkzO fAB3NATRTU2L9Ln2I8fIS29/OYZ7AKDILSdUshKpZSKoWMDKvYtQoTi0qSy3SNTLSSyrKTM8o yU3MzNE1NDDWy00tLk5MT81JTCrWS87P3cQIjIB6BgbGHYxTT/gdYpTkYFIS5V0gbxApxJeUn 1KZkVicEV9UmpNafIhRhoNDSYL3gh9QTrAoNT21Ii0zBxiLMGkJDh4lEd4UkDRvcUFibnFmOk TqFKMxx4bV678wcUw6sP0LkxBLXn5eqpQ4L7s/UKkASGlGaR7cIFiKuMQoKyXMy8jAwCDEU5B alJtZgir/ilGcg1FJmDcBZApPZl4J3L5XQKcwAZ3yYps+yCkliQgpqQZGeYW7KSJtrYuvzb/2 nPHmjqCP5SzvG97fZPolWfkldFWSqruz8G/9N+cjvug8XFDj5VmlzueX2Fnc6/N82bTTjmeqq uT6vE5HMV26o5fmW8/TNLn931aWYinWtrXT2Ocq5C329ql1a2PZZWBhzfhyzjrNj542DuWTd9 js9vGU52o4cqBw1nklluKMREMt5qLiRACGc8vXDAMAAA== X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-12.tower-31.messagelabs.com!1496338527!86869979!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 4313 invoked from network); 1 Jun 2017 17:35:27 -0000 Received: from mail-wm0-f67.google.com (HELO mail-wm0-f67.google.com) (74.125.82.67) by server-12.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 1 Jun 2017 17:35:27 -0000 Received: by mail-wm0-f67.google.com with SMTP id b84so13076912wmh.0 for ; Thu, 01 Jun 2017 10:35:27 -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=JhdNo6IaDcJ17EC3EUUNhEknLJo1WS5958rvgprVrg8=; b=u0/klPt4IR6zZjNTo3X34/dJldZmWVaXPlJ2sMJHAgJYSYFvKqwBdLy0UzALm9TXf2 2GehSGOJUKaoTVHkwEI5VhIvXtOfMYyUdRVxa5IiWoWXj4v2Xxi6DqGhiliMHuiOu9hx 89TobQedJv15KNkUs0/mgs9gMPcONHzbxWVq43B8sXGIbATiczR6U8wseaH4OsQz2i5J 7BGSzO5n69BXfSLd0JY7srCnV8T3CkcTzgBVQzjZ+RubFCkEmH9c46sY/mIwwp4wFO6p Ejwz3sMkfpqHZ03VusyWSEN60aVKrAVGjwwmSurF9kC0gtHiwOwzemvIPAc/3zJ5Qnx0 XOJw== 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=JhdNo6IaDcJ17EC3EUUNhEknLJo1WS5958rvgprVrg8=; b=sfOU/49XfCteQpgdCJbBIP2C7ZkDZXTWV4fdN90gwHN0ojGAzhYB1OqNTxMMPZu3Pz V02s9hxHkEjOIm+WZ4YyW7JUFblYp1PQCrvy+qeHBRyLOAqDZ7aM4CwadVk4qv5pL+1f fpCvSgPM4K2axzFYO5nMa0fgmLB5uDh3prtOmVdK8d8s2v1ThLMoD8b5P5m2GLrWaorE aOC0KzfapidZGEVpwf/qHS3HOlgrvYEkGDR8A9dsKwC5uReaiiUBoyaQKlcIcEMyC4rI FwrY5r7Ani1y5OqPkNAr5FDc1CHUhAX6tODtOKScmoc9YDEHlaBVkaWHjxaPa1+Ubl4b Q3PA== X-Gm-Message-State: AODbwcAut0mOemndxajVTKJKRTIP3RycxGcTq4cJcOqKtCZ/WupgLl4E ZLWiNzZruy8DhA== X-Received: by 10.223.139.72 with SMTP id v8mr2155032wra.13.1496338526927; Thu, 01 Jun 2017 10:35:26 -0700 (PDT) Received: from Solace.fritz.box ([80.66.223.25]) by smtp.gmail.com with ESMTPSA id y6sm24310420wrc.51.2017.06.01.10.35.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Jun 2017 10:35:26 -0700 (PDT) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Thu, 01 Jun 2017 19:35:25 +0200 Message-ID: <149633852462.12814.4878846086982777752.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 15/15] tools: tracing: handle timers 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 | 10 +++ tools/xentrace/xenalyze.c | 141 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 151 insertions(+) diff --git a/tools/xentrace/formats b/tools/xentrace/formats index 7d59db7..c2fdead 100644 --- a/tools/xentrace/formats +++ b/tools/xentrace/formats @@ -226,6 +226,16 @@ 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 [ ] +0x01008001 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) timer_rmentry [ t = 0x%(2)08x%(1)08x, cpu:status = %(3)08x ] +0x01008002 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) timer_addentry [ t = 0x%(2)08x%(1)08x, cpu:status = %(3)08x ] +0x01008003 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) timer_set [ t = 0x%(2)08x%(1)08x, fn = 0x%(4)08x%(3)08x exp=0x%(6)08x%(5)08x ] +0x01008004 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) timer_stop [ t = 0x%(2)08x%(1)08x ] +0x01008005 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) timer_migr [ t = 0x%(2)08x%(1)08x ] +0x01008006 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) timer_kill [ t = 0x%(2)08x%(1)08x ] +0x01008007 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) timer_exec [ t = 0x%(2)08x%(1)08x, tard=0x%(4)08x%(3)08x ] +0x01008008 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) timer_reprogr [ deadline=0x%(2)08x%(1)08x ] +0x01008009 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) timer_hoverfl [ old_lim:new_lim=0x%(1)08x ] + 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 eecdd61..c34479c 100644 --- a/tools/xentrace/xenalyze.c +++ b/tools/xentrace/xenalyze.c @@ -8850,6 +8850,143 @@ void tasklet_process(struct pcpu_info *p) { } } +void timer_process(struct pcpu_info *p) { + struct record_info *ri = &p->ri; + + switch ( ri->event ) + { + case TRC_XEN_TIMER_RMENTRY: + { + struct { + uint64_t addr; + uint16_t status, cpu; + } *r = (typeof(r))ri->d; + + if ( opt.dump_all ) + { + printf(" %s timer_rm_entry t=%p, cpu=%u, status=0x%x\n", + ri->dump_header, (void*)r->addr, r->cpu, r->status); + } + break; + } + case TRC_XEN_TIMER_ADDENTRY: + { + struct { + uint64_t addr; + uint16_t status, cpu; + } *r = (typeof(r))ri->d; + + if ( opt.dump_all ) + { + printf(" %s timer_add_entry t=%p, cpu=%u, status=0x%x\n", + ri->dump_header, (void*)r->addr, r->cpu, r->status); + } + break; + } + case TRC_XEN_TIMER_SET: + { + struct { + uint64_t addr, addr_fn; + int64_t expires; + } *r = (typeof(r))ri->d; + + if ( opt.dump_all ) + { + printf(" %s timer_set t=%p, fn=%p, expires_in=%ld.%luus\n", + ri->dump_header, (void*)r->addr, (void*)r->addr_fn, + (long int)(r->expires / 1000), + (unsigned long int)labs(r->expires % 1000)); + } + break; + } + case TRC_XEN_TIMER_STOP: + { + struct { + uint64_t addr; + } *r = (typeof(r))ri->d; + + if ( opt.dump_all ) + { + printf(" %s timer_stop t=%p\n", ri->dump_header, (void*)r->addr); + } + break; + } + case TRC_XEN_TIMER_MIGRATE: + { + struct { + uint64_t addr; + uint16_t new_cpu, old_cpu; + } *r = (typeof(r))ri->d; + + if ( opt.dump_all ) + { + printf(" %s timer_migrate t=%p, cpu=%u, new_cpu=%u\n", + ri->dump_header, (void*)r->addr, r->old_cpu, r->new_cpu); + } + break; + } + case TRC_XEN_TIMER_KILL: + { + struct { + uint64_t addr; + } *r = (typeof(r))ri->d; + + if ( opt.dump_all ) + { + printf(" %s timer_kill t=%p\n", ri->dump_header, (void*)r->addr); + } + break; + } + case TRC_XEN_TIMER_EXEC: + { + struct { + uint64_t addr; + int64_t tardiness; + } *r = (typeof(r))ri->d; + + if ( opt.dump_all ) + { + printf(" %s timer_exec t=%p, tardiness=%ld.%luus\n", + ri->dump_header, (void*)r->addr, + (long int)(r->tardiness / 1000), + (unsigned long int)labs(r->tardiness % 1000)); + } + break; + } + case TRC_XEN_TIMER_REPRGR: + { + struct { + uint64_t deadline; + } *r = (typeof(r))ri->d; + + if ( opt.dump_all ) + { + printf(" %s timer_reprogr deadline=%lu.%luus\n", + ri->dump_header, (unsigned long int)(r->deadline / 1000), + (unsigned long int)(r->deadline % 1000)); + } + break; + } + case TRC_XEN_TIMER_HOVERFL: + { + struct { + uint16_t new_limit, old_limit; + } *r = (typeof(r))ri->d; + + if ( opt.dump_all ) + { + printf(" %s timer_heap_overflow, limit=%u, new_limit=%u\n", + ri->dump_header, r->old_limit, r->new_limit); + } + 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) @@ -8871,6 +9008,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 +#define TRC_XEN_SUB_TIMER 8 void xen_process(struct pcpu_info *p) { struct record_info *ri = &p->ri; @@ -8886,6 +9024,9 @@ void xen_process(struct pcpu_info *p) case TRC_XEN_SUB_TSKLT: tasklet_process(p); break; + case TRC_XEN_SUB_TIMER: + timer_process(p); + break; } }