1 /* SPDX-License-Identifier: GPL-2.0 */
4 #define TRACE_SYSTEM hyperv
6 #if !defined(_HV_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
9 #include <linux/tracepoint.h>
11 DECLARE_EVENT_CLASS(vmbus_hdr_msg
,
12 TP_PROTO(const struct vmbus_channel_message_header
*hdr
),
14 TP_STRUCT__entry(__field(unsigned int, msgtype
)),
15 TP_fast_assign(__entry
->msgtype
= hdr
->msgtype
;),
16 TP_printk("msgtype=%u", __entry
->msgtype
)
19 DEFINE_EVENT(vmbus_hdr_msg
, vmbus_on_msg_dpc
,
20 TP_PROTO(const struct vmbus_channel_message_header
*hdr
),
24 DEFINE_EVENT(vmbus_hdr_msg
, vmbus_on_message
,
25 TP_PROTO(const struct vmbus_channel_message_header
*hdr
),
29 TRACE_EVENT(vmbus_onoffer
,
30 TP_PROTO(const struct vmbus_channel_offer_channel
*offer
),
33 __field(u32
, child_relid
)
34 __field(u8
, monitorid
)
35 __field(u16
, is_ddc_int
)
36 __field(u32
, connection_id
)
37 __array(char, if_type
, 16)
38 __array(char, if_instance
, 16)
39 __field(u16
, chn_flags
)
43 TP_fast_assign(__entry
->child_relid
= offer
->child_relid
;
44 __entry
->monitorid
= offer
->monitorid
;
45 __entry
->is_ddc_int
= offer
->is_dedicated_interrupt
;
46 __entry
->connection_id
= offer
->connection_id
;
47 memcpy(__entry
->if_type
,
48 &offer
->offer
.if_type
.b
, 16);
49 memcpy(__entry
->if_instance
,
50 &offer
->offer
.if_instance
.b
, 16);
51 __entry
->chn_flags
= offer
->offer
.chn_flags
;
52 __entry
->mmio_mb
= offer
->offer
.mmio_megabytes
;
53 __entry
->sub_idx
= offer
->offer
.sub_channel_index
;
55 TP_printk("child_relid 0x%x, monitorid 0x%x, is_dedicated %d, "
56 "connection_id 0x%x, if_type %pUl, if_instance %pUl, "
57 "chn_flags 0x%x, mmio_megabytes %d, sub_channel_index %d",
58 __entry
->child_relid
, __entry
->monitorid
,
59 __entry
->is_ddc_int
, __entry
->connection_id
,
60 __entry
->if_type
, __entry
->if_instance
,
61 __entry
->chn_flags
, __entry
->mmio_mb
,
66 TRACE_EVENT(vmbus_onoffer_rescind
,
67 TP_PROTO(const struct vmbus_channel_rescind_offer
*offer
),
69 TP_STRUCT__entry(__field(u32
, child_relid
)),
70 TP_fast_assign(__entry
->child_relid
= offer
->child_relid
),
71 TP_printk("child_relid 0x%x", __entry
->child_relid
)
74 TRACE_EVENT(vmbus_onopen_result
,
75 TP_PROTO(const struct vmbus_channel_open_result
*result
),
78 __field(u32
, child_relid
)
82 TP_fast_assign(__entry
->child_relid
= result
->child_relid
;
83 __entry
->openid
= result
->openid
;
84 __entry
->status
= result
->status
;
86 TP_printk("child_relid 0x%x, openid %d, status %d",
87 __entry
->child_relid
, __entry
->openid
, __entry
->status
91 TRACE_EVENT(vmbus_ongpadl_created
,
92 TP_PROTO(const struct vmbus_channel_gpadl_created
*gpadlcreated
),
93 TP_ARGS(gpadlcreated
),
95 __field(u32
, child_relid
)
99 TP_fast_assign(__entry
->child_relid
= gpadlcreated
->child_relid
;
100 __entry
->gpadl
= gpadlcreated
->gpadl
;
101 __entry
->status
= gpadlcreated
->creation_status
;
103 TP_printk("child_relid 0x%x, gpadl 0x%x, creation_status %d",
104 __entry
->child_relid
, __entry
->gpadl
, __entry
->status
108 TRACE_EVENT(vmbus_ongpadl_torndown
,
109 TP_PROTO(const struct vmbus_channel_gpadl_torndown
*gpadltorndown
),
110 TP_ARGS(gpadltorndown
),
111 TP_STRUCT__entry(__field(u32
, gpadl
)),
112 TP_fast_assign(__entry
->gpadl
= gpadltorndown
->gpadl
),
113 TP_printk("gpadl 0x%x", __entry
->gpadl
)
116 TRACE_EVENT(vmbus_onversion_response
,
117 TP_PROTO(const struct vmbus_channel_version_response
*response
),
122 TP_fast_assign(__entry
->ver
= response
->version_supported
;
124 TP_printk("version_supported %d", __entry
->ver
)
127 TRACE_EVENT(vmbus_request_offers
,
130 TP_STRUCT__entry(__field(int, ret
)),
131 TP_fast_assign(__entry
->ret
= ret
),
132 TP_printk("sending ret %d", __entry
->ret
)
135 TRACE_EVENT(vmbus_open
,
136 TP_PROTO(const struct vmbus_channel_open_channel
*msg
, int ret
),
139 __field(u32
, child_relid
)
141 __field(u32
, gpadlhandle
)
142 __field(u32
, target_vp
)
147 __entry
->child_relid
= msg
->child_relid
;
148 __entry
->openid
= msg
->openid
;
149 __entry
->gpadlhandle
= msg
->ringbuffer_gpadlhandle
;
150 __entry
->target_vp
= msg
->target_vp
;
151 __entry
->offset
= msg
->downstream_ringbuffer_pageoffset
;
154 TP_printk("sending child_relid 0x%x, openid %d, "
155 "gpadlhandle 0x%x, target_vp 0x%x, offset 0x%x, ret %d",
156 __entry
->child_relid
, __entry
->openid
,
157 __entry
->gpadlhandle
, __entry
->target_vp
,
158 __entry
->offset
, __entry
->ret
162 TRACE_EVENT(vmbus_close_internal
,
163 TP_PROTO(const struct vmbus_channel_close_channel
*msg
, int ret
),
166 __field(u32
, child_relid
)
170 __entry
->child_relid
= msg
->child_relid
;
173 TP_printk("sending child_relid 0x%x, ret %d", __entry
->child_relid
,
177 TRACE_EVENT(vmbus_establish_gpadl_header
,
178 TP_PROTO(const struct vmbus_channel_gpadl_header
*msg
, int ret
),
181 __field(u32
, child_relid
)
183 __field(u16
, range_buflen
)
184 __field(u16
, rangecount
)
188 __entry
->child_relid
= msg
->child_relid
;
189 __entry
->gpadl
= msg
->gpadl
;
190 __entry
->range_buflen
= msg
->range_buflen
;
191 __entry
->rangecount
= msg
->rangecount
;
194 TP_printk("sending child_relid 0x%x, gpadl 0x%x, range_buflen %d "
195 "rangecount %d, ret %d",
196 __entry
->child_relid
, __entry
->gpadl
,
197 __entry
->range_buflen
, __entry
->rangecount
, __entry
->ret
201 TRACE_EVENT(vmbus_establish_gpadl_body
,
202 TP_PROTO(const struct vmbus_channel_gpadl_body
*msg
, int ret
),
205 __field(u32
, msgnumber
)
210 __entry
->msgnumber
= msg
->msgnumber
;
211 __entry
->gpadl
= msg
->gpadl
;
214 TP_printk("sending msgnumber %d, gpadl 0x%x, ret %d",
215 __entry
->msgnumber
, __entry
->gpadl
, __entry
->ret
219 TRACE_EVENT(vmbus_teardown_gpadl
,
220 TP_PROTO(const struct vmbus_channel_gpadl_teardown
*msg
, int ret
),
223 __field(u32
, child_relid
)
228 __entry
->child_relid
= msg
->child_relid
;
229 __entry
->gpadl
= msg
->gpadl
;
232 TP_printk("sending child_relid 0x%x, gpadl 0x%x, ret %d",
233 __entry
->child_relid
, __entry
->gpadl
, __entry
->ret
237 TRACE_EVENT(vmbus_negotiate_version
,
238 TP_PROTO(const struct vmbus_channel_initiate_contact
*msg
, int ret
),
242 __field(u32
, target_vcpu
)
244 __field(u64
, int_page
)
245 __field(u64
, mon_page1
)
246 __field(u64
, mon_page2
)
249 __entry
->ver
= msg
->vmbus_version_requested
;
250 __entry
->target_vcpu
= msg
->target_vcpu
;
251 __entry
->int_page
= msg
->interrupt_page
;
252 __entry
->mon_page1
= msg
->monitor_page1
;
253 __entry
->mon_page2
= msg
->monitor_page2
;
256 TP_printk("sending vmbus_version_requested %d, target_vcpu 0x%x, "
257 "pages %llx:%llx:%llx, ret %d",
258 __entry
->ver
, __entry
->target_vcpu
, __entry
->int_page
,
259 __entry
->mon_page1
, __entry
->mon_page2
, __entry
->ret
263 TRACE_EVENT(vmbus_release_relid
,
264 TP_PROTO(const struct vmbus_channel_relid_released
*msg
, int ret
),
267 __field(u32
, child_relid
)
271 __entry
->child_relid
= msg
->child_relid
;
274 TP_printk("sending child_relid 0x%x, ret %d",
275 __entry
->child_relid
, __entry
->ret
279 TRACE_EVENT(vmbus_send_tl_connect_request
,
280 TP_PROTO(const struct vmbus_channel_tl_connect_request
*msg
,
284 __array(char, guest_id
, 16)
285 __array(char, host_id
, 16)
289 memcpy(__entry
->guest_id
, &msg
->guest_endpoint_id
.b
, 16);
290 memcpy(__entry
->host_id
, &msg
->host_service_id
.b
, 16);
293 TP_printk("sending guest_endpoint_id %pUl, host_service_id %pUl, "
295 __entry
->guest_id
, __entry
->host_id
, __entry
->ret
299 DECLARE_EVENT_CLASS(vmbus_channel
,
300 TP_PROTO(const struct vmbus_channel
*channel
),
302 TP_STRUCT__entry(__field(u32
, relid
)),
303 TP_fast_assign(__entry
->relid
= channel
->offermsg
.child_relid
),
304 TP_printk("relid 0x%x", __entry
->relid
)
307 DEFINE_EVENT(vmbus_channel
, vmbus_chan_sched
,
308 TP_PROTO(const struct vmbus_channel
*channel
),
312 DEFINE_EVENT(vmbus_channel
, vmbus_setevent
,
313 TP_PROTO(const struct vmbus_channel
*channel
),
317 DEFINE_EVENT(vmbus_channel
, vmbus_on_event
,
318 TP_PROTO(const struct vmbus_channel
*channel
),
322 #undef TRACE_INCLUDE_PATH
323 #define TRACE_INCLUDE_PATH .
324 #undef TRACE_INCLUDE_FILE
325 #define TRACE_INCLUDE_FILE hv_trace
326 #endif /* _HV_TRACE_H */
328 /* This part must be outside protection */
329 #include <trace/define_trace.h>