blob: 20734b7b341b6041cfbd5194f702e50a3178f07e [file] [log] [blame]
Vitaly Kuznetsovc9fe0f82017-10-29 12:21:00 -07001#undef TRACE_SYSTEM
2#define TRACE_SYSTEM hyperv
3
4#if !defined(_HV_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _HV_TRACE_H
6
7#include <linux/tracepoint.h>
8
9DECLARE_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=%u", __entry->msgtype)
15);
16
17DEFINE_EVENT(vmbus_hdr_msg, vmbus_on_msg_dpc,
18 TP_PROTO(const struct vmbus_channel_message_header *hdr),
19 TP_ARGS(hdr)
20);
21
Vitaly Kuznetsov716fa522017-10-29 12:21:01 -070022DEFINE_EVENT(vmbus_hdr_msg, vmbus_on_message,
23 TP_PROTO(const struct vmbus_channel_message_header *hdr),
24 TP_ARGS(hdr)
25);
26
Vitaly Kuznetsov03b81e62017-10-29 12:21:02 -070027TRACE_EVENT(vmbus_onoffer,
28 TP_PROTO(const struct vmbus_channel_offer_channel *offer),
29 TP_ARGS(offer),
30 TP_STRUCT__entry(
31 __field(u32, child_relid)
32 __field(u8, monitorid)
33 __field(u16, is_ddc_int)
34 __field(u32, connection_id)
35 __array(char, if_type, 16)
36 __array(char, if_instance, 16)
37 __field(u16, chn_flags)
38 __field(u16, mmio_mb)
39 __field(u16, sub_idx)
40 ),
41 TP_fast_assign(__entry->child_relid = offer->child_relid;
42 __entry->monitorid = offer->monitorid;
43 __entry->is_ddc_int = offer->is_dedicated_interrupt;
44 __entry->connection_id = offer->connection_id;
45 memcpy(__entry->if_type,
46 &offer->offer.if_type.b, 16);
47 memcpy(__entry->if_instance,
48 &offer->offer.if_instance.b, 16);
49 __entry->chn_flags = offer->offer.chn_flags;
50 __entry->mmio_mb = offer->offer.mmio_megabytes;
51 __entry->sub_idx = offer->offer.sub_channel_index;
52 ),
53 TP_printk("child_relid 0x%x, monitorid 0x%x, is_dedicated %d, "
54 "connection_id 0x%x, if_type %pUl, if_instance %pUl, "
55 "chn_flags 0x%x, mmio_megabytes %d, sub_channel_index %d",
56 __entry->child_relid, __entry->monitorid,
57 __entry->is_ddc_int, __entry->connection_id,
58 __entry->if_type, __entry->if_instance,
59 __entry->chn_flags, __entry->mmio_mb,
60 __entry->sub_idx
61 )
62 );
63
Vitaly Kuznetsov51751672017-10-29 12:21:03 -070064TRACE_EVENT(vmbus_onoffer_rescind,
65 TP_PROTO(const struct vmbus_channel_rescind_offer *offer),
66 TP_ARGS(offer),
67 TP_STRUCT__entry(__field(u32, child_relid)),
68 TP_fast_assign(__entry->child_relid = offer->child_relid),
69 TP_printk("child_relid 0x%x", __entry->child_relid)
70 );
71
Vitaly Kuznetsov9f23ce12017-10-29 12:21:04 -070072TRACE_EVENT(vmbus_onopen_result,
73 TP_PROTO(const struct vmbus_channel_open_result *result),
74 TP_ARGS(result),
75 TP_STRUCT__entry(
76 __field(u32, child_relid)
77 __field(u32, openid)
78 __field(u32, status)
79 ),
80 TP_fast_assign(__entry->child_relid = result->child_relid;
81 __entry->openid = result->openid;
82 __entry->status = result->status;
83 ),
84 TP_printk("child_relid 0x%x, openid %d, status %d",
85 __entry->child_relid, __entry->openid, __entry->status
86 )
87 );
88
Vitaly Kuznetsova13bf0e2017-10-29 12:21:05 -070089TRACE_EVENT(vmbus_ongpadl_created,
90 TP_PROTO(const struct vmbus_channel_gpadl_created *gpadlcreated),
91 TP_ARGS(gpadlcreated),
92 TP_STRUCT__entry(
93 __field(u32, child_relid)
94 __field(u32, gpadl)
95 __field(u32, status)
96 ),
97 TP_fast_assign(__entry->child_relid = gpadlcreated->child_relid;
98 __entry->gpadl = gpadlcreated->gpadl;
99 __entry->status = gpadlcreated->creation_status;
100 ),
101 TP_printk("child_relid 0x%x, gpadl 0x%x, creation_status %d",
102 __entry->child_relid, __entry->gpadl, __entry->status
103 )
104 );
105
Vitaly Kuznetsovc9fe0f82017-10-29 12:21:00 -0700106#undef TRACE_INCLUDE_PATH
107#define TRACE_INCLUDE_PATH .
108#undef TRACE_INCLUDE_FILE
109#define TRACE_INCLUDE_FILE hv_trace
110#endif /* _HV_TRACE_H */
111
112/* This part must be outside protection */
113#include <trace/define_trace.h>