From: Nischala Yelchuri <niyelchu@linux.microsoft.com>
To: linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Tyler Hicks <code@tyhicks.com>,
boqun.feng@gmail.com, "K. Y. Srinivasan" <kys@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
Nischala Yelchuri <niyelchu@microsoft.com>,
Nischala Yelchuri <niyelchu@linux.microsoft.com>
Subject: [PATCH] x86/hyperv: Trace hv_set_register()
Date: Tue, 6 Jun 2023 18:35:57 -0700 [thread overview]
Message-ID: <1686101757-23985-1-git-send-email-niyelchu@linux.microsoft.com> (raw)
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@linux.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
next reply other threads:[~2023-06-07 1:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-07 1:35 Nischala Yelchuri [this message]
2023-06-07 11:27 ` [PATCH] x86/hyperv: Trace hv_set_register() Dave Hansen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1686101757-23985-1-git-send-email-niyelchu@linux.microsoft.com \
--to=niyelchu@linux.microsoft.com \
--cc=boqun.feng@gmail.com \
--cc=bp@alien8.de \
--cc=code@tyhicks.com \
--cc=dave.hansen@linux.intel.com \
--cc=decui@microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=hpa@zytor.com \
--cc=kys@microsoft.com \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=niyelchu@microsoft.com \
--cc=tglx@linutronix.de \
--cc=wei.liu@kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.