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 __field(u16
, pmcw_dev
)
38 __field(u8
, pmcw_pnom
)
39 __field(u8
, pmcw_lpum
)
43 __field(u64
, pmcw_chpid
)
47 __entry
->cssid
= schid
.cssid
;
48 __entry
->ssid
= schid
.ssid
;
49 __entry
->schno
= schid
.sch_no
;
50 __entry
->devno
= schib
->pmcw
.dev
;
51 __entry
->schib
= *schib
;
52 __entry
->pmcw_ena
= schib
->pmcw
.ena
;
53 __entry
->pmcw_st
= schib
->pmcw
.ena
;
54 __entry
->pmcw_dnv
= schib
->pmcw
.dnv
;
55 __entry
->pmcw_dev
= schib
->pmcw
.dev
;
56 __entry
->pmcw_lpm
= schib
->pmcw
.lpm
;
57 __entry
->pmcw_pnom
= schib
->pmcw
.pnom
;
58 __entry
->pmcw_lpum
= schib
->pmcw
.lpum
;
59 __entry
->pmcw_pim
= schib
->pmcw
.pim
;
60 __entry
->pmcw_pam
= schib
->pmcw
.pam
;
61 __entry
->pmcw_pom
= schib
->pmcw
.pom
;
62 memcpy(&__entry
->pmcw_chpid
, &schib
->pmcw
.chpid
, 8);
65 TP_printk("schid=%x.%x.%04x cc=%d ena=%d st=%d dnv=%d dev=%04x "
66 "lpm=0x%02x pnom=0x%02x lpum=0x%02x pim=0x%02x pam=0x%02x "
67 "pom=0x%02x chpids=%016llx",
68 __entry
->cssid
, __entry
->ssid
, __entry
->schno
, __entry
->cc
,
69 __entry
->pmcw_ena
, __entry
->pmcw_st
,
70 __entry
->pmcw_dnv
, __entry
->pmcw_dev
,
71 __entry
->pmcw_lpm
, __entry
->pmcw_pnom
,
72 __entry
->pmcw_lpum
, __entry
->pmcw_pim
,
73 __entry
->pmcw_pam
, __entry
->pmcw_pom
,
79 * s390_cio_stsch - Store Subchannel instruction (STSCH) was performed
80 * @schid: Subchannel ID
81 * @schib: Subchannel-Information block
84 DEFINE_EVENT(s390_class_schib
, s390_cio_stsch
,
85 TP_PROTO(struct subchannel_id schid
, struct schib
*schib
, int cc
),
86 TP_ARGS(schid
, schib
, cc
)
90 * s390_cio_msch - Modify Subchannel instruction (MSCH) was performed
91 * @schid: Subchannel ID
92 * @schib: Subchannel-Information block
95 DEFINE_EVENT(s390_class_schib
, s390_cio_msch
,
96 TP_PROTO(struct subchannel_id schid
, struct schib
*schib
, int cc
),
97 TP_ARGS(schid
, schib
, cc
)
101 * s390_cio_tsch - Test Subchannel instruction (TSCH) was performed
102 * @schid: Subchannel ID
103 * @irb: Interruption-Response Block
104 * @cc: Condition code
106 TRACE_EVENT(s390_cio_tsch
,
107 TP_PROTO(struct subchannel_id schid
, struct irb
*irb
, int cc
),
108 TP_ARGS(schid
, irb
, cc
),
113 __field_struct(struct irb
, irb
)
114 __field(u8
, scsw_dcc
)
115 __field(u8
, scsw_pno
)
116 __field(u8
, scsw_fctl
)
117 __field(u8
, scsw_actl
)
118 __field(u8
, scsw_stctl
)
119 __field(u8
, scsw_dstat
)
120 __field(u8
, scsw_cstat
)
124 __entry
->cssid
= schid
.cssid
;
125 __entry
->ssid
= schid
.ssid
;
126 __entry
->schno
= schid
.sch_no
;
128 __entry
->scsw_dcc
= scsw_cc(&irb
->scsw
);
129 __entry
->scsw_pno
= scsw_pno(&irb
->scsw
);
130 __entry
->scsw_fctl
= scsw_fctl(&irb
->scsw
);
131 __entry
->scsw_actl
= scsw_actl(&irb
->scsw
);
132 __entry
->scsw_stctl
= scsw_stctl(&irb
->scsw
);
133 __entry
->scsw_dstat
= scsw_dstat(&irb
->scsw
);
134 __entry
->scsw_cstat
= scsw_cstat(&irb
->scsw
);
137 TP_printk("schid=%x.%x.%04x cc=%d dcc=%d pno=%d fctl=0x%x actl=0x%x "
138 "stctl=0x%x dstat=0x%x cstat=0x%x",
139 __entry
->cssid
, __entry
->ssid
, __entry
->schno
, __entry
->cc
,
140 __entry
->scsw_dcc
, __entry
->scsw_pno
,
141 __entry
->scsw_fctl
, __entry
->scsw_actl
,
143 __entry
->scsw_dstat
, __entry
->scsw_cstat
148 * s390_cio_tpi - Test Pending Interruption instruction (TPI) was performed
149 * @addr: Address of the I/O interruption code or %NULL
150 * @cc: Condition code
152 TRACE_EVENT(s390_cio_tpi
,
153 TP_PROTO(struct tpi_info
*addr
, int cc
),
157 __field_struct(struct tpi_info
, tpi_info
)
161 __field(u8
, adapter_IO
)
168 memset(&__entry
->tpi_info
, 0, sizeof(struct tpi_info
));
170 __entry
->tpi_info
= *addr
;
172 memcpy(&__entry
->tpi_info
, &S390_lowcore
.subchannel_id
,
173 sizeof(struct tpi_info
));
175 __entry
->cssid
= __entry
->tpi_info
.schid
.cssid
;
176 __entry
->ssid
= __entry
->tpi_info
.schid
.ssid
;
177 __entry
->schno
= __entry
->tpi_info
.schid
.sch_no
;
178 __entry
->adapter_IO
= __entry
->tpi_info
.adapter_IO
;
179 __entry
->isc
= __entry
->tpi_info
.isc
;
180 __entry
->type
= __entry
->tpi_info
.type
;
182 TP_printk("schid=%x.%x.%04x cc=%d a=%d isc=%d type=%d",
183 __entry
->cssid
, __entry
->ssid
, __entry
->schno
, __entry
->cc
,
184 __entry
->adapter_IO
, __entry
->isc
,
190 * s390_cio_ssch - Start Subchannel instruction (SSCH) was performed
191 * @schid: Subchannel ID
192 * @orb: Operation-Request Block
193 * @cc: Condition code
195 TRACE_EVENT(s390_cio_ssch
,
196 TP_PROTO(struct subchannel_id schid
, union orb
*orb
, int cc
),
197 TP_ARGS(schid
, orb
, cc
),
202 __field_struct(union orb
, orb
)
206 __entry
->cssid
= schid
.cssid
;
207 __entry
->ssid
= schid
.ssid
;
208 __entry
->schno
= schid
.sch_no
;
212 TP_printk("schid=%x.%x.%04x cc=%d", __entry
->cssid
, __entry
->ssid
,
213 __entry
->schno
, __entry
->cc
217 DECLARE_EVENT_CLASS(s390_class_schid
,
218 TP_PROTO(struct subchannel_id schid
, int cc
),
227 __entry
->cssid
= schid
.cssid
;
228 __entry
->ssid
= schid
.ssid
;
229 __entry
->schno
= schid
.sch_no
;
232 TP_printk("schid=%x.%x.%04x cc=%d", __entry
->cssid
, __entry
->ssid
,
233 __entry
->schno
, __entry
->cc
238 * s390_cio_csch - Clear Subchannel instruction (CSCH) was performed
239 * @schid: Subchannel ID
240 * @cc: Condition code
242 DEFINE_EVENT(s390_class_schid
, s390_cio_csch
,
243 TP_PROTO(struct subchannel_id schid
, int cc
),
248 * s390_cio_hsch - Halt Subchannel instruction (HSCH) was performed
249 * @schid: Subchannel ID
250 * @cc: Condition code
252 DEFINE_EVENT(s390_class_schid
, s390_cio_hsch
,
253 TP_PROTO(struct subchannel_id schid
, int cc
),
258 * s390_cio_xsch - Cancel Subchannel instruction (XSCH) was performed
259 * @schid: Subchannel ID
260 * @cc: Condition code
262 DEFINE_EVENT(s390_class_schid
, s390_cio_xsch
,
263 TP_PROTO(struct subchannel_id schid
, int cc
),
268 * s390_cio_rsch - Resume Subchannel instruction (RSCH) was performed
269 * @schid: Subchannel ID
270 * @cc: Condition code
272 DEFINE_EVENT(s390_class_schid
, s390_cio_rsch
,
273 TP_PROTO(struct subchannel_id schid
, int cc
),
278 * s390_cio_rchp - Reset Channel Path (RCHP) instruction was performed
279 * @chpid: Channel-Path Identifier
280 * @cc: Condition code
282 TRACE_EVENT(s390_cio_rchp
,
283 TP_PROTO(struct chp_id chpid
, int cc
),
291 __entry
->cssid
= chpid
.cssid
;
292 __entry
->id
= chpid
.id
;
295 TP_printk("chpid=%x.%02x cc=%d", __entry
->cssid
, __entry
->id
,
300 #define CHSC_MAX_REQUEST_LEN 64
301 #define CHSC_MAX_RESPONSE_LEN 64
304 * s390_cio_chsc - Channel Subsystem Call (CHSC) instruction was performed
306 * @cc: Condition code
308 TRACE_EVENT(s390_cio_chsc
,
309 TP_PROTO(struct chsc_header
*chsc
, int cc
),
315 __array(u8
, request
, CHSC_MAX_REQUEST_LEN
)
316 __array(u8
, response
, CHSC_MAX_RESPONSE_LEN
)
320 __entry
->code
= chsc
->code
;
321 memcpy(&entry
->request
, chsc
,
322 min_t(u16
, chsc
->length
, CHSC_MAX_REQUEST_LEN
));
323 chsc
= (struct chsc_header
*) ((char *) chsc
+ chsc
->length
);
324 __entry
->rcode
= chsc
->code
;
325 memcpy(&entry
->response
, chsc
,
326 min_t(u16
, chsc
->length
, CHSC_MAX_RESPONSE_LEN
));
328 TP_printk("code=0x%04x cc=%d rcode=0x%04x", __entry
->code
,
329 __entry
->cc
, __entry
->rcode
)
333 * s390_cio_interrupt - An I/O interrupt occurred
334 * @tpi_info: Address of the I/O interruption code
336 TRACE_EVENT(s390_cio_interrupt
,
337 TP_PROTO(struct tpi_info
*tpi_info
),
340 __field_struct(struct tpi_info
, tpi_info
)
348 __entry
->tpi_info
= *tpi_info
;
349 __entry
->cssid
= tpi_info
->schid
.cssid
;
350 __entry
->ssid
= tpi_info
->schid
.ssid
;
351 __entry
->schno
= tpi_info
->schid
.sch_no
;
352 __entry
->isc
= tpi_info
->isc
;
353 __entry
->type
= tpi_info
->type
;
355 TP_printk("schid=%x.%x.%04x isc=%d type=%d",
356 __entry
->cssid
, __entry
->ssid
, __entry
->schno
,
357 __entry
->isc
, __entry
->type
362 * s390_cio_adapter_int - An adapter interrupt occurred
363 * @tpi_info: Address of the I/O interruption code
365 TRACE_EVENT(s390_cio_adapter_int
,
366 TP_PROTO(struct tpi_info
*tpi_info
),
369 __field_struct(struct tpi_info
, tpi_info
)
373 __entry
->tpi_info
= *tpi_info
;
374 __entry
->isc
= tpi_info
->isc
;
376 TP_printk("isc=%d", __entry
->isc
)
380 * s390_cio_stcrw - Store Channel Report Word (STCRW) was performed
381 * @crw: Channel Report Word
382 * @cc: Condition code
384 TRACE_EVENT(s390_cio_stcrw
,
385 TP_PROTO(struct crw
*crw
, int cc
),
388 __field_struct(struct crw
, crw
)
401 __entry
->slct
= crw
->slct
;
402 __entry
->oflw
= crw
->oflw
;
403 __entry
->chn
= crw
->chn
;
404 __entry
->rsc
= crw
->rsc
;
405 __entry
->anc
= crw
->anc
;
406 __entry
->erc
= crw
->erc
;
407 __entry
->rsid
= crw
->rsid
;
409 TP_printk("cc=%d slct=%d oflw=%d chn=%d rsc=%d anc=%d erc=0x%x "
411 __entry
->cc
, __entry
->slct
, __entry
->oflw
,
412 __entry
->chn
, __entry
->rsc
, __entry
->anc
,
413 __entry
->erc
, __entry
->rsid
417 #endif /* _TRACE_S390_CIO_H */
419 /* This part must be outside protection */
420 #undef TRACE_INCLUDE_PATH
421 #define TRACE_INCLUDE_PATH .
423 #undef TRACE_INCLUDE_FILE
424 #define TRACE_INCLUDE_FILE trace
426 #include <trace/define_trace.h>