mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 02:24:58 -06:00
virtio-rng: add some trace events
Add some trace events to virtio-rng for easier debugging Signed-off-by: Amit Shah <amit.shah@redhat.com> Reviewed-by: Amos Kong <akong@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
6db8b53866
commit
4ac4458076
2 changed files with 11 additions and 0 deletions
|
@ -16,6 +16,7 @@
|
|||
#include "hw/virtio/virtio-rng.h"
|
||||
#include "sysemu/rng.h"
|
||||
#include "qom/object_interfaces.h"
|
||||
#include "trace.h"
|
||||
|
||||
static bool is_guest_ready(VirtIORNG *vrng)
|
||||
{
|
||||
|
@ -24,6 +25,7 @@ static bool is_guest_ready(VirtIORNG *vrng)
|
|||
&& (vdev->status & VIRTIO_CONFIG_S_DRIVER_OK)) {
|
||||
return true;
|
||||
}
|
||||
trace_virtio_rng_guest_not_ready(vrng);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -62,6 +64,7 @@ static void chr_read(void *opaque, const void *buf, size_t size)
|
|||
offset += len;
|
||||
|
||||
virtqueue_push(vrng->vq, &elem, len);
|
||||
trace_virtio_rng_pushed(vrng, len);
|
||||
}
|
||||
virtio_notify(vdev, vrng->vq);
|
||||
}
|
||||
|
@ -81,6 +84,9 @@ static void virtio_rng_process(VirtIORNG *vrng)
|
|||
quota = MIN((uint64_t)vrng->quota_remaining, (uint64_t)UINT32_MAX);
|
||||
}
|
||||
size = get_request_size(vrng->vq, quota);
|
||||
|
||||
trace_virtio_rng_request(vrng, size, quota);
|
||||
|
||||
size = MIN(vrng->quota_remaining, size);
|
||||
if (size) {
|
||||
rng_backend_request_entropy(vrng->rng, size, chr_read, vrng);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue