From patchwork Tue Jan 31 17:16:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Punit Agrawal X-Patchwork-Id: 9547881 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 89E0860425 for ; Tue, 31 Jan 2017 17:32:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D2D72839C for ; Tue, 31 Jan 2017 17:32:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 71C1E283E8; Tue, 31 Jan 2017 17:32:23 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 42E212839C for ; Tue, 31 Jan 2017 17:32:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751754AbdAaRae (ORCPT ); Tue, 31 Jan 2017 12:30:34 -0500 Received: from foss.arm.com ([217.140.101.70]:43296 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751302AbdAaR2R (ORCPT ); Tue, 31 Jan 2017 12:28:17 -0500 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 37E8F15A2; Tue, 31 Jan 2017 09:17:16 -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 09C5E3F24D; Tue, 31 Jan 2017 09:17:16 -0800 (PST) From: Punit Agrawal To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Cc: Punit Agrawal , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Christoffer Dall , Marc Zyngier , Steven Rostedt , Will Deacon , Mark Rutland , Paolo Bonzini Subject: [PATCH v4 2/9] KVM: Add event to trace tlb invalidations Date: Tue, 31 Jan 2017 17:16:23 +0000 Message-Id: <20170131171630.26898-3-punit.agrawal@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170131171630.26898-1-punit.agrawal@arm.com> References: <20170131171630.26898-1-punit.agrawal@arm.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.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 */