aboutsummaryrefslogtreecommitdiff
path: root/xen-hvm.c
diff options
context:
space:
mode:
authorDon Slutz <dslutz@verizon.com>2015-04-30 14:27:09 -0400
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>2015-09-08 15:20:20 +0000
commiteeb6b13a5a45d16a7b348891921d496bc5d6df2c (patch)
treedb133248734bf6eabd38d521c2725b9e536f9c83 /xen-hvm.c
parent8611280505119e296757a60711a881341603fa5a (diff)
xen-hvm: Add trace to ioreq
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Don Slutz <dslutz@verizon.com>
Diffstat (limited to 'xen-hvm.c')
-rw-r--r--xen-hvm.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/xen-hvm.c b/xen-hvm.c
index 040846236c..d17d3f33bc 100644
--- a/xen-hvm.c
+++ b/xen-hvm.c
@@ -814,9 +814,14 @@ static void cpu_ioreq_pio(ioreq_t *req)
{
uint32_t i;
+ trace_cpu_ioreq_pio(req, req->dir, req->df, req->data_is_ptr, req->addr,
+ req->data, req->count, req->size);
+
if (req->dir == IOREQ_READ) {
if (!req->data_is_ptr) {
req->data = do_inp(req->addr, req->size);
+ trace_cpu_ioreq_pio_read_reg(req, req->data, req->addr,
+ req->size);
} else {
uint32_t tmp;
@@ -827,6 +832,8 @@ static void cpu_ioreq_pio(ioreq_t *req)
}
} else if (req->dir == IOREQ_WRITE) {
if (!req->data_is_ptr) {
+ trace_cpu_ioreq_pio_write_reg(req, req->data, req->addr,
+ req->size);
do_outp(req->addr, req->size, req->data);
} else {
for (i = 0; i < req->count; i++) {
@@ -843,6 +850,9 @@ static void cpu_ioreq_move(ioreq_t *req)
{
uint32_t i;
+ trace_cpu_ioreq_move(req, req->dir, req->df, req->data_is_ptr, req->addr,
+ req->data, req->count, req->size);
+
if (!req->data_is_ptr) {
if (req->dir == IOREQ_READ) {
for (i = 0; i < req->count; i++) {
@@ -915,11 +925,18 @@ static void handle_vmport_ioreq(XenIOState *state, ioreq_t *req)
static void handle_ioreq(XenIOState *state, ioreq_t *req)
{
+ trace_handle_ioreq(req, req->type, req->dir, req->df, req->data_is_ptr,
+ req->addr, req->data, req->count, req->size);
+
if (!req->data_is_ptr && (req->dir == IOREQ_WRITE) &&
(req->size < sizeof (target_ulong))) {
req->data &= ((target_ulong) 1 << (8 * req->size)) - 1;
}
+ if (req->dir == IOREQ_WRITE)
+ trace_handle_ioreq_write(req, req->type, req->df, req->data_is_ptr,
+ req->addr, req->data, req->count, req->size);
+
switch (req->type) {
case IOREQ_TYPE_PIO:
cpu_ioreq_pio(req);
@@ -959,6 +976,10 @@ static void handle_ioreq(XenIOState *state, ioreq_t *req)
default:
hw_error("Invalid ioreq type 0x%x\n", req->type);
}
+ if (req->dir == IOREQ_READ) {
+ trace_handle_ioreq_read(req, req->type, req->df, req->data_is_ptr,
+ req->addr, req->data, req->count, req->size);
+ }
}
static int handle_buffered_iopage(XenIOState *state)