Commit 4ff4ba15 authored by Vasily Gorbik's avatar Vasily Gorbik

Merge tag 'vfio-ccw-20191111' of...

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: default avatarVasily Gorbik <gor@linux.ibm.com>
parents 544f1d62 85298880
......@@ -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
......@@ -15,6 +15,7 @@
#include <asm/scsw.h>
#include "orb.h"
#include "vfio_ccw_trace.h"
/*
* Max length for ccw chain.
......
......@@ -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,7 +318,7 @@ static void fsm_io_request(struct vfio_ccw_private *private,
}
err_out:
trace_vfio_ccw_io_fctl(scsw->cmd.fctl, schid,
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);
}
/*
......
......@@ -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);
}
......
// 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);
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment