From patchwork Tue Jan 10 11:38:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Punit Agrawal X-Patchwork-Id: 9506985 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 0DB24601E9 for ; Tue, 10 Jan 2017 11:40:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 017A627BFF for ; Tue, 10 Jan 2017 11:40:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA402283F1; Tue, 10 Jan 2017 11:40:32 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8D87C27BFF for ; Tue, 10 Jan 2017 11:40:32 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cQumz-0006GT-G6; Tue, 10 Jan 2017 11:40:29 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cQump-0004Iv-7S for linux-arm-kernel@lists.infradead.org; Tue, 10 Jan 2017 11:40:21 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 13B63707; Tue, 10 Jan 2017 03:40:00 -0800 (PST) Received: from localhost (e105922-lin.cambridge.arm.com [10.1.195.25]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D93313F3D6; Tue, 10 Jan 2017 03:39:59 -0800 (PST) From: Punit Agrawal To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 3/9] KVM: Add event to trace tlb invalidations Date: Tue, 10 Jan 2017 11:38:50 +0000 Message-Id: <20170110113856.7183-4-punit.agrawal@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170110113856.7183-1-punit.agrawal@arm.com> References: <20170110113856.7183-1-punit.agrawal@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170110_034019_646688_E56FE794 X-CRM114-Status: UNSURE ( 6.82 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm@vger.kernel.org, Marc Zyngier , Punit Agrawal , linux-kernel@vger.kernel.org, Steven Rostedt , Paolo Bonzini , Christoffer Dall MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP As TLB operations can have an impact on system performance, add a trace event to enable monitoring of guest TLB maintenance operations. Signed-off-by: Punit Agrawal Cc: Steven Rostedt Cc: Paolo Bonzini --- include/trace/events/kvm.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h index 8ade3eb6c640..fbe33089264c 100644 --- a/include/trace/events/kvm.h +++ b/include/trace/events/kvm.h @@ -393,6 +393,24 @@ TRACE_EVENT(kvm_halt_poll_ns, #define trace_kvm_halt_poll_ns_shrink(vcpu_id, new, old) \ trace_kvm_halt_poll_ns(false, vcpu_id, new, old) +TRACE_EVENT(kvm_tlb_invalidate, + TP_PROTO(unsigned long vcpu_pc, u32 opcode), + TP_ARGS(vcpu_pc, opcode), + + TP_STRUCT__entry( + __field(unsigned long, vcpu_pc) + __field(u32, opcode) + ), + + TP_fast_assign( + __entry->vcpu_pc = vcpu_pc; + __entry->opcode = opcode; + ), + + TP_printk("vcpu_pc=0x%16lx opcode=%08x", __entry->vcpu_pc, + __entry->opcode) +); + #endif /* _TRACE_KVM_MAIN_H */ /* This part must be outside protection */