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 export_guid(__entry->if_type, &offer->offer.if_type);
48 export_guid(__entry->if_instance, &offer->offer.if_instance);
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;
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,
64 TRACE_EVENT(vmbus_onoffer_rescind,
65 TP_PROTO(const struct vmbus_channel_rescind_offer *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)
72 TRACE_EVENT(vmbus_onopen_result,
73 TP_PROTO(const struct vmbus_channel_open_result *result),
76 __field(u32, child_relid)
80 TP_fast_assign(__entry->child_relid = result->child_relid;
81 __entry->openid = result->openid;
82 __entry->status = result->status;
84 TP_printk("child_relid 0x%x, openid %d, status %d",
85 __entry->child_relid, __entry->openid, __entry->status
89 TRACE_EVENT(vmbus_ongpadl_created,
90 TP_PROTO(const struct vmbus_channel_gpadl_created *gpadlcreated),
91 TP_ARGS(gpadlcreated),
93 __field(u32, child_relid)
97 TP_fast_assign(__entry->child_relid = gpadlcreated->child_relid;
98 __entry->gpadl = gpadlcreated->gpadl;
99 __entry->status = gpadlcreated->creation_status;
101 TP_printk("child_relid 0x%x, gpadl 0x%x, creation_status %d",
102 __entry->child_relid, __entry->gpadl, __entry->status
106 TRACE_EVENT(vmbus_ongpadl_torndown,
107 TP_PROTO(const struct vmbus_channel_gpadl_torndown *gpadltorndown),
108 TP_ARGS(gpadltorndown),
109 TP_STRUCT__entry(__field(u32, gpadl)),
110 TP_fast_assign(__entry->gpadl = gpadltorndown->gpadl),
111 TP_printk("gpadl 0x%x", __entry->gpadl)
114 TRACE_EVENT(vmbus_onversion_response,
115 TP_PROTO(const struct vmbus_channel_version_response *response),
120 TP_fast_assign(__entry->ver = response->version_supported;
122 TP_printk("version_supported %d", __entry->ver)
125 TRACE_EVENT(vmbus_request_offers,
128 TP_STRUCT__entry(__field(int, ret)),
129 TP_fast_assign(__entry->ret = ret),
130 TP_printk("sending ret %d", __entry->ret)
133 TRACE_EVENT(vmbus_open,
134 TP_PROTO(const struct vmbus_channel_open_channel *msg, int ret),
137 __field(u32, child_relid)
139 __field(u32, gpadlhandle)
140 __field(u32, target_vp)
145 __entry->child_relid = msg->child_relid;
146 __entry->openid = msg->openid;
147 __entry->gpadlhandle = msg->ringbuffer_gpadlhandle;
148 __entry->target_vp = msg->target_vp;
149 __entry->offset = msg->downstream_ringbuffer_pageoffset;
152 TP_printk("sending child_relid 0x%x, openid %d, "
153 "gpadlhandle 0x%x, target_vp 0x%x, offset 0x%x, ret %d",
154 __entry->child_relid, __entry->openid,
155 __entry->gpadlhandle, __entry->target_vp,
156 __entry->offset, __entry->ret
160 TRACE_EVENT(vmbus_close_internal,
161 TP_PROTO(const struct vmbus_channel_close_channel *msg, int ret),
164 __field(u32, child_relid)
168 __entry->child_relid = msg->child_relid;
171 TP_printk("sending child_relid 0x%x, ret %d", __entry->child_relid,
175 TRACE_EVENT(vmbus_establish_gpadl_header,
176 TP_PROTO(const struct vmbus_channel_gpadl_header *msg, int ret),
179 __field(u32, child_relid)
181 __field(u16, range_buflen)
182 __field(u16, rangecount)
186 __entry->child_relid = msg->child_relid;
187 __entry->gpadl = msg->gpadl;
188 __entry->range_buflen = msg->range_buflen;
189 __entry->rangecount = msg->rangecount;
192 TP_printk("sending child_relid 0x%x, gpadl 0x%x, range_buflen %d "
193 "rangecount %d, ret %d",
194 __entry->child_relid, __entry->gpadl,
195 __entry->range_buflen, __entry->rangecount, __entry->ret
199 TRACE_EVENT(vmbus_establish_gpadl_body,
200 TP_PROTO(const struct vmbus_channel_gpadl_body *msg, int ret),
203 __field(u32, msgnumber)
208 __entry->msgnumber = msg->msgnumber;
209 __entry->gpadl = msg->gpadl;
212 TP_printk("sending msgnumber %d, gpadl 0x%x, ret %d",
213 __entry->msgnumber, __entry->gpadl, __entry->ret
217 TRACE_EVENT(vmbus_teardown_gpadl,
218 TP_PROTO(const struct vmbus_channel_gpadl_teardown *msg, int ret),
221 __field(u32, child_relid)
226 __entry->child_relid = msg->child_relid;
227 __entry->gpadl = msg->gpadl;
230 TP_printk("sending child_relid 0x%x, gpadl 0x%x, ret %d",
231 __entry->child_relid, __entry->gpadl, __entry->ret
235 TRACE_EVENT(vmbus_negotiate_version,
236 TP_PROTO(const struct vmbus_channel_initiate_contact *msg, int ret),
240 __field(u32, target_vcpu)
242 __field(u64, int_page)
243 __field(u64, mon_page1)
244 __field(u64, mon_page2)
247 __entry->ver = msg->vmbus_version_requested;
248 __entry->target_vcpu = msg->target_vcpu;
249 __entry->int_page = msg->interrupt_page;
250 __entry->mon_page1 = msg->monitor_page1;
251 __entry->mon_page2 = msg->monitor_page2;
254 TP_printk("sending vmbus_version_requested %d, target_vcpu 0x%x, "
255 "pages %llx:%llx:%llx, ret %d",
256 __entry->ver, __entry->target_vcpu, __entry->int_page,
257 __entry->mon_page1, __entry->mon_page2, __entry->ret
261 TRACE_EVENT(vmbus_release_relid,
262 TP_PROTO(const struct vmbus_channel_relid_released *msg, int ret),
265 __field(u32, child_relid)
269 __entry->child_relid = msg->child_relid;
272 TP_printk("sending child_relid 0x%x, ret %d",
273 __entry->child_relid, __entry->ret
277 TRACE_EVENT(vmbus_send_tl_connect_request,
278 TP_PROTO(const struct vmbus_channel_tl_connect_request *msg,
282 __array(char, guest_id, 16)
283 __array(char, host_id, 16)
287 export_guid(__entry->guest_id, &msg->guest_endpoint_id);
288 export_guid(__entry->host_id, &msg->host_service_id);
291 TP_printk("sending guest_endpoint_id %pUl, host_service_id %pUl, "
293 __entry->guest_id, __entry->host_id, __entry->ret
297 TRACE_EVENT(vmbus_send_modifychannel,
298 TP_PROTO(const struct vmbus_channel_modifychannel *msg,
302 __field(u32, child_relid)
303 __field(u32, target_vp)
307 __entry->child_relid = msg->child_relid;
308 __entry->target_vp = msg->target_vp;
311 TP_printk("binding child_relid 0x%x to target_vp 0x%x, ret %d",
312 __entry->child_relid, __entry->target_vp, __entry->ret
316 DECLARE_EVENT_CLASS(vmbus_channel,
317 TP_PROTO(const struct vmbus_channel *channel),
319 TP_STRUCT__entry(__field(u32, relid)),
320 TP_fast_assign(__entry->relid = channel->offermsg.child_relid),
321 TP_printk("relid 0x%x", __entry->relid)
324 DEFINE_EVENT(vmbus_channel, vmbus_chan_sched,
325 TP_PROTO(const struct vmbus_channel *channel),
329 DEFINE_EVENT(vmbus_channel, vmbus_setevent,
330 TP_PROTO(const struct vmbus_channel *channel),
334 DEFINE_EVENT(vmbus_channel, vmbus_on_event,
335 TP_PROTO(const struct vmbus_channel *channel),
339 #undef TRACE_INCLUDE_PATH
340 #define TRACE_INCLUDE_PATH .
341 #undef TRACE_INCLUDE_FILE
342 #define TRACE_INCLUDE_FILE hv_trace
343 #endif /* _HV_TRACE_H */
345 /* This part must be outside protection */
346 #include <trace/define_trace.h>