0001
0002
0003
0004
0005
0006
0007
0008
0009 #include <linux/kernel.h>
0010 #include <asm/crw.h>
0011 #include <uapi/asm/chpid.h>
0012 #include <uapi/asm/schid.h>
0013 #include "cio.h"
0014 #include "orb.h"
0015
0016 #undef TRACE_SYSTEM
0017 #define TRACE_SYSTEM s390
0018
0019 #if !defined(_TRACE_S390_CIO_H) || defined(TRACE_HEADER_MULTI_READ)
0020 #define _TRACE_S390_CIO_H
0021
0022 #include <linux/tracepoint.h>
0023
0024 DECLARE_EVENT_CLASS(s390_class_schib,
0025 TP_PROTO(struct subchannel_id schid, struct schib *schib, int cc),
0026 TP_ARGS(schid, schib, cc),
0027 TP_STRUCT__entry(
0028 __field(u8, cssid)
0029 __field(u8, ssid)
0030 __field(u16, schno)
0031 __field(u16, devno)
0032 __field_struct(struct schib, schib)
0033 __field(u8, pmcw_ena)
0034 __field(u8, pmcw_st)
0035 __field(u8, pmcw_dnv)
0036 __field(u16, pmcw_dev)
0037 __field(u8, pmcw_lpm)
0038 __field(u8, pmcw_pnom)
0039 __field(u8, pmcw_lpum)
0040 __field(u8, pmcw_pim)
0041 __field(u8, pmcw_pam)
0042 __field(u8, pmcw_pom)
0043 __field(u64, pmcw_chpid)
0044 __field(int, cc)
0045 ),
0046 TP_fast_assign(
0047 __entry->cssid = schid.cssid;
0048 __entry->ssid = schid.ssid;
0049 __entry->schno = schid.sch_no;
0050 __entry->devno = schib->pmcw.dev;
0051 __entry->schib = *schib;
0052 __entry->pmcw_ena = schib->pmcw.ena;
0053 __entry->pmcw_st = schib->pmcw.ena;
0054 __entry->pmcw_dnv = schib->pmcw.dnv;
0055 __entry->pmcw_dev = schib->pmcw.dev;
0056 __entry->pmcw_lpm = schib->pmcw.lpm;
0057 __entry->pmcw_pnom = schib->pmcw.pnom;
0058 __entry->pmcw_lpum = schib->pmcw.lpum;
0059 __entry->pmcw_pim = schib->pmcw.pim;
0060 __entry->pmcw_pam = schib->pmcw.pam;
0061 __entry->pmcw_pom = schib->pmcw.pom;
0062 memcpy(&__entry->pmcw_chpid, &schib->pmcw.chpid, 8);
0063 __entry->cc = cc;
0064 ),
0065 TP_printk("schid=%x.%x.%04x cc=%d ena=%d st=%d dnv=%d dev=%04x "
0066 "lpm=0x%02x pnom=0x%02x lpum=0x%02x pim=0x%02x pam=0x%02x "
0067 "pom=0x%02x chpids=%016llx",
0068 __entry->cssid, __entry->ssid, __entry->schno, __entry->cc,
0069 __entry->pmcw_ena, __entry->pmcw_st,
0070 __entry->pmcw_dnv, __entry->pmcw_dev,
0071 __entry->pmcw_lpm, __entry->pmcw_pnom,
0072 __entry->pmcw_lpum, __entry->pmcw_pim,
0073 __entry->pmcw_pam, __entry->pmcw_pom,
0074 __entry->pmcw_chpid
0075 )
0076 );
0077
0078
0079
0080
0081
0082
0083
0084 DEFINE_EVENT(s390_class_schib, s390_cio_stsch,
0085 TP_PROTO(struct subchannel_id schid, struct schib *schib, int cc),
0086 TP_ARGS(schid, schib, cc)
0087 );
0088
0089
0090
0091
0092
0093
0094
0095 DEFINE_EVENT(s390_class_schib, s390_cio_msch,
0096 TP_PROTO(struct subchannel_id schid, struct schib *schib, int cc),
0097 TP_ARGS(schid, schib, cc)
0098 );
0099
0100
0101
0102
0103
0104
0105
0106 TRACE_EVENT(s390_cio_tsch,
0107 TP_PROTO(struct subchannel_id schid, struct irb *irb, int cc),
0108 TP_ARGS(schid, irb, cc),
0109 TP_STRUCT__entry(
0110 __field(u8, cssid)
0111 __field(u8, ssid)
0112 __field(u16, schno)
0113 __field_struct(struct irb, irb)
0114 __field(u8, scsw_dcc)
0115 __field(u8, scsw_pno)
0116 __field(u8, scsw_fctl)
0117 __field(u8, scsw_actl)
0118 __field(u8, scsw_stctl)
0119 __field(u8, scsw_dstat)
0120 __field(u8, scsw_cstat)
0121 __field(int, cc)
0122 ),
0123 TP_fast_assign(
0124 __entry->cssid = schid.cssid;
0125 __entry->ssid = schid.ssid;
0126 __entry->schno = schid.sch_no;
0127 __entry->irb = *irb;
0128 __entry->scsw_dcc = scsw_cc(&irb->scsw);
0129 __entry->scsw_pno = scsw_pno(&irb->scsw);
0130 __entry->scsw_fctl = scsw_fctl(&irb->scsw);
0131 __entry->scsw_actl = scsw_actl(&irb->scsw);
0132 __entry->scsw_stctl = scsw_stctl(&irb->scsw);
0133 __entry->scsw_dstat = scsw_dstat(&irb->scsw);
0134 __entry->scsw_cstat = scsw_cstat(&irb->scsw);
0135 __entry->cc = cc;
0136 ),
0137 TP_printk("schid=%x.%x.%04x cc=%d dcc=%d pno=%d fctl=0x%x actl=0x%x "
0138 "stctl=0x%x dstat=0x%x cstat=0x%x",
0139 __entry->cssid, __entry->ssid, __entry->schno, __entry->cc,
0140 __entry->scsw_dcc, __entry->scsw_pno,
0141 __entry->scsw_fctl, __entry->scsw_actl,
0142 __entry->scsw_stctl,
0143 __entry->scsw_dstat, __entry->scsw_cstat
0144 )
0145 );
0146
0147
0148
0149
0150
0151
0152 TRACE_EVENT(s390_cio_tpi,
0153 TP_PROTO(struct tpi_info *addr, int cc),
0154 TP_ARGS(addr, cc),
0155 TP_STRUCT__entry(
0156 __field(int, cc)
0157 __field_struct(struct tpi_info, tpi_info)
0158 __field(u8, cssid)
0159 __field(u8, ssid)
0160 __field(u16, schno)
0161 __field(u8, adapter_IO)
0162 __field(u8, isc)
0163 __field(u8, type)
0164 ),
0165 TP_fast_assign(
0166 __entry->cc = cc;
0167 if (cc != 0)
0168 memset(&__entry->tpi_info, 0, sizeof(struct tpi_info));
0169 else if (addr)
0170 __entry->tpi_info = *addr;
0171 else
0172 __entry->tpi_info = S390_lowcore.tpi_info;
0173 __entry->cssid = __entry->tpi_info.schid.cssid;
0174 __entry->ssid = __entry->tpi_info.schid.ssid;
0175 __entry->schno = __entry->tpi_info.schid.sch_no;
0176 __entry->adapter_IO = __entry->tpi_info.adapter_IO;
0177 __entry->isc = __entry->tpi_info.isc;
0178 __entry->type = __entry->tpi_info.type;
0179 ),
0180 TP_printk("schid=%x.%x.%04x cc=%d a=%d isc=%d type=%d",
0181 __entry->cssid, __entry->ssid, __entry->schno, __entry->cc,
0182 __entry->adapter_IO, __entry->isc,
0183 __entry->type
0184 )
0185 );
0186
0187
0188
0189
0190
0191
0192
0193 TRACE_EVENT(s390_cio_ssch,
0194 TP_PROTO(struct subchannel_id schid, union orb *orb, int cc),
0195 TP_ARGS(schid, orb, cc),
0196 TP_STRUCT__entry(
0197 __field(u8, cssid)
0198 __field(u8, ssid)
0199 __field(u16, schno)
0200 __field_struct(union orb, orb)
0201 __field(int, cc)
0202 ),
0203 TP_fast_assign(
0204 __entry->cssid = schid.cssid;
0205 __entry->ssid = schid.ssid;
0206 __entry->schno = schid.sch_no;
0207 __entry->orb = *orb;
0208 __entry->cc = cc;
0209 ),
0210 TP_printk("schid=%x.%x.%04x cc=%d", __entry->cssid, __entry->ssid,
0211 __entry->schno, __entry->cc
0212 )
0213 );
0214
0215 DECLARE_EVENT_CLASS(s390_class_schid,
0216 TP_PROTO(struct subchannel_id schid, int cc),
0217 TP_ARGS(schid, cc),
0218 TP_STRUCT__entry(
0219 __field(u8, cssid)
0220 __field(u8, ssid)
0221 __field(u16, schno)
0222 __field(int, cc)
0223 ),
0224 TP_fast_assign(
0225 __entry->cssid = schid.cssid;
0226 __entry->ssid = schid.ssid;
0227 __entry->schno = schid.sch_no;
0228 __entry->cc = cc;
0229 ),
0230 TP_printk("schid=%x.%x.%04x cc=%d", __entry->cssid, __entry->ssid,
0231 __entry->schno, __entry->cc
0232 )
0233 );
0234
0235
0236
0237
0238
0239
0240 DEFINE_EVENT(s390_class_schid, s390_cio_csch,
0241 TP_PROTO(struct subchannel_id schid, int cc),
0242 TP_ARGS(schid, cc)
0243 );
0244
0245
0246
0247
0248
0249
0250 DEFINE_EVENT(s390_class_schid, s390_cio_hsch,
0251 TP_PROTO(struct subchannel_id schid, int cc),
0252 TP_ARGS(schid, cc)
0253 );
0254
0255
0256
0257
0258
0259
0260 DEFINE_EVENT(s390_class_schid, s390_cio_xsch,
0261 TP_PROTO(struct subchannel_id schid, int cc),
0262 TP_ARGS(schid, cc)
0263 );
0264
0265
0266
0267
0268
0269
0270 DEFINE_EVENT(s390_class_schid, s390_cio_rsch,
0271 TP_PROTO(struct subchannel_id schid, int cc),
0272 TP_ARGS(schid, cc)
0273 );
0274
0275 #define CHSC_MAX_REQUEST_LEN 64
0276 #define CHSC_MAX_RESPONSE_LEN 64
0277
0278
0279
0280
0281
0282
0283 TRACE_EVENT(s390_cio_chsc,
0284 TP_PROTO(struct chsc_header *chsc, int cc),
0285 TP_ARGS(chsc, cc),
0286 TP_STRUCT__entry(
0287 __field(int, cc)
0288 __field(u16, code)
0289 __field(u16, rcode)
0290 __array(u8, request, CHSC_MAX_REQUEST_LEN)
0291 __array(u8, response, CHSC_MAX_RESPONSE_LEN)
0292 ),
0293 TP_fast_assign(
0294 __entry->cc = cc;
0295 __entry->code = chsc->code;
0296 memcpy(&entry->request, chsc,
0297 min_t(u16, chsc->length, CHSC_MAX_REQUEST_LEN));
0298 chsc = (struct chsc_header *) ((char *) chsc + chsc->length);
0299 __entry->rcode = chsc->code;
0300 memcpy(&entry->response, chsc,
0301 min_t(u16, chsc->length, CHSC_MAX_RESPONSE_LEN));
0302 ),
0303 TP_printk("code=0x%04x cc=%d rcode=0x%04x", __entry->code,
0304 __entry->cc, __entry->rcode)
0305 );
0306
0307
0308
0309
0310
0311 TRACE_EVENT(s390_cio_interrupt,
0312 TP_PROTO(struct tpi_info *tpi_info),
0313 TP_ARGS(tpi_info),
0314 TP_STRUCT__entry(
0315 __field_struct(struct tpi_info, tpi_info)
0316 __field(u8, cssid)
0317 __field(u8, ssid)
0318 __field(u16, schno)
0319 __field(u8, isc)
0320 __field(u8, type)
0321 ),
0322 TP_fast_assign(
0323 __entry->tpi_info = *tpi_info;
0324 __entry->cssid = tpi_info->schid.cssid;
0325 __entry->ssid = tpi_info->schid.ssid;
0326 __entry->schno = tpi_info->schid.sch_no;
0327 __entry->isc = tpi_info->isc;
0328 __entry->type = tpi_info->type;
0329 ),
0330 TP_printk("schid=%x.%x.%04x isc=%d type=%d",
0331 __entry->cssid, __entry->ssid, __entry->schno,
0332 __entry->isc, __entry->type
0333 )
0334 );
0335
0336
0337
0338
0339
0340 TRACE_EVENT(s390_cio_adapter_int,
0341 TP_PROTO(struct tpi_info *tpi_info),
0342 TP_ARGS(tpi_info),
0343 TP_STRUCT__entry(
0344 __field_struct(struct tpi_info, tpi_info)
0345 __field(u8, isc)
0346 ),
0347 TP_fast_assign(
0348 __entry->tpi_info = *tpi_info;
0349 __entry->isc = tpi_info->isc;
0350 ),
0351 TP_printk("isc=%d", __entry->isc)
0352 );
0353
0354
0355
0356
0357
0358
0359 TRACE_EVENT(s390_cio_stcrw,
0360 TP_PROTO(struct crw *crw, int cc),
0361 TP_ARGS(crw, cc),
0362 TP_STRUCT__entry(
0363 __field_struct(struct crw, crw)
0364 __field(int, cc)
0365 __field(u8, slct)
0366 __field(u8, oflw)
0367 __field(u8, chn)
0368 __field(u8, rsc)
0369 __field(u8, anc)
0370 __field(u8, erc)
0371 __field(u16, rsid)
0372 ),
0373 TP_fast_assign(
0374 __entry->crw = *crw;
0375 __entry->cc = cc;
0376 __entry->slct = crw->slct;
0377 __entry->oflw = crw->oflw;
0378 __entry->chn = crw->chn;
0379 __entry->rsc = crw->rsc;
0380 __entry->anc = crw->anc;
0381 __entry->erc = crw->erc;
0382 __entry->rsid = crw->rsid;
0383 ),
0384 TP_printk("cc=%d slct=%d oflw=%d chn=%d rsc=%d anc=%d erc=0x%x "
0385 "rsid=0x%x",
0386 __entry->cc, __entry->slct, __entry->oflw,
0387 __entry->chn, __entry->rsc, __entry->anc,
0388 __entry->erc, __entry->rsid
0389 )
0390 );
0391
0392 #endif
0393
0394
0395 #undef TRACE_INCLUDE_PATH
0396 #define TRACE_INCLUDE_PATH .
0397
0398 #undef TRACE_INCLUDE_FILE
0399 #define TRACE_INCLUDE_FILE trace
0400
0401 #include <trace/define_trace.h>