1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Tracepoint header for the s390 Common I/O layer (CIO)
5 * Copyright IBM Corp. 2015
6 * Author(s): Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
9 #include <linux/kernel.h>
11 #include <uapi/asm/chpid.h>
12 #include <uapi/asm/schid.h>
17 #define TRACE_SYSTEM s390
19 #if !defined(_TRACE_S390_CIO_H) || defined(TRACE_HEADER_MULTI_READ)
20 #define _TRACE_S390_CIO_H
22 #include <linux/tracepoint.h>
24 DECLARE_EVENT_CLASS(s390_class_schib
,
25 TP_PROTO(struct subchannel_id schid
, struct schib
*schib
, int cc
),
26 TP_ARGS(schid
, schib
, cc
),
32 __field_struct(struct schib
, schib
)
36 __entry
->cssid
= schid
.cssid
;
37 __entry
->ssid
= schid
.ssid
;
38 __entry
->schno
= schid
.sch_no
;
39 __entry
->devno
= schib
->pmcw
.dev
;
40 __entry
->schib
= *schib
;
43 TP_printk("schid=%x.%x.%04x cc=%d ena=%d st=%d dnv=%d dev=%04x "
44 "lpm=0x%02x pnom=0x%02x lpum=0x%02x pim=0x%02x pam=0x%02x "
45 "pom=0x%02x chpids=%016llx",
46 __entry
->cssid
, __entry
->ssid
, __entry
->schno
, __entry
->cc
,
47 __entry
->schib
.pmcw
.ena
, __entry
->schib
.pmcw
.st
,
48 __entry
->schib
.pmcw
.dnv
, __entry
->schib
.pmcw
.dev
,
49 __entry
->schib
.pmcw
.lpm
, __entry
->schib
.pmcw
.pnom
,
50 __entry
->schib
.pmcw
.lpum
, __entry
->schib
.pmcw
.pim
,
51 __entry
->schib
.pmcw
.pam
, __entry
->schib
.pmcw
.pom
,
52 *((u64
*) __entry
->schib
.pmcw
.chpid
)
57 * s390_cio_stsch - Store Subchannel instruction (STSCH) was performed
58 * @schid: Subchannel ID
59 * @schib: Subchannel-Information block
62 DEFINE_EVENT(s390_class_schib
, s390_cio_stsch
,
63 TP_PROTO(struct subchannel_id schid
, struct schib
*schib
, int cc
),
64 TP_ARGS(schid
, schib
, cc
)
68 * s390_cio_msch - Modify Subchannel instruction (MSCH) was performed
69 * @schid: Subchannel ID
70 * @schib: Subchannel-Information block
73 DEFINE_EVENT(s390_class_schib
, s390_cio_msch
,
74 TP_PROTO(struct subchannel_id schid
, struct schib
*schib
, int cc
),
75 TP_ARGS(schid
, schib
, cc
)
79 * s390_cio_tsch - Test Subchannel instruction (TSCH) was performed
80 * @schid: Subchannel ID
81 * @irb: Interruption-Response Block
84 TRACE_EVENT(s390_cio_tsch
,
85 TP_PROTO(struct subchannel_id schid
, struct irb
*irb
, int cc
),
86 TP_ARGS(schid
, irb
, cc
),
91 __field_struct(struct irb
, irb
)
95 __entry
->cssid
= schid
.cssid
;
96 __entry
->ssid
= schid
.ssid
;
97 __entry
->schno
= schid
.sch_no
;
101 TP_printk("schid=%x.%x.%04x cc=%d dcc=%d pno=%d fctl=0x%x actl=0x%x "
102 "stctl=0x%x dstat=0x%x cstat=0x%x",
103 __entry
->cssid
, __entry
->ssid
, __entry
->schno
, __entry
->cc
,
104 scsw_cc(&__entry
->irb
.scsw
), scsw_pno(&__entry
->irb
.scsw
),
105 scsw_fctl(&__entry
->irb
.scsw
), scsw_actl(&__entry
->irb
.scsw
),
106 scsw_stctl(&__entry
->irb
.scsw
),
107 scsw_dstat(&__entry
->irb
.scsw
), scsw_cstat(&__entry
->irb
.scsw
)
112 * s390_cio_tpi - Test Pending Interruption instruction (TPI) was performed
113 * @addr: Address of the I/O interruption code or %NULL
114 * @cc: Condition code
116 TRACE_EVENT(s390_cio_tpi
,
117 TP_PROTO(struct tpi_info
*addr
, int cc
),
121 __field_struct(struct tpi_info
, tpi_info
)
129 memset(&__entry
->tpi_info
, 0, sizeof(struct tpi_info
));
131 __entry
->tpi_info
= *addr
;
133 memcpy(&__entry
->tpi_info
, &S390_lowcore
.subchannel_id
,
134 sizeof(struct tpi_info
));
136 __entry
->cssid
= __entry
->tpi_info
.schid
.cssid
;
137 __entry
->ssid
= __entry
->tpi_info
.schid
.ssid
;
138 __entry
->schno
= __entry
->tpi_info
.schid
.sch_no
;
140 TP_printk("schid=%x.%x.%04x cc=%d a=%d isc=%d type=%d",
141 __entry
->cssid
, __entry
->ssid
, __entry
->schno
, __entry
->cc
,
142 __entry
->tpi_info
.adapter_IO
, __entry
->tpi_info
.isc
,
143 __entry
->tpi_info
.type
148 * s390_cio_ssch - Start Subchannel instruction (SSCH) was performed
149 * @schid: Subchannel ID
150 * @orb: Operation-Request Block
151 * @cc: Condition code
153 TRACE_EVENT(s390_cio_ssch
,
154 TP_PROTO(struct subchannel_id schid
, union orb
*orb
, int cc
),
155 TP_ARGS(schid
, orb
, cc
),
160 __field_struct(union orb
, orb
)
164 __entry
->cssid
= schid
.cssid
;
165 __entry
->ssid
= schid
.ssid
;
166 __entry
->schno
= schid
.sch_no
;
170 TP_printk("schid=%x.%x.%04x cc=%d", __entry
->cssid
, __entry
->ssid
,
171 __entry
->schno
, __entry
->cc
175 DECLARE_EVENT_CLASS(s390_class_schid
,
176 TP_PROTO(struct subchannel_id schid
, int cc
),
185 __entry
->cssid
= schid
.cssid
;
186 __entry
->ssid
= schid
.ssid
;
187 __entry
->schno
= schid
.sch_no
;
190 TP_printk("schid=%x.%x.%04x cc=%d", __entry
->cssid
, __entry
->ssid
,
191 __entry
->schno
, __entry
->cc
196 * s390_cio_csch - Clear Subchannel instruction (CSCH) was performed
197 * @schid: Subchannel ID
198 * @cc: Condition code
200 DEFINE_EVENT(s390_class_schid
, s390_cio_csch
,
201 TP_PROTO(struct subchannel_id schid
, int cc
),
206 * s390_cio_hsch - Halt Subchannel instruction (HSCH) was performed
207 * @schid: Subchannel ID
208 * @cc: Condition code
210 DEFINE_EVENT(s390_class_schid
, s390_cio_hsch
,
211 TP_PROTO(struct subchannel_id schid
, int cc
),
216 * s390_cio_xsch - Cancel Subchannel instruction (XSCH) was performed
217 * @schid: Subchannel ID
218 * @cc: Condition code
220 DEFINE_EVENT(s390_class_schid
, s390_cio_xsch
,
221 TP_PROTO(struct subchannel_id schid
, int cc
),
226 * s390_cio_rsch - Resume Subchannel instruction (RSCH) was performed
227 * @schid: Subchannel ID
228 * @cc: Condition code
230 DEFINE_EVENT(s390_class_schid
, s390_cio_rsch
,
231 TP_PROTO(struct subchannel_id schid
, int cc
),
236 * s390_cio_rchp - Reset Channel Path (RCHP) instruction was performed
237 * @chpid: Channel-Path Identifier
238 * @cc: Condition code
240 TRACE_EVENT(s390_cio_rchp
,
241 TP_PROTO(struct chp_id chpid
, int cc
),
249 __entry
->cssid
= chpid
.cssid
;
250 __entry
->id
= chpid
.id
;
253 TP_printk("chpid=%x.%02x cc=%d", __entry
->cssid
, __entry
->id
,
258 #define CHSC_MAX_REQUEST_LEN 64
259 #define CHSC_MAX_RESPONSE_LEN 64
262 * s390_cio_chsc - Channel Subsystem Call (CHSC) instruction was performed
264 * @cc: Condition code
266 TRACE_EVENT(s390_cio_chsc
,
267 TP_PROTO(struct chsc_header
*chsc
, int cc
),
273 __array(u8
, request
, CHSC_MAX_REQUEST_LEN
)
274 __array(u8
, response
, CHSC_MAX_RESPONSE_LEN
)
278 __entry
->code
= chsc
->code
;
279 memcpy(&entry
->request
, chsc
,
280 min_t(u16
, chsc
->length
, CHSC_MAX_REQUEST_LEN
));
281 chsc
= (struct chsc_header
*) ((char *) chsc
+ chsc
->length
);
282 __entry
->rcode
= chsc
->code
;
283 memcpy(&entry
->response
, chsc
,
284 min_t(u16
, chsc
->length
, CHSC_MAX_RESPONSE_LEN
));
286 TP_printk("code=0x%04x cc=%d rcode=0x%04x", __entry
->code
,
287 __entry
->cc
, __entry
->rcode
)
291 * s390_cio_interrupt - An I/O interrupt occurred
292 * @tpi_info: Address of the I/O interruption code
294 TRACE_EVENT(s390_cio_interrupt
,
295 TP_PROTO(struct tpi_info
*tpi_info
),
298 __field_struct(struct tpi_info
, tpi_info
)
304 __entry
->tpi_info
= *tpi_info
;
305 __entry
->cssid
= __entry
->tpi_info
.schid
.cssid
;
306 __entry
->ssid
= __entry
->tpi_info
.schid
.ssid
;
307 __entry
->schno
= __entry
->tpi_info
.schid
.sch_no
;
309 TP_printk("schid=%x.%x.%04x isc=%d type=%d",
310 __entry
->cssid
, __entry
->ssid
, __entry
->schno
,
311 __entry
->tpi_info
.isc
, __entry
->tpi_info
.type
316 * s390_cio_adapter_int - An adapter interrupt occurred
317 * @tpi_info: Address of the I/O interruption code
319 TRACE_EVENT(s390_cio_adapter_int
,
320 TP_PROTO(struct tpi_info
*tpi_info
),
323 __field_struct(struct tpi_info
, tpi_info
)
326 __entry
->tpi_info
= *tpi_info
;
328 TP_printk("isc=%d", __entry
->tpi_info
.isc
)
332 * s390_cio_stcrw - Store Channel Report Word (STCRW) was performed
333 * @crw: Channel Report Word
334 * @cc: Condition code
336 TRACE_EVENT(s390_cio_stcrw
,
337 TP_PROTO(struct crw
*crw
, int cc
),
340 __field_struct(struct crw
, crw
)
347 TP_printk("cc=%d slct=%d oflw=%d chn=%d rsc=%d anc=%d erc=0x%x "
349 __entry
->cc
, __entry
->crw
.slct
, __entry
->crw
.oflw
,
350 __entry
->crw
.chn
, __entry
->crw
.rsc
, __entry
->crw
.anc
,
351 __entry
->crw
.erc
, __entry
->crw
.rsid
355 #endif /* _TRACE_S390_CIO_H */
357 /* This part must be outside protection */
358 #undef TRACE_INCLUDE_PATH
359 #define TRACE_INCLUDE_PATH .
361 #undef TRACE_INCLUDE_FILE
362 #define TRACE_INCLUDE_FILE trace
364 #include <trace/define_trace.h>