From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: devel@linuxdriverproject.org
Cc: linux-kernel@vger.kernel.org,
"K. Y. Srinivasan" <kys@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
Stephen Hemminger <sthemmin@microsoft.com>,
Steven Rostedt <rostedt@goodmis.org>,
Dexuan Cui <decui@microsoft.com>
Subject: [PATCH v3 01/17] hyper-v: trace vmbus_on_msg_dpc()
Date: Thu, 5 Oct 2017 16:50:28 +0200 [thread overview]
Message-ID: <20171005145044.12181-2-vkuznets@redhat.com> (raw)
In-Reply-To: <20171005145044.12181-1-vkuznets@redhat.com>
Add tracing subsystem to Hyper-V VMBus module and add tracepoint
to vmbus_on_msg_dpc() which is called when we receive a message from host.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
drivers/hv/Makefile | 4 +++-
drivers/hv/hv_trace.c | 4 ++++
drivers/hv/hv_trace.h | 29 +++++++++++++++++++++++++++++
drivers/hv/hyperv_vmbus.h | 2 ++
drivers/hv/vmbus_drv.c | 2 ++
5 files changed, 40 insertions(+), 1 deletion(-)
create mode 100644 drivers/hv/hv_trace.c
create mode 100644 drivers/hv/hv_trace.h
diff --git a/drivers/hv/Makefile b/drivers/hv/Makefile
index 39c9b2c08d33..ad791e00230f 100644
--- a/drivers/hv/Makefile
+++ b/drivers/hv/Makefile
@@ -2,7 +2,9 @@ obj-$(CONFIG_HYPERV) += hv_vmbus.o
obj-$(CONFIG_HYPERV_UTILS) += hv_utils.o
obj-$(CONFIG_HYPERV_BALLOON) += hv_balloon.o
+CFLAGS_hv_trace.o = -I$(src)
+
hv_vmbus-y := vmbus_drv.o \
hv.o connection.o channel.o \
- channel_mgmt.o ring_buffer.o
+ channel_mgmt.o ring_buffer.o hv_trace.o
hv_utils-y := hv_util.o hv_kvp.o hv_snapshot.o hv_fcopy.o hv_utils_transport.o
diff --git a/drivers/hv/hv_trace.c b/drivers/hv/hv_trace.c
new file mode 100644
index 000000000000..df47acd01a81
--- /dev/null
+++ b/drivers/hv/hv_trace.c
@@ -0,0 +1,4 @@
+#include "hyperv_vmbus.h"
+
+#define CREATE_TRACE_POINTS
+#include "hv_trace.h"
diff --git a/drivers/hv/hv_trace.h b/drivers/hv/hv_trace.h
new file mode 100644
index 000000000000..9c2772922c76
--- /dev/null
+++ b/drivers/hv/hv_trace.h
@@ -0,0 +1,29 @@
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM hyperv
+
+#if !defined(_HV_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _HV_TRACE_H
+
+#include <linux/tracepoint.h>
+
+DECLARE_EVENT_CLASS(vmbus_hdr_msg,
+ TP_PROTO(const struct vmbus_channel_message_header *hdr),
+ TP_ARGS(hdr),
+ TP_STRUCT__entry(__field(unsigned int, msgtype)),
+ TP_fast_assign(__entry->msgtype = hdr->msgtype;),
+ TP_printk("msgtype=%u", __entry->msgtype)
+);
+
+DEFINE_EVENT(vmbus_hdr_msg, vmbus_on_msg_dpc,
+ TP_PROTO(const struct vmbus_channel_message_header *hdr),
+ TP_ARGS(hdr)
+);
+
+#undef TRACE_INCLUDE_PATH
+#define TRACE_INCLUDE_PATH .
+#undef TRACE_INCLUDE_FILE
+#define TRACE_INCLUDE_FILE hv_trace
+#endif /* _HV_TRACE_H */
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>
diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h
index 49569f8fe038..82eb082f3302 100644
--- a/drivers/hv/hyperv_vmbus.h
+++ b/drivers/hv/hyperv_vmbus.h
@@ -31,6 +31,8 @@
#include <linux/hyperv.h>
#include <linux/interrupt.h>
+#include "hv_trace.h"
+
/*
* Timeout for services such as KVP and fcopy.
*/
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index a9d49f6f6501..ced33b1982c4 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -834,6 +834,8 @@ void vmbus_on_msg_dpc(unsigned long data)
hdr = (struct vmbus_channel_message_header *)msg->u.payload;
+ trace_vmbus_on_msg_dpc(hdr);
+
if (hdr->msgtype >= CHANNELMSG_COUNT) {
WARN_ONCE(1, "unknown msgtype=%d\n", hdr->msgtype);
goto msg_handled;
--
2.13.6
next prev parent reply other threads:[~2017-10-05 14:50 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-05 14:50 [PATCH v3 00/17] Hyper-V: add tracing to VMBus module and trace messages/events Vitaly Kuznetsov
2017-10-05 14:50 ` Vitaly Kuznetsov [this message]
2017-10-05 14:50 ` [PATCH v3 02/17] hyper-v: trace vmbus_on_message() Vitaly Kuznetsov
2017-10-05 14:50 ` [PATCH v3 03/17] hyper-v: trace vmbus_onoffer() Vitaly Kuznetsov
2017-10-05 14:50 ` [PATCH v3 04/17] hyper-v: trace vmbus_onoffer_rescind() Vitaly Kuznetsov
2017-10-05 14:50 ` [PATCH v3 05/17] hyper-v: trace vmbus_onopen_result() Vitaly Kuznetsov
2017-10-05 14:50 ` [PATCH v3 06/17] hyper-v: trace vmbus_ongpadl_created() Vitaly Kuznetsov
2017-10-05 14:50 ` [PATCH v3 07/17] hyper-v: trace vmbus_ongpadl_torndown() Vitaly Kuznetsov
2017-10-05 14:50 ` [PATCH v3 08/17] hyper-v: trace vmbus_onversion_response() Vitaly Kuznetsov
2017-10-05 14:50 ` [PATCH v3 09/17] hyper-v: trace vmbus_request_offers() Vitaly Kuznetsov
2017-10-05 14:50 ` [PATCH v3 10/17] hyper-v: trace vmbus_open() Vitaly Kuznetsov
2017-10-05 14:50 ` [PATCH v3 11/17] hyper-v: trace vmbus_close_internal() Vitaly Kuznetsov
2017-10-05 14:50 ` [PATCH v3 12/17] hyper-v: trace vmbus_establish_gpadl() Vitaly Kuznetsov
2017-10-05 14:50 ` [PATCH v3 13/17] hyper-v: trace vmbus_teardown_gpadl() Vitaly Kuznetsov
2017-10-05 14:50 ` [PATCH v3 14/17] hyper-v: trace vmbus_negotiate_version() Vitaly Kuznetsov
2017-10-05 14:50 ` [PATCH v3 15/17] hyper-v: trace vmbus_release_relid() Vitaly Kuznetsov
2017-10-05 14:50 ` [PATCH v3 16/17] hyper-v: trace vmbus_send_tl_connect_request() Vitaly Kuznetsov
2017-10-05 14:50 ` [PATCH v3 17/17] hyper-v: trace channel events Vitaly Kuznetsov
2017-10-05 15:49 ` [PATCH v3 00/17] Hyper-V: add tracing to VMBus module and trace messages/events Stephen Hemminger
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=20171005145044.12181-2-vkuznets@redhat.com \
--to=vkuznets@redhat.com \
--cc=decui@microsoft.com \
--cc=devel@linuxdriverproject.org \
--cc=haiyangz@microsoft.com \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=sthemmin@microsoft.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox