aboutsummaryrefslogtreecommitdiff
path: root/monitor/qmp.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2021-02-01 17:15:03 +0100
committerMarkus Armbruster <armbru@redhat.com>2021-02-04 13:20:29 +0100
commitf680405f45afab692bd8021a35d40d037366abf1 (patch)
treee14b467f78ca8edbab0018a158e45323e33ec4a7 /monitor/qmp.c
parent395a95080ad9ccf08b71fa4b7909455ba42f2202 (diff)
qmp: Add more tracepoints
Add tracepoints for in-band request enqueue and dequeue, processing of queued in-band errors, and responses. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20210201161504.1976989-3-armbru@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'monitor/qmp.c')
-rw-r--r--monitor/qmp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/monitor/qmp.c b/monitor/qmp.c
index f6a1e7783b..e37b047c8a 100644
--- a/monitor/qmp.c
+++ b/monitor/qmp.c
@@ -113,6 +113,7 @@ void qmp_send_response(MonitorQMP *mon, const QDict *rsp)
json = qobject_to_json_pretty(data, mon->pretty);
assert(json != NULL);
+ trace_monitor_qmp_respond(mon, json->str);
g_string_append_c(json, '\n');
monitor_puts(&mon->common, json->str);
@@ -251,6 +252,9 @@ void coroutine_fn monitor_qmp_dispatcher_co(void *data)
}
}
+ trace_monitor_qmp_in_band_dequeue(req_obj,
+ req_obj->mon->qmp_requests->length);
+
if (qatomic_xchg(&qmp_dispatcher_co_busy, true) == true) {
/*
* Someone rescheduled us (probably because a new requests
@@ -287,6 +291,7 @@ void coroutine_fn monitor_qmp_dispatcher_co(void *data)
monitor_qmp_dispatch(mon, req_obj->req);
} else {
assert(req_obj->err);
+ trace_monitor_qmp_err_in_band(error_get_pretty(req_obj->err));
rsp = qmp_error_response(req_obj->err);
req_obj->err = NULL;
monitor_qmp_respond(mon, rsp);
@@ -364,6 +369,8 @@ static void handle_qmp_command(void *opaque, QObject *req, Error *err)
* handled in time order. Ownership for req_obj, req,
* etc. will be delivered to the handler side.
*/
+ trace_monitor_qmp_in_band_enqueue(req_obj, mon,
+ mon->qmp_requests->length);
assert(mon->qmp_requests->length < QMP_REQ_QUEUE_LEN_MAX);
g_queue_push_tail(mon->qmp_requests, req_obj);
qemu_mutex_unlock(&mon->qmp_queue_lock);