enhance tracing in vfio-ccw

-----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEEw9DWbcNiT/aowBjO3s9rk8bwL68FAl3JYRgSHGNvaHVja0By
 ZWRoYXQuY29tAAoJEN7Pa5PG8C+vwqMP/202cRtkkJ8Z21XPoCXAnA+pB08x79gE
 buVYpPfb6GzKNYyaeDZ0X8DZzfVLaaWz4kr1B1FUGLJKVdtSXEMjKyj4ho8fkMle
 aV7EZnswWI0ly+ckNy6UTm36MaRha6YK8lLQavuFcZpzhK2342xFxer6TZuc2yuK
 qg+2veuxJH1s14pQCwLSrAaNSnoxheT0snDpb+70FZB4L+J4lEjCx/KqG+wP/sdw
 l7ybfwSLu29yD9HDh6SrAjydZLTIsMIIY/1nTG5Gk/pYl70vIXZ7PjiMIxSxnPEe
 U+RZ84ytbtVHK1SBo284AJziXaAdwASNQbOovishYAKQW3o3EsI7OomTtPSIFypU
 KdMGWqJIxpFeEQ7s5ZEjE4gRz9hB16aveOLRd4A8sCVNP+vXJnILNyrxKtL4UP+a
 +kP/UxIntJsvBKC9t83zxAlI07a+BcHgVw9bMtWcJaA6Q9WXwoeesE5gwYLpsQSs
 tLlRrLKFIs8Y+mJmHiaBKXyipH51n+SvxWK4BZs9tfH2q3hjO7Tm5GIuJ852NTKq
 XOk4CRRh16JsW9xEO9RndZr+b32KICAPov3IxpgxFKUVUr9/KV/TUw3NY0rECo8R
 f+qraNETGDPsdMZ/tPbYuhdFyMd4eqRkOC2CPC9W7A/lhMYUNyM+nROVdeT3r5rm
 t69OVIUYhfTD
 =ZQte
 -----END PGP SIGNATURE-----

Merge tag 'vfio-ccw-20191111' of https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/vfio-ccw into features

enhance tracing in vfio-ccw

* tag 'vfio-ccw-20191111' of https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/vfio-ccw:
  vfio-ccw: Rework the io_fctl trace
  vfio-ccw: Add a trace for asynchronous requests
  vfio-ccw: Trace the FSM jumptable
  vfio-ccw: Refactor how the traces are built

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
This commit is contained in:
Vasily Gorbik 2019-11-12 12:48:01 +01:00
commit 4ff4ba153a
6 changed files with 93 additions and 14 deletions

View File

@ -5,7 +5,7 @@
# The following is required for define_trace.h to find ./trace.h
CFLAGS_trace.o := -I$(src)
CFLAGS_vfio_ccw_fsm.o := -I$(src)
CFLAGS_vfio_ccw_trace.o := -I$(src)
obj-y += airq.o blacklist.o chsc.o cio.o css.o chp.o idset.o isc.o \
fcx.o itcw.o crw.o ccwreq.o trace.o ioasm.o
@ -21,5 +21,5 @@ qdio-objs := qdio_main.o qdio_thinint.o qdio_debug.o qdio_setup.o
obj-$(CONFIG_QDIO) += qdio.o
vfio_ccw-objs += vfio_ccw_drv.o vfio_ccw_cp.o vfio_ccw_ops.o vfio_ccw_fsm.o \
vfio_ccw_async.o
vfio_ccw_async.o vfio_ccw_trace.o
obj-$(CONFIG_VFIO_CCW) += vfio_ccw.o

View File

@ -15,6 +15,7 @@
#include <asm/scsw.h>
#include "orb.h"
#include "vfio_ccw_trace.h"
/*
* Max length for ccw chain.

View File

@ -15,9 +15,6 @@
#include "ioasm.h"
#include "vfio_ccw_private.h"
#define CREATE_TRACE_POINTS
#include "vfio_ccw_trace.h"
static int fsm_io_helper(struct vfio_ccw_private *private)
{
struct subchannel *sch;
@ -321,8 +318,8 @@ static void fsm_io_request(struct vfio_ccw_private *private,
}
err_out:
trace_vfio_ccw_io_fctl(scsw->cmd.fctl, schid,
io_region->ret_code, errstr);
trace_vfio_ccw_fsm_io_request(scsw->cmd.fctl, schid,
io_region->ret_code, errstr);
}
/*
@ -344,6 +341,10 @@ static void fsm_async_request(struct vfio_ccw_private *private,
/* should not happen? */
cmd_region->ret_code = -EINVAL;
}
trace_vfio_ccw_fsm_async_request(get_schid(private),
cmd_region->command,
cmd_region->ret_code);
}
/*

View File

@ -135,6 +135,7 @@ extern fsm_func_t *vfio_ccw_jumptable[NR_VFIO_CCW_STATES][NR_VFIO_CCW_EVENTS];
static inline void vfio_ccw_fsm_event(struct vfio_ccw_private *private,
int event)
{
trace_vfio_ccw_fsm_event(private->sch->schid, private->state, event);
vfio_ccw_jumptable[private->state][event](private, event);
}

View File

@ -0,0 +1,14 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Tracepoint definitions for vfio_ccw
*
* Copyright IBM Corp. 2019
* Author(s): Eric Farman <farman@linux.ibm.com>
*/
#define CREATE_TRACE_POINTS
#include "vfio_ccw_trace.h"
EXPORT_TRACEPOINT_SYMBOL(vfio_ccw_fsm_async_request);
EXPORT_TRACEPOINT_SYMBOL(vfio_ccw_fsm_event);
EXPORT_TRACEPOINT_SYMBOL(vfio_ccw_fsm_io_request);

View File

@ -7,6 +7,8 @@
* Halil Pasic <pasic@linux.vnet.ibm.com>
*/
#include "cio.h"
#undef TRACE_SYSTEM
#define TRACE_SYSTEM vfio_ccw
@ -15,28 +17,88 @@
#include <linux/tracepoint.h>
TRACE_EVENT(vfio_ccw_io_fctl,
TRACE_EVENT(vfio_ccw_fsm_async_request,
TP_PROTO(struct subchannel_id schid,
int command,
int errno),
TP_ARGS(schid, command, errno),
TP_STRUCT__entry(
__field(u8, cssid)
__field(u8, ssid)
__field(u16, sch_no)
__field(int, command)
__field(int, errno)
),
TP_fast_assign(
__entry->cssid = schid.cssid;
__entry->ssid = schid.ssid;
__entry->sch_no = schid.sch_no;
__entry->command = command;
__entry->errno = errno;
),
TP_printk("schid=%x.%x.%04x command=0x%x errno=%d",
__entry->cssid,
__entry->ssid,
__entry->sch_no,
__entry->command,
__entry->errno)
);
TRACE_EVENT(vfio_ccw_fsm_event,
TP_PROTO(struct subchannel_id schid, int state, int event),
TP_ARGS(schid, state, event),
TP_STRUCT__entry(
__field(u8, cssid)
__field(u8, ssid)
__field(u16, schno)
__field(int, state)
__field(int, event)
),
TP_fast_assign(
__entry->cssid = schid.cssid;
__entry->ssid = schid.ssid;
__entry->schno = schid.sch_no;
__entry->state = state;
__entry->event = event;
),
TP_printk("schid=%x.%x.%04x state=%d event=%d",
__entry->cssid, __entry->ssid, __entry->schno,
__entry->state,
__entry->event)
);
TRACE_EVENT(vfio_ccw_fsm_io_request,
TP_PROTO(int fctl, struct subchannel_id schid, int errno, char *errstr),
TP_ARGS(fctl, schid, errno, errstr),
TP_STRUCT__entry(
__field(u8, cssid)
__field(u8, ssid)
__field(u16, sch_no)
__field(int, fctl)
__field_struct(struct subchannel_id, schid)
__field(int, errno)
__field(char*, errstr)
),
TP_fast_assign(
__entry->cssid = schid.cssid;
__entry->ssid = schid.ssid;
__entry->sch_no = schid.sch_no;
__entry->fctl = fctl;
__entry->schid = schid;
__entry->errno = errno;
__entry->errstr = errstr;
),
TP_printk("schid=%x.%x.%04x fctl=%x errno=%d info=%s",
__entry->schid.cssid,
__entry->schid.ssid,
__entry->schid.sch_no,
TP_printk("schid=%x.%x.%04x fctl=0x%x errno=%d info=%s",
__entry->cssid,
__entry->ssid,
__entry->sch_no,
__entry->fctl,
__entry->errno,
__entry->errstr)