2 * Tracepoint header for the s390 Common I/O layer (CIO)
4 * Copyright IBM Corp. 2015
5 * Author(s): Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
8 #include <linux/kernel.h>
10 #include <uapi/asm/chpid.h>
11 #include <uapi/asm/schid.h>
16 #define TRACE_SYSTEM s390
18 #if !defined(_TRACE_S390_CIO_H) || defined(TRACE_HEADER_MULTI_READ)
19 #define _TRACE_S390_CIO_H
21 #include <linux/tracepoint.h>
23 DECLARE_EVENT_CLASS(s390_class_schib
,
24 TP_PROTO(struct subchannel_id schid
, struct schib
*schib
, int cc
),
25 TP_ARGS(schid
, schib
, cc
),
31 __field_struct(struct schib
, schib
)
35 __entry
->cssid
= schid
.cssid
;
36 __entry
->ssid
= schid
.ssid
;
37 __entry
->schno
= schid
.sch_no
;
38 __entry
->devno
= schib
->pmcw
.dev
;
39 __entry
->schib
= *schib
;
42 TP_printk("schid=%x.%x.%04x cc=%d ena=%d st=%d dnv=%d dev=%04x "
43 "lpm=0x%02x pnom=0x%02x lpum=0x%02x pim=0x%02x pam=0x%02x "
44 "pom=0x%02x chpids=%016llx",
45 __entry
->cssid
, __entry
->ssid
, __entry
->schno
, __entry
->cc
,
46 __entry
->schib
.pmcw
.ena
, __entry
->schib
.pmcw
.st
,
47 __entry
->schib
.pmcw
.dnv
, __entry
->schib
.pmcw
.dev
,
48 __entry
->schib
.pmcw
.lpm
, __entry
->schib
.pmcw
.pnom
,
49 __entry
->schib
.pmcw
.lpum
, __entry
->schib
.pmcw
.pim
,
50 __entry
->schib
.pmcw
.pam
, __entry
->schib
.pmcw
.pom
,
51 *((u64
*) __entry
->schib
.pmcw
.chpid
)
56 * s390_cio_stsch - Store Subchannel instruction (STSCH) was performed
57 * @schid: Subchannel ID
58 * @schib: Subchannel-Information block
61 DEFINE_EVENT(s390_class_schib
, s390_cio_stsch
,
62 TP_PROTO(struct subchannel_id schid
, struct schib
*schib
, int cc
),
63 TP_ARGS(schid
, schib
, cc
)
67 * s390_cio_msch - Modify Subchannel instruction (MSCH) was performed
68 * @schid: Subchannel ID
69 * @schib: Subchannel-Information block
72 DEFINE_EVENT(s390_class_schib
, s390_cio_msch
,
73 TP_PROTO(struct subchannel_id schid
, struct schib
*schib
, int cc
),
74 TP_ARGS(schid
, schib
, cc
)
78 * s390_cio_tsch - Test Subchannel instruction (TSCH) was performed
79 * @schid: Subchannel ID
80 * @irb: Interruption-Response Block
83 TRACE_EVENT(s390_cio_tsch
,
84 TP_PROTO(struct subchannel_id schid
, struct irb
*irb
, int cc
),
85 TP_ARGS(schid
, irb
, cc
),
90 __field_struct(struct irb
, irb
)
94 __entry
->cssid
= schid
.cssid
;
95 __entry
->ssid
= schid
.ssid
;
96 __entry
->schno
= schid
.sch_no
;
100 TP_printk("schid=%x.%x.%04x cc=%d dcc=%d pno=%d fctl=0x%x actl=0x%x "
101 "stctl=0x%x dstat=0x%x cstat=0x%x",
102 __entry
->cssid
, __entry
->ssid
, __entry
->schno
, __entry
->cc
,
103 scsw_cc(&__entry
->irb
.scsw
), scsw_pno(&__entry
->irb
.scsw
),
104 scsw_fctl(&__entry
->irb
.scsw
), scsw_actl(&__entry
->irb
.scsw
),
105 scsw_stctl(&__entry
->irb
.scsw
),
106 scsw_dstat(&__entry
->irb
.scsw
), scsw_cstat(&__entry
->irb
.scsw
)
111 * s390_cio_tpi - Test Pending Interruption instruction (TPI) was performed
112 * @addr: Address of the I/O interruption code or %NULL
113 * @cc: Condition code
115 TRACE_EVENT(s390_cio_tpi
,
116 TP_PROTO(struct tpi_info
*addr
, int cc
),
120 __field_struct(struct tpi_info
, tpi_info
)
128 memset(&__entry
->tpi_info
, 0, sizeof(struct tpi_info
));
130 __entry
->tpi_info
= *addr
;
132 memcpy(&__entry
->tpi_info
, &S390_lowcore
.subchannel_id
,
133 sizeof(struct tpi_info
));
135 __entry
->cssid
= __entry
->tpi_info
.schid
.cssid
;
136 __entry
->ssid
= __entry
->tpi_info
.schid
.ssid
;
137 __entry
->schno
= __entry
->tpi_info
.schid
.sch_no
;
139 TP_printk("schid=%x.%x.%04x cc=%d a=%d isc=%d type=%d",
140 __entry
->cssid
, __entry
->ssid
, __entry
->schno
, __entry
->cc
,
141 __entry
->tpi_info
.adapter_IO
, __entry
->tpi_info
.isc
,
142 __entry
->tpi_info
.type
147 * s390_cio_ssch - Start Subchannel instruction (SSCH) was performed
148 * @schid: Subchannel ID
149 * @orb: Operation-Request Block
150 * @cc: Condition code
152 TRACE_EVENT(s390_cio_ssch
,
153 TP_PROTO(struct subchannel_id schid
, union orb
*orb
, int cc
),
154 TP_ARGS(schid
, orb
, cc
),
159 __field_struct(union orb
, orb
)
163 __entry
->cssid
= schid
.cssid
;
164 __entry
->ssid
= schid
.ssid
;
165 __entry
->schno
= schid
.sch_no
;
169 TP_printk("schid=%x.%x.%04x cc=%d", __entry
->cssid
, __entry
->ssid
,
170 __entry
->schno
, __entry
->cc
174 DECLARE_EVENT_CLASS(s390_class_schid
,
175 TP_PROTO(struct subchannel_id schid
, int cc
),
184 __entry
->cssid
= schid
.cssid
;
185 __entry
->ssid
= schid
.ssid
;
186 __entry
->schno
= schid
.sch_no
;
189 TP_printk("schid=%x.%x.%04x cc=%d", __entry
->cssid
, __entry
->ssid
,
190 __entry
->schno
, __entry
->cc
195 * s390_cio_csch - Clear Subchannel instruction (CSCH) was performed
196 * @schid: Subchannel ID
197 * @cc: Condition code
199 DEFINE_EVENT(s390_class_schid
, s390_cio_csch
,
200 TP_PROTO(struct subchannel_id schid
, int cc
),
205 * s390_cio_hsch - Halt Subchannel instruction (HSCH) was performed
206 * @schid: Subchannel ID
207 * @cc: Condition code
209 DEFINE_EVENT(s390_class_schid
, s390_cio_hsch
,
210 TP_PROTO(struct subchannel_id schid
, int cc
),
215 * s390_cio_xsch - Cancel Subchannel instruction (XSCH) was performed
216 * @schid: Subchannel ID
217 * @cc: Condition code
219 DEFINE_EVENT(s390_class_schid
, s390_cio_xsch
,
220 TP_PROTO(struct subchannel_id schid
, int cc
),
225 * s390_cio_rsch - Resume Subchannel instruction (RSCH) was performed
226 * @schid: Subchannel ID
227 * @cc: Condition code
229 DEFINE_EVENT(s390_class_schid
, s390_cio_rsch
,
230 TP_PROTO(struct subchannel_id schid
, int cc
),
235 * s390_cio_rchp - Reset Channel Path (RCHP) instruction was performed
236 * @chpid: Channel-Path Identifier
237 * @cc: Condition code
239 TRACE_EVENT(s390_cio_rchp
,
240 TP_PROTO(struct chp_id chpid
, int cc
),
248 __entry
->cssid
= chpid
.cssid
;
249 __entry
->id
= chpid
.id
;
252 TP_printk("chpid=%x.%02x cc=%d", __entry
->cssid
, __entry
->id
,
257 #define CHSC_MAX_REQUEST_LEN 64
258 #define CHSC_MAX_RESPONSE_LEN 64
261 * s390_cio_chsc - Channel Subsystem Call (CHSC) instruction was performed
263 * @cc: Condition code
265 TRACE_EVENT(s390_cio_chsc
,
266 TP_PROTO(struct chsc_header
*chsc
, int cc
),
272 __array(u8
, request
, CHSC_MAX_REQUEST_LEN
)
273 __array(u8
, response
, CHSC_MAX_RESPONSE_LEN
)
277 __entry
->code
= chsc
->code
;
278 memcpy(&entry
->request
, chsc
,
279 min_t(u16
, chsc
->length
, CHSC_MAX_REQUEST_LEN
));
280 chsc
= (struct chsc_header
*) ((char *) chsc
+ chsc
->length
);
281 __entry
->rcode
= chsc
->code
;
282 memcpy(&entry
->response
, chsc
,
283 min_t(u16
, chsc
->length
, CHSC_MAX_RESPONSE_LEN
));
285 TP_printk("code=0x%04x cc=%d rcode=0x%04x", __entry
->code
,
286 __entry
->cc
, __entry
->rcode
)
290 * s390_cio_interrupt - An I/O interrupt occurred
291 * @tpi_info: Address of the I/O interruption code
293 TRACE_EVENT(s390_cio_interrupt
,
294 TP_PROTO(struct tpi_info
*tpi_info
),
297 __field_struct(struct tpi_info
, tpi_info
)
303 __entry
->tpi_info
= *tpi_info
;
304 __entry
->cssid
= __entry
->tpi_info
.schid
.cssid
;
305 __entry
->ssid
= __entry
->tpi_info
.schid
.ssid
;
306 __entry
->schno
= __entry
->tpi_info
.schid
.sch_no
;
308 TP_printk("schid=%x.%x.%04x isc=%d type=%d",
309 __entry
->cssid
, __entry
->ssid
, __entry
->schno
,
310 __entry
->tpi_info
.isc
, __entry
->tpi_info
.type
315 * s390_cio_adapter_int - An adapter interrupt occurred
316 * @tpi_info: Address of the I/O interruption code
318 TRACE_EVENT(s390_cio_adapter_int
,
319 TP_PROTO(struct tpi_info
*tpi_info
),
322 __field_struct(struct tpi_info
, tpi_info
)
325 __entry
->tpi_info
= *tpi_info
;
327 TP_printk("isc=%d", __entry
->tpi_info
.isc
)
331 * s390_cio_stcrw - Store Channel Report Word (STCRW) was performed
332 * @crw: Channel Report Word
333 * @cc: Condition code
335 TRACE_EVENT(s390_cio_stcrw
,
336 TP_PROTO(struct crw
*crw
, int cc
),
339 __field_struct(struct crw
, crw
)
346 TP_printk("cc=%d slct=%d oflw=%d chn=%d rsc=%d anc=%d erc=0x%x "
348 __entry
->cc
, __entry
->crw
.slct
, __entry
->crw
.oflw
,
349 __entry
->crw
.chn
, __entry
->crw
.rsc
, __entry
->crw
.anc
,
350 __entry
->crw
.erc
, __entry
->crw
.rsid
354 #endif /* _TRACE_S390_CIO_H */
356 /* This part must be outside protection */
357 #undef TRACE_INCLUDE_PATH
358 #define TRACE_INCLUDE_PATH .
360 #undef TRACE_INCLUDE_FILE
361 #define TRACE_INCLUDE_FILE trace
363 #include <trace/define_trace.h>