blob: 62fb30598d47758b9caed258118b45af2a245e7d [file] [log] [blame]
Nishad Kamdardbaf1002019-12-25 17:50:58 +05301/* SPDX-License-Identifier: GPL-2.0 */
2/* Tracepoints for vfio_ccw driver
Halil Pasic3cd90212018-05-23 04:56:45 +02003 *
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 Farman7af52cc2019-10-16 16:20:37 +020010#include "cio.h"
11
Halil Pasic3cd90212018-05-23 04:56:45 +020012#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 Farmanb2dd9a42020-05-05 14:27:45 +020020TRACE_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 Farmand5950b02019-10-16 16:20:39 +020050TRACE_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 Farman970ebeb2019-10-16 16:20:38 +020080TRACE_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 Farman85298882019-10-16 16:20:40 +0200106TRACE_EVENT(vfio_ccw_fsm_io_request,
Halil Pasic3cd90212018-05-23 04:56:45 +0200107 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 Farman85298882019-10-16 16:20:40 +0200111 __field(u8, cssid)
112 __field(u8, ssid)
113 __field(u16, sch_no)
Halil Pasic3cd90212018-05-23 04:56:45 +0200114 __field(int, fctl)
Halil Pasic3cd90212018-05-23 04:56:45 +0200115 __field(int, errno)
116 __field(char*, errstr)
117 ),
118
119 TP_fast_assign(
Eric Farman85298882019-10-16 16:20:40 +0200120 __entry->cssid = schid.cssid;
121 __entry->ssid = schid.ssid;
122 __entry->sch_no = schid.sch_no;
Halil Pasic3cd90212018-05-23 04:56:45 +0200123 __entry->fctl = fctl;
Halil Pasic3cd90212018-05-23 04:56:45 +0200124 __entry->errno = errno;
125 __entry->errstr = errstr;
126 ),
127
Eric Farman85298882019-10-16 16:20:40 +0200128 TP_printk("schid=%x.%x.%04x fctl=0x%x errno=%d info=%s",
129 __entry->cssid,
130 __entry->ssid,
131 __entry->sch_no,
Halil Pasic3cd90212018-05-23 04:56:45 +0200132 __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>