1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Tracepoints for vfio_ccw driver
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 
10 #include "cio.h"
11 
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 
20 TRACE_EVENT(vfio_ccw_fsm_async_request,
21 	TP_PROTO(struct subchannel_id schid,
22 		 int command,
23 		 int errno),
24 	TP_ARGS(schid, command, errno),
25 
26 	TP_STRUCT__entry(
27 		__field(u8, cssid)
28 		__field(u8, ssid)
29 		__field(u16, sch_no)
30 		__field(int, command)
31 		__field(int, errno)
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->command = command;
39 		__entry->errno = errno;
40 	),
41 
42 	TP_printk("schid=%x.%x.%04x command=0x%x errno=%d",
43 		  __entry->cssid,
44 		  __entry->ssid,
45 		  __entry->sch_no,
46 		  __entry->command,
47 		  __entry->errno)
48 );
49 
50 TRACE_EVENT(vfio_ccw_fsm_event,
51 	TP_PROTO(struct subchannel_id schid, int state, int event),
52 	TP_ARGS(schid, state, event),
53 
54 	TP_STRUCT__entry(
55 		__field(u8, cssid)
56 		__field(u8, ssid)
57 		__field(u16, schno)
58 		__field(int, state)
59 		__field(int, event)
60 	),
61 
62 	TP_fast_assign(
63 		__entry->cssid = schid.cssid;
64 		__entry->ssid = schid.ssid;
65 		__entry->schno = schid.sch_no;
66 		__entry->state = state;
67 		__entry->event = event;
68 	),
69 
70 	TP_printk("schid=%x.%x.%04x state=%d event=%d",
71 		__entry->cssid, __entry->ssid, __entry->schno,
72 		__entry->state,
73 		__entry->event)
74 );
75 
76 TRACE_EVENT(vfio_ccw_fsm_io_request,
77 	TP_PROTO(int fctl, struct subchannel_id schid, int errno, char *errstr),
78 	TP_ARGS(fctl, schid, errno, errstr),
79 
80 	TP_STRUCT__entry(
81 		__field(u8, cssid)
82 		__field(u8, ssid)
83 		__field(u16, sch_no)
84 		__field(int, fctl)
85 		__field(int, errno)
86 		__field(char*, errstr)
87 	),
88 
89 	TP_fast_assign(
90 		__entry->cssid = schid.cssid;
91 		__entry->ssid = schid.ssid;
92 		__entry->sch_no = schid.sch_no;
93 		__entry->fctl = fctl;
94 		__entry->errno = errno;
95 		__entry->errstr = errstr;
96 	),
97 
98 	TP_printk("schid=%x.%x.%04x fctl=0x%x errno=%d info=%s",
99 		  __entry->cssid,
100 		  __entry->ssid,
101 		  __entry->sch_no,
102 		  __entry->fctl,
103 		  __entry->errno,
104 		  __entry->errstr)
105 );
106 
107 #endif /* _VFIO_CCW_TRACE_ */
108 
109 /* This part must be outside protection */
110 
111 #undef TRACE_INCLUDE_PATH
112 #define TRACE_INCLUDE_PATH .
113 #undef TRACE_INCLUDE_FILE
114 #define TRACE_INCLUDE_FILE vfio_ccw_trace
115 
116 #include <trace/define_trace.h>
117