Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1742106 > unrolled thread

[PATCH v2 01/16] hyper-v: trace vmbus_on_msg_dpc()

Started byVitaly Kuznetsov <vkuznets@redhat.com>
First post2017-09-29 15:30 +0200
Last post2017-10-02 02:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 01/16] hyper-v: trace vmbus_on_msg_dpc() Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-09-29 15:30 +0200
    Re: [PATCH v2 01/16] hyper-v: trace vmbus_on_msg_dpc() kbuild test robot <lkp@intel.com> - 2017-10-02 02:20 +0200

#1742106 — [PATCH v2 01/16] hyper-v: trace vmbus_on_msg_dpc()

FromVitaly Kuznetsov <vkuznets@redhat.com>
Date2017-09-29 15:30 +0200
Subject[PATCH v2 01/16] hyper-v: trace vmbus_on_msg_dpc()
Message-ID<uv3wC-6Hg-13@gated-at.bofh.it>
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..82432e351724
--- /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=%d", __entry->msgtype)
+);
+
+DEFINE_EVENT_PRINT(vmbus_hdr_msg, vmbus_on_msg_dpc,
+	TP_PROTO(const struct vmbus_channel_message_header *hdr),
+	TP_ARGS(hdr),
+	TP_printk("message %u received", __entry->msgtype));
+
+#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.5

[toc] | [next] | [standalone]


#1742913

Fromkbuild test robot <lkp@intel.com>
Date2017-10-02 02:20 +0200
Message-ID<uvWCK-mC-13@gated-at.bofh.it>
In reply to#1742106

[Multipart message — attachments visible in raw view] — view raw

Hi Vitaly,

[auto build test WARNING on linus/master]
[also build test WARNING on v4.14-rc3 next-20170929]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Vitaly-Kuznetsov/hyper-v-trace-vmbus_on_msg_dpc/20171002-062040
config: i386-randconfig-x017-201740 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   In file included from include/trace/define_trace.h:95:0,
                    from drivers/hv/hv_trace.h:29,
                    from drivers/hv/hv_trace.c:4:
   include/trace/trace_events.h:759:13: warning: 'print_fmt_vmbus_hdr_msg' defined but not used [-Wunused-variable]
    static char print_fmt_##call[] = print;     \
                ^
>> drivers/hv/./hv_trace.h:9:1: note: in expansion of macro 'DECLARE_EVENT_CLASS'
    DECLARE_EVENT_CLASS(vmbus_hdr_msg,
    ^~~~~~~~~~~~~~~~~~~
   In file included from include/trace/define_trace.h:95:0,
                    from drivers/hv/hv_trace.h:29,
                    from drivers/hv/hv_trace.c:4:
   include/trace/trace_events.h:363:37: warning: 'trace_event_type_funcs_vmbus_hdr_msg' defined but not used [-Wunused-variable]
    static struct trace_event_functions trace_event_type_funcs_##call = { \
                                        ^
>> drivers/hv/./hv_trace.h:9:1: note: in expansion of macro 'DECLARE_EVENT_CLASS'
    DECLARE_EVENT_CLASS(vmbus_hdr_msg,
    ^~~~~~~~~~~~~~~~~~~

vim +/DECLARE_EVENT_CLASS +9 drivers/hv/./hv_trace.h

     8	
   > 9	DECLARE_EVENT_CLASS(vmbus_hdr_msg,
    10		TP_PROTO(const struct vmbus_channel_message_header *hdr),
    11		TP_ARGS(hdr),
    12		TP_STRUCT__entry(__field(unsigned int, msgtype)),
    13		TP_fast_assign(__entry->msgtype = hdr->msgtype;),
    14		TP_printk("msgtype=%d", __entry->msgtype)
    15	);
    16	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web