From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49508) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEWdJ-0000hm-0F for qemu-devel@nongnu.org; Tue, 05 Aug 2014 00:46:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEWdC-0006Zk-Sa for qemu-devel@nongnu.org; Tue, 05 Aug 2014 00:45:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36353) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEWdC-0006ZT-Jl for qemu-devel@nongnu.org; Tue, 05 Aug 2014 00:45:50 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s754jorG027729 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 5 Aug 2014 00:45:50 -0400 Date: Tue, 5 Aug 2014 12:45:46 +0800 From: Amos Kong Message-ID: <20140805044546.GB13192@z.redhat.com> References: <784520b828d1c1ad4fbf5b982201acbed9462bcf.1407149564.git.amit.shah@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <784520b828d1c1ad4fbf5b982201acbed9462bcf.1407149564.git.amit.shah@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 1/1] virtio-rng: add some trace events List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: qemu list , Stefan Hajnoczi On Mon, Aug 04, 2014 at 04:22:44PM +0530, Amit Shah wrote: > Add some trace events to virtio-rng for easier debugging > > Signed-off-by: Amit Shah > > --- > v2: > - requested_size trace event now shows proper values Reviewed-by: Amos Kong > --- > hw/virtio/virtio-rng.c | 6 ++++++ > trace-events | 5 +++++ > 2 files changed, 11 insertions(+) > > diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c > index 03fd04a..e85a979 100644 > --- a/hw/virtio/virtio-rng.c > +++ b/hw/virtio/virtio-rng.c > @@ -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); > diff --git a/trace-events b/trace-events > index 11a17a8..99f39ac 100644 > --- a/trace-events > +++ b/trace-events > @@ -41,6 +41,11 @@ virtio_irq(void *vq) "vq %p" > virtio_notify(void *vdev, void *vq) "vdev %p vq %p" > virtio_set_status(void *vdev, uint8_t val) "vdev %p val %u" > > +# hw/virtio/virtio-rng.c > +virtio_rng_guest_not_ready(void *rng) "rng %p: guest not ready" > +virtio_rng_pushed(void *rng, size_t len) "rng %p: %zd bytes pushed" > +virtio_rng_request(void *rng, size_t size, unsigned quota) "rng %p: %zd bytes requested, %u bytes quota left" > + > # hw/char/virtio-serial-bus.c > virtio_serial_send_control_event(unsigned int port, uint16_t event, uint16_t value) "port %u, event %u, value %u" > virtio_serial_throttle_port(unsigned int port, bool throttle) "port %u, throttle %d" > -- > 1.9.3 -- Amos.