Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751583AbdHaUGZ (ORCPT ); Thu, 31 Aug 2017 16:06:25 -0400 Received: from terminus.zytor.com ([65.50.211.136]:34927 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751024AbdHaUGY (ORCPT ); Thu, 31 Aug 2017 16:06:24 -0400 Date: Thu, 31 Aug 2017 13:01:41 -0700 From: tip-bot for Vitaly Kuznetsov Message-ID: Cc: tglx@linutronix.de, andy.shevchenko@gmail.com, vkuznets@redhat.com, Jork.Loeser@microsoft.com, rostedt@goodmis.org, mingo@kernel.org, peterz@infradead.org, sixiao@microsoft.com, kys@microsoft.com, sthemmin@microsoft.com, torvalds@linux-foundation.org, haiyangz@microsoft.com, hpa@zytor.com, luto@kernel.org, linux-kernel@vger.kernel.org Reply-To: haiyangz@microsoft.com, hpa@zytor.com, linux-kernel@vger.kernel.org, luto@kernel.org, torvalds@linux-foundation.org, sthemmin@microsoft.com, kys@microsoft.com, sixiao@microsoft.com, vkuznets@redhat.com, andy.shevchenko@gmail.com, tglx@linutronix.de, peterz@infradead.org, Jork.Loeser@microsoft.com, mingo@kernel.org, rostedt@goodmis.org In-Reply-To: <20170802160921.21791-10-vkuznets@redhat.com> References: <20170802160921.21791-10-vkuznets@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/platform] tracing/hyper-v: Trace hyperv_mmu_flush_tlb_others() Git-Commit-ID: 773b79f7a7c7839fb9d09c0e206734173a8b0a6b X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4037 Lines: 123 Commit-ID: 773b79f7a7c7839fb9d09c0e206734173a8b0a6b Gitweb: http://git.kernel.org/tip/773b79f7a7c7839fb9d09c0e206734173a8b0a6b Author: Vitaly Kuznetsov AuthorDate: Wed, 2 Aug 2017 18:09:21 +0200 Committer: Ingo Molnar CommitDate: Thu, 31 Aug 2017 14:20:37 +0200 tracing/hyper-v: Trace hyperv_mmu_flush_tlb_others() Add Hyper-V tracing subsystem and trace hyperv_mmu_flush_tlb_others(). Tracing is done the same way we do xen_mmu_flush_tlb_others(). Signed-off-by: Vitaly Kuznetsov Reviewed-by: Andy Shevchenko Reviewed-by: Stephen Hemminger Reviewed-by: Steven Rostedt (VMware) Cc: Andy Lutomirski Cc: Haiyang Zhang Cc: Jork Loeser Cc: K. Y. Srinivasan Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Simon Xiao Cc: Thomas Gleixner Cc: devel@linuxdriverproject.org Link: http://lkml.kernel.org/r/20170802160921.21791-10-vkuznets@redhat.com Signed-off-by: Ingo Molnar --- MAINTAINERS | 1 + arch/x86/hyperv/mmu.c | 7 +++++++ arch/x86/include/asm/trace/hyperv.h | 40 +++++++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index b3eadf3..9fcffdf 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -6258,6 +6258,7 @@ M: Stephen Hemminger L: devel@linuxdriverproject.org S: Maintained F: arch/x86/include/asm/mshyperv.h +F: arch/x86/include/asm/trace/hyperv.h F: arch/x86/include/uapi/asm/hyperv.h F: arch/x86/kernel/cpu/mshyperv.c F: arch/x86/hyperv diff --git a/arch/x86/hyperv/mmu.c b/arch/x86/hyperv/mmu.c index 51b44be..39e7f6e 100644 --- a/arch/x86/hyperv/mmu.c +++ b/arch/x86/hyperv/mmu.c @@ -10,6 +10,9 @@ #include #include +#define CREATE_TRACE_POINTS +#include + /* HvFlushVirtualAddressSpace, HvFlushVirtualAddressList hypercalls */ struct hv_flush_pcpu { u64 address_space; @@ -103,6 +106,8 @@ static void hyperv_flush_tlb_others(const struct cpumask *cpus, u64 status = U64_MAX; unsigned long flags; + trace_hyperv_mmu_flush_tlb_others(cpus, info); + if (!pcpu_flush || !hv_hypercall_pg) goto do_native; @@ -172,6 +177,8 @@ static void hyperv_flush_tlb_others_ex(const struct cpumask *cpus, u64 status = U64_MAX; unsigned long flags; + trace_hyperv_mmu_flush_tlb_others(cpus, info); + if (!pcpu_flush_ex || !hv_hypercall_pg) goto do_native; diff --git a/arch/x86/include/asm/trace/hyperv.h b/arch/x86/include/asm/trace/hyperv.h new file mode 100644 index 0000000..4253bca --- /dev/null +++ b/arch/x86/include/asm/trace/hyperv.h @@ -0,0 +1,40 @@ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM hyperv + +#if !defined(_TRACE_HYPERV_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_HYPERV_H + +#include + +#if IS_ENABLED(CONFIG_HYPERV) + +TRACE_EVENT(hyperv_mmu_flush_tlb_others, + TP_PROTO(const struct cpumask *cpus, + const struct flush_tlb_info *info), + TP_ARGS(cpus, info), + TP_STRUCT__entry( + __field(unsigned int, ncpus) + __field(struct mm_struct *, mm) + __field(unsigned long, addr) + __field(unsigned long, end) + ), + TP_fast_assign(__entry->ncpus = cpumask_weight(cpus); + __entry->mm = info->mm; + __entry->addr = info->start; + __entry->end = info->end; + ), + TP_printk("ncpus %d mm %p addr %lx, end %lx", + __entry->ncpus, __entry->mm, + __entry->addr, __entry->end) + ); + +#endif /* CONFIG_HYPERV */ + +#undef TRACE_INCLUDE_PATH +#define TRACE_INCLUDE_PATH asm/trace/ +#undef TRACE_INCLUDE_FILE +#define TRACE_INCLUDE_FILE hyperv +#endif /* _TRACE_HYPERV_H */ + +/* This part must be outside protection */ +#include