File xen.trc-ioreq_server_create.patch of Package xen
From: Olaf Hering <olaf@aepfle.de>
Date: Thu, 15 Jun 2023 08:42:59 +0000
Subject: trc ioreq_server_create
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
xen/common/ioreq.c | 14 ++++++---
1 file changed, 10 insertions(+), 4 deletions(-)
--- a/xen/common/ioreq.c
+++ b/xen/common/ioreq.c
@@ -792,24 +792,28 @@ static void ioreq_server_deinit(struct ioreq_server *s)
ioreq_server_free_rangesets(s);
put_domain(s->emulator);
}
static int ioreq_server_create(struct domain *d, int bufioreq_handling,
ioservid_t *id)
{
struct ioreq_server *s;
unsigned int i;
int rc;
+ trc_ioreq_server_create_t trc = {
+ .d = d->domain_id,
+ .id = ~0,
+ };
if ( !IS_ENABLED(CONFIG_X86) && bufioreq_handling )
return -EINVAL;
if ( bufioreq_handling > HVM_IOREQSRV_BUFIOREQ_ATOMIC )
return -EINVAL;
s = xzalloc(struct ioreq_server);
if ( !s )
return -ENOMEM;
domain_pause(d);
@@ -833,33 +837,35 @@ static int ioreq_server_create(struct domain *d, int bufioreq_handling,
rc = ioreq_server_init(s, d, bufioreq_handling, i);
if ( rc )
{
set_ioreq_server(d, i, NULL);
goto fail;
}
if ( id )
*id = i;
rspin_unlock(&d->ioreq_server.lock);
- domain_unpause(d);
-
- return 0;
+ trc.id = i;
+ goto out;
fail:
rspin_unlock(&d->ioreq_server.lock);
- domain_unpause(d);
xfree(s);
+out:
+ TRACE_trc(TRC_IOREQ_ioreq_server_create);
+ domain_unpause(d);
+
return rc;
}
static int ioreq_server_destroy(struct domain *d, ioservid_t id)
{
struct ioreq_server *s;
int rc;
rspin_lock(&d->ioreq_server.lock);
s = get_ioreq_server(d, id);