[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1686101757-23985-1-git-send-email-niyelchu@linux.microsoft.com>
Date: Tue, 6 Jun 2023 18:35:57 -0700
From: Nischala Yelchuri <niyelchu@...ux.microsoft.com>
To: linux-hyperv@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Tyler Hicks <code@...icks.com>, boqun.feng@...il.com,
"K. Y. Srinivasan" <kys@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Wei Liu <wei.liu@...nel.org>, Dexuan Cui <decui@...rosoft.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>,
Nischala Yelchuri <niyelchu@...rosoft.com>,
Nischala Yelchuri <niyelchu@...ux.microsoft.com>
Subject: [PATCH] x86/hyperv: Trace hv_set_register()
Add a new trace point trace_hyperv_set_register()
to capture register address and its value in hv_set_register().
Signed-off-by: Nischala Yelchuri <niyelchu@...ux.microsoft.com>
---
arch/x86/include/asm/trace/hyperv.h | 14 ++++++++++++++
arch/x86/kernel/cpu/mshyperv.c | 3 +++
2 files changed, 17 insertions(+)
diff --git a/arch/x86/include/asm/trace/hyperv.h b/arch/x86/include/asm/trace/hyperv.h
index a8e5a7a2b..54b2f69f5 100644
--- a/arch/x86/include/asm/trace/hyperv.h
+++ b/arch/x86/include/asm/trace/hyperv.h
@@ -86,6 +86,20 @@ TRACE_EVENT(hyperv_send_ipi_one,
__entry->cpu, __entry->vector)
);
+TRACE_EVENT(hyperv_set_register,
+ TP_PROTO(unsigned int reg,
+ u64 value),
+ TP_ARGS(reg, value),
+ TP_STRUCT__entry(
+ __field(unsigned int, reg)
+ __field(u64, value)
+ ),
+ TP_fast_assign(__entry->reg = reg;
+ __entry->value = value;
+ ),
+ TP_printk("reg %u value %llu",
+ __entry->reg, __entry->value)
+ );
#endif /* CONFIG_HYPERV */
#undef TRACE_INCLUDE_PATH
diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index c7969e806..d4ef63f4e 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -32,6 +32,7 @@
#include <asm/nmi.h>
#include <clocksource/hyperv_timer.h>
#include <asm/numa.h>
+#include <asm/trace/hyperv.h>
/* Is Linux running as the root partition? */
bool hv_root_partition;
@@ -98,6 +99,8 @@ EXPORT_SYMBOL_GPL(hv_get_register);
void hv_set_register(unsigned int reg, u64 value)
{
+ trace_hyperv_set_register(reg, value);
+
if (hv_nested)
reg = hv_get_nested_reg(reg);
--
2.25.1
Powered by blists - more mailing lists