diff options
author | Denis V. Lunev <den@openvz.org> | 2022-05-30 12:39:29 +0200 |
---|---|---|
committer | Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> | 2022-06-29 10:57:02 +0300 |
commit | 8bb100c9e2dc1fe0e33283b0c43252dbaf4eb71b (patch) | |
tree | 50ad16f1f7a33346cf1e43825ba400b7d4b436bb /block/nbd.c | |
parent | 9d05a87b77a63ed5505c59f5e8e6c5ca4f2c04d3 (diff) | |
download | qemu-8bb100c9e2dc1fe0e33283b0c43252dbaf4eb71b.zip qemu-8bb100c9e2dc1fe0e33283b0c43252dbaf4eb71b.tar.gz qemu-8bb100c9e2dc1fe0e33283b0c43252dbaf4eb71b.tar.bz2 |
nbd: trace long NBD operations
At the moment there are 2 sources of lengthy operations if configured:
* open connection, which could retry inside and
* reconnect of already opened connection
These operations could be quite lengthy and cumbersome to catch thus
it would be quite natural to add trace points for them.
This patch is based on the original downstream work made by Vladimir.
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Eric Blake <eblake@redhat.com>
CC: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
CC: Kevin Wolf <kwolf@redhat.com>
CC: Hanna Reitz <hreitz@redhat.com>
CC: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Diffstat (limited to 'block/nbd.c')
-rw-r--r-- | block/nbd.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/block/nbd.c b/block/nbd.c index 7f5f50e..5849d31 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -371,6 +371,7 @@ static bool nbd_client_connecting(BDRVNBDState *s) /* Called with s->requests_lock taken. */ static coroutine_fn void nbd_reconnect_attempt(BDRVNBDState *s) { + int ret; bool blocking = s->state == NBD_CLIENT_CONNECTING_WAIT; /* @@ -380,6 +381,8 @@ static coroutine_fn void nbd_reconnect_attempt(BDRVNBDState *s) assert(nbd_client_connecting(s)); assert(s->in_flight == 1); + trace_nbd_reconnect_attempt(s->bs->in_flight); + if (blocking && !s->reconnect_delay_timer) { /* * It's the first reconnect attempt after switching to @@ -401,7 +404,8 @@ static coroutine_fn void nbd_reconnect_attempt(BDRVNBDState *s) } qemu_mutex_unlock(&s->requests_lock); - nbd_co_do_establish_connection(s->bs, blocking, NULL); + ret = nbd_co_do_establish_connection(s->bs, blocking, NULL); + trace_nbd_reconnect_attempt_result(ret, s->bs->in_flight); qemu_mutex_lock(&s->requests_lock); /* |