Nishad Kamdar | dbaf100 | 2019-12-25 17:50:58 +0530 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* Tracepoints for vfio_ccw driver |
Halil Pasic | 3cd9021 | 2018-05-23 04:56:45 +0200 | [diff] [blame] | 3 | * |
| 4 | * Copyright IBM Corp. 2018 |
| 5 | * |
| 6 | * Author(s): Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com> |
| 7 | * Halil Pasic <pasic@linux.vnet.ibm.com> |
| 8 | */ |
| 9 | |
Eric Farman | 7af52cc | 2019-10-16 16:20:37 +0200 | [diff] [blame] | 10 | #include "cio.h" |
| 11 | |
Halil Pasic | 3cd9021 | 2018-05-23 04:56:45 +0200 | [diff] [blame] | 12 | #undef TRACE_SYSTEM |
| 13 | #define TRACE_SYSTEM vfio_ccw |
| 14 | |
| 15 | #if !defined(_VFIO_CCW_TRACE_) || defined(TRACE_HEADER_MULTI_READ) |
| 16 | #define _VFIO_CCW_TRACE_ |
| 17 | |
| 18 | #include <linux/tracepoint.h> |
| 19 | |
Eric Farman | b2dd9a4 | 2020-05-05 14:27:45 +0200 | [diff] [blame] | 20 | TRACE_EVENT(vfio_ccw_chp_event, |
| 21 | TP_PROTO(struct subchannel_id schid, |
| 22 | int mask, |
| 23 | int event), |
| 24 | TP_ARGS(schid, mask, event), |
| 25 | |
| 26 | TP_STRUCT__entry( |
| 27 | __field(u8, cssid) |
| 28 | __field(u8, ssid) |
| 29 | __field(u16, sch_no) |
| 30 | __field(int, mask) |
| 31 | __field(int, event) |
| 32 | ), |
| 33 | |
| 34 | TP_fast_assign( |
| 35 | __entry->cssid = schid.cssid; |
| 36 | __entry->ssid = schid.ssid; |
| 37 | __entry->sch_no = schid.sch_no; |
| 38 | __entry->mask = mask; |
| 39 | __entry->event = event; |
| 40 | ), |
| 41 | |
| 42 | TP_printk("schid=%x.%x.%04x mask=0x%x event=%d", |
| 43 | __entry->cssid, |
| 44 | __entry->ssid, |
| 45 | __entry->sch_no, |
| 46 | __entry->mask, |
| 47 | __entry->event) |
| 48 | ); |
| 49 | |
Eric Farman | d5950b0 | 2019-10-16 16:20:39 +0200 | [diff] [blame] | 50 | TRACE_EVENT(vfio_ccw_fsm_async_request, |
| 51 | TP_PROTO(struct subchannel_id schid, |
| 52 | int command, |
| 53 | int errno), |
| 54 | TP_ARGS(schid, command, errno), |
| 55 | |
| 56 | TP_STRUCT__entry( |
| 57 | __field(u8, cssid) |
| 58 | __field(u8, ssid) |
| 59 | __field(u16, sch_no) |
| 60 | __field(int, command) |
| 61 | __field(int, errno) |
| 62 | ), |
| 63 | |
| 64 | TP_fast_assign( |
| 65 | __entry->cssid = schid.cssid; |
| 66 | __entry->ssid = schid.ssid; |
| 67 | __entry->sch_no = schid.sch_no; |
| 68 | __entry->command = command; |
| 69 | __entry->errno = errno; |
| 70 | ), |
| 71 | |
| 72 | TP_printk("schid=%x.%x.%04x command=0x%x errno=%d", |
| 73 | __entry->cssid, |
| 74 | __entry->ssid, |
| 75 | __entry->sch_no, |
| 76 | __entry->command, |
| 77 | __entry->errno) |
| 78 | ); |
| 79 | |
Eric Farman | 970ebeb | 2019-10-16 16:20:38 +0200 | [diff] [blame] | 80 | TRACE_EVENT(vfio_ccw_fsm_event, |
| 81 | TP_PROTO(struct subchannel_id schid, int state, int event), |
| 82 | TP_ARGS(schid, state, event), |
| 83 | |
| 84 | TP_STRUCT__entry( |
| 85 | __field(u8, cssid) |
| 86 | __field(u8, ssid) |
| 87 | __field(u16, schno) |
| 88 | __field(int, state) |
| 89 | __field(int, event) |
| 90 | ), |
| 91 | |
| 92 | TP_fast_assign( |
| 93 | __entry->cssid = schid.cssid; |
| 94 | __entry->ssid = schid.ssid; |
| 95 | __entry->schno = schid.sch_no; |
| 96 | __entry->state = state; |
| 97 | __entry->event = event; |
| 98 | ), |
| 99 | |
| 100 | TP_printk("schid=%x.%x.%04x state=%d event=%d", |
| 101 | __entry->cssid, __entry->ssid, __entry->schno, |
| 102 | __entry->state, |
| 103 | __entry->event) |
| 104 | ); |
| 105 | |
Eric Farman | 8529888 | 2019-10-16 16:20:40 +0200 | [diff] [blame] | 106 | TRACE_EVENT(vfio_ccw_fsm_io_request, |
Halil Pasic | 3cd9021 | 2018-05-23 04:56:45 +0200 | [diff] [blame] | 107 | TP_PROTO(int fctl, struct subchannel_id schid, int errno, char *errstr), |
| 108 | TP_ARGS(fctl, schid, errno, errstr), |
| 109 | |
| 110 | TP_STRUCT__entry( |
Eric Farman | 8529888 | 2019-10-16 16:20:40 +0200 | [diff] [blame] | 111 | __field(u8, cssid) |
| 112 | __field(u8, ssid) |
| 113 | __field(u16, sch_no) |
Halil Pasic | 3cd9021 | 2018-05-23 04:56:45 +0200 | [diff] [blame] | 114 | __field(int, fctl) |
Halil Pasic | 3cd9021 | 2018-05-23 04:56:45 +0200 | [diff] [blame] | 115 | __field(int, errno) |
| 116 | __field(char*, errstr) |
| 117 | ), |
| 118 | |
| 119 | TP_fast_assign( |
Eric Farman | 8529888 | 2019-10-16 16:20:40 +0200 | [diff] [blame] | 120 | __entry->cssid = schid.cssid; |
| 121 | __entry->ssid = schid.ssid; |
| 122 | __entry->sch_no = schid.sch_no; |
Halil Pasic | 3cd9021 | 2018-05-23 04:56:45 +0200 | [diff] [blame] | 123 | __entry->fctl = fctl; |
Halil Pasic | 3cd9021 | 2018-05-23 04:56:45 +0200 | [diff] [blame] | 124 | __entry->errno = errno; |
| 125 | __entry->errstr = errstr; |
| 126 | ), |
| 127 | |
Eric Farman | 8529888 | 2019-10-16 16:20:40 +0200 | [diff] [blame] | 128 | TP_printk("schid=%x.%x.%04x fctl=0x%x errno=%d info=%s", |
| 129 | __entry->cssid, |
| 130 | __entry->ssid, |
| 131 | __entry->sch_no, |
Halil Pasic | 3cd9021 | 2018-05-23 04:56:45 +0200 | [diff] [blame] | 132 | __entry->fctl, |
| 133 | __entry->errno, |
| 134 | __entry->errstr) |
| 135 | ); |
| 136 | |
| 137 | #endif /* _VFIO_CCW_TRACE_ */ |
| 138 | |
| 139 | /* This part must be outside protection */ |
| 140 | |
| 141 | #undef TRACE_INCLUDE_PATH |
| 142 | #define TRACE_INCLUDE_PATH . |
| 143 | #undef TRACE_INCLUDE_FILE |
| 144 | #define TRACE_INCLUDE_FILE vfio_ccw_trace |
| 145 | |
| 146 | #include <trace/define_trace.h> |