Vitaly Kuznetsov | c9fe0f8 | 2017-10-29 12:21:00 -0700 | [diff] [blame] | 1 | #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 | |
| 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=%u", __entry->msgtype) |
| 15 | ); |
| 16 | |
| 17 | DEFINE_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 Kuznetsov | 716fa52 | 2017-10-29 12:21:01 -0700 | [diff] [blame] | 22 | DEFINE_EVENT(vmbus_hdr_msg, vmbus_on_message, |
| 23 | TP_PROTO(const struct vmbus_channel_message_header *hdr), |
| 24 | TP_ARGS(hdr) |
| 25 | ); |
| 26 | |
Vitaly Kuznetsov | 03b81e6 | 2017-10-29 12:21:02 -0700 | [diff] [blame] | 27 | TRACE_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 Kuznetsov | 5175167 | 2017-10-29 12:21:03 -0700 | [diff] [blame] | 64 | TRACE_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 Kuznetsov | 9f23ce1 | 2017-10-29 12:21:04 -0700 | [diff] [blame] | 72 | TRACE_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 Kuznetsov | a13bf0e | 2017-10-29 12:21:05 -0700 | [diff] [blame] | 89 | TRACE_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 Kuznetsov | 602a8c5 | 2017-10-29 12:21:06 -0700 | [diff] [blame] | 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) |
| 112 | ); |
| 113 | |
Vitaly Kuznetsov | c7924fb | 2017-10-29 12:21:07 -0700 | [diff] [blame] | 114 | TRACE_EVENT(vmbus_onversion_response, |
| 115 | TP_PROTO(const struct vmbus_channel_version_response *response), |
| 116 | TP_ARGS(response), |
| 117 | TP_STRUCT__entry( |
| 118 | __field(u8, ver) |
| 119 | ), |
| 120 | TP_fast_assign(__entry->ver = response->version_supported; |
| 121 | ), |
| 122 | TP_printk("version_supported %d", __entry->ver) |
| 123 | ); |
| 124 | |
Vitaly Kuznetsov | d6706e6 | 2017-10-29 12:21:08 -0700 | [diff] [blame] | 125 | TRACE_EVENT(vmbus_request_offers, |
| 126 | TP_PROTO(int ret), |
| 127 | TP_ARGS(ret), |
| 128 | TP_STRUCT__entry(__field(int, ret)), |
| 129 | TP_fast_assign(__entry->ret = ret), |
| 130 | TP_printk("sending ret %d", __entry->ret) |
| 131 | ); |
| 132 | |
Vitaly Kuznetsov | 9202d77 | 2017-10-29 12:21:09 -0700 | [diff] [blame] | 133 | TRACE_EVENT(vmbus_open, |
| 134 | TP_PROTO(const struct vmbus_channel_open_channel *msg, int ret), |
| 135 | TP_ARGS(msg, ret), |
| 136 | TP_STRUCT__entry( |
| 137 | __field(u32, child_relid) |
| 138 | __field(u32, openid) |
| 139 | __field(u32, gpadlhandle) |
| 140 | __field(u32, target_vp) |
| 141 | __field(u32, offset) |
| 142 | __field(int, ret) |
| 143 | ), |
| 144 | TP_fast_assign( |
| 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; |
| 150 | __entry->ret = ret; |
| 151 | ), |
| 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 |
| 157 | ) |
| 158 | ); |
| 159 | |
Vitaly Kuznetsov | 633b005 | 2017-10-29 12:21:10 -0700 | [diff] [blame] | 160 | TRACE_EVENT(vmbus_close_internal, |
| 161 | TP_PROTO(const struct vmbus_channel_close_channel *msg, int ret), |
| 162 | TP_ARGS(msg, ret), |
| 163 | TP_STRUCT__entry( |
| 164 | __field(u32, child_relid) |
| 165 | __field(int, ret) |
| 166 | ), |
| 167 | TP_fast_assign( |
| 168 | __entry->child_relid = msg->child_relid; |
| 169 | __entry->ret = ret; |
| 170 | ), |
| 171 | TP_printk("sending child_relid 0x%x, ret %d", __entry->child_relid, |
| 172 | __entry->ret) |
| 173 | ); |
| 174 | |
Vitaly Kuznetsov | 69edbd5 | 2017-10-29 12:21:11 -0700 | [diff] [blame] | 175 | TRACE_EVENT(vmbus_establish_gpadl_header, |
| 176 | TP_PROTO(const struct vmbus_channel_gpadl_header *msg, int ret), |
| 177 | TP_ARGS(msg, ret), |
| 178 | TP_STRUCT__entry( |
| 179 | __field(u32, child_relid) |
| 180 | __field(u32, gpadl) |
| 181 | __field(u16, range_buflen) |
| 182 | __field(u16, rangecount) |
| 183 | __field(int, ret) |
| 184 | ), |
| 185 | TP_fast_assign( |
| 186 | __entry->child_relid = msg->child_relid; |
| 187 | __entry->gpadl = msg->gpadl; |
| 188 | __entry->range_buflen = msg->range_buflen; |
| 189 | __entry->rangecount = msg->rangecount; |
| 190 | __entry->ret = ret; |
| 191 | ), |
| 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 |
| 196 | ) |
| 197 | ); |
| 198 | |
| 199 | TRACE_EVENT(vmbus_establish_gpadl_body, |
| 200 | TP_PROTO(const struct vmbus_channel_gpadl_body *msg, int ret), |
| 201 | TP_ARGS(msg, ret), |
| 202 | TP_STRUCT__entry( |
| 203 | __field(u32, msgnumber) |
| 204 | __field(u32, gpadl) |
| 205 | __field(int, ret) |
| 206 | ), |
| 207 | TP_fast_assign( |
| 208 | __entry->msgnumber = msg->msgnumber; |
| 209 | __entry->gpadl = msg->gpadl; |
| 210 | __entry->ret = ret; |
| 211 | ), |
| 212 | TP_printk("sending msgnumber %d, gpadl 0x%x, ret %d", |
| 213 | __entry->msgnumber, __entry->gpadl, __entry->ret |
| 214 | ) |
| 215 | ); |
| 216 | |
Vitaly Kuznetsov | 09cdf8f | 2017-10-29 12:21:12 -0700 | [diff] [blame] | 217 | TRACE_EVENT(vmbus_teardown_gpadl, |
| 218 | TP_PROTO(const struct vmbus_channel_gpadl_teardown *msg, int ret), |
| 219 | TP_ARGS(msg, ret), |
| 220 | TP_STRUCT__entry( |
| 221 | __field(u32, child_relid) |
| 222 | __field(u32, gpadl) |
| 223 | __field(int, ret) |
| 224 | ), |
| 225 | TP_fast_assign( |
| 226 | __entry->child_relid = msg->child_relid; |
| 227 | __entry->gpadl = msg->gpadl; |
| 228 | __entry->ret = ret; |
| 229 | ), |
| 230 | TP_printk("sending child_relid 0x%x, gpadl 0x%x, ret %d", |
| 231 | __entry->child_relid, __entry->gpadl, __entry->ret |
| 232 | ) |
| 233 | ); |
| 234 | |
Vitaly Kuznetsov | 034ebf5 | 2017-10-29 12:21:13 -0700 | [diff] [blame] | 235 | TRACE_EVENT(vmbus_negotiate_version, |
| 236 | TP_PROTO(const struct vmbus_channel_initiate_contact *msg, int ret), |
| 237 | TP_ARGS(msg, ret), |
| 238 | TP_STRUCT__entry( |
| 239 | __field(u32, ver) |
| 240 | __field(u32, target_vcpu) |
| 241 | __field(int, ret) |
| 242 | __field(u64, int_page) |
| 243 | __field(u64, mon_page1) |
| 244 | __field(u64, mon_page2) |
| 245 | ), |
| 246 | TP_fast_assign( |
| 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; |
| 252 | __entry->ret = ret; |
| 253 | ), |
| 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 |
| 258 | ) |
| 259 | ); |
| 260 | |
Vitaly Kuznetsov | 259cc66 | 2017-10-29 12:21:14 -0700 | [diff] [blame^] | 261 | TRACE_EVENT(vmbus_release_relid, |
| 262 | TP_PROTO(const struct vmbus_channel_relid_released *msg, int ret), |
| 263 | TP_ARGS(msg, ret), |
| 264 | TP_STRUCT__entry( |
| 265 | __field(u32, child_relid) |
| 266 | __field(int, ret) |
| 267 | ), |
| 268 | TP_fast_assign( |
| 269 | __entry->child_relid = msg->child_relid; |
| 270 | __entry->ret = ret; |
| 271 | ), |
| 272 | TP_printk("sending child_relid 0x%x, ret %d", |
| 273 | __entry->child_relid, __entry->ret |
| 274 | ) |
| 275 | ); |
| 276 | |
Vitaly Kuznetsov | c9fe0f8 | 2017-10-29 12:21:00 -0700 | [diff] [blame] | 277 | #undef TRACE_INCLUDE_PATH |
| 278 | #define TRACE_INCLUDE_PATH . |
| 279 | #undef TRACE_INCLUDE_FILE |
| 280 | #define TRACE_INCLUDE_FILE hv_trace |
| 281 | #endif /* _HV_TRACE_H */ |
| 282 | |
| 283 | /* This part must be outside protection */ |
| 284 | #include <trace/define_trace.h> |