[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 29/30] trace: Fix parameter types in hw/virti
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v2 29/30] trace: Fix parameter types in hw/virtio |
Date: |
Thu, 16 Mar 2017 15:45:56 +0800 |
User-agent: |
Mutt/1.7.1 (2016-10-04) |
On Mon, Mar 13, 2017 at 02:55:46PM -0500, Eric Blake wrote:
> An upcoming patch will let the compiler warn us when we are silently
> losing precision in traces; update the trace definitions to pass
> through the full value at the callsite.
>
> Signed-off-by: Eric Blake <address@hidden>
> ---
> hw/virtio/trace-events | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/virtio/trace-events b/hw/virtio/trace-events
> index 6926eed..7b3743d 100644
> --- a/hw/virtio/trace-events
> +++ b/hw/virtio/trace-events
> @@ -4,7 +4,7 @@
> virtqueue_fill(void *vq, const void *elem, unsigned int len, unsigned int
> idx) "vq %p elem %p len %u idx %u"
> virtqueue_flush(void *vq, unsigned int count) "vq %p count %u"
> virtqueue_pop(void *vq, void *elem, unsigned int in_num, unsigned int
> out_num) "vq %p elem %p in_num %u out_num %u"
> -virtio_queue_notify(void *vdev, int n, void *vq) "vdev %p n %d vq %p"
> +virtio_queue_notify(void *vdev, ptrdiff_t n, void *vq) "vdev %p n %td vq %p"
I'm not sure about this change. Logically the virtqueue number, n, is
not a ptrdiff_t. The type for n is always int in
include/hw/virtio/virtio.h and it should be the same for the trace
event.
It just happens to be that the caller calculates it using pointer
subtraction. The trace event shouldn't reflect this. One day the
caller might change the calculation and it would then be necessary to
change the type of the trace event.
Stefan
signature.asc
Description: PGP signature
- [Qemu-devel] [PATCH v2 24/30] trace: Fix parameter types in hw/sd, (continued)
- [Qemu-devel] [PATCH v2 24/30] trace: Fix parameter types in hw/sd, Eric Blake, 2017/03/13
- [Qemu-devel] [PATCH v2 26/30] trace: Fix parameter types in hw/timer, Eric Blake, 2017/03/13
- [Qemu-devel] [PATCH v2 23/30] trace: Fix parameter types in hw/ppc, Eric Blake, 2017/03/13
- [Qemu-devel] [PATCH v2 28/30] trace: Fix parameter types in hw/vfio, Eric Blake, 2017/03/13
- [Qemu-devel] [PATCH v2 27/30] trace: Fix parameter types in hw/usb, Eric Blake, 2017/03/13
- [Qemu-devel] [RFC PATCH v2 30/30] trace: Force compiler warnings on trace parameter type mismatches, Eric Blake, 2017/03/13
- [Qemu-devel] [PATCH v2 29/30] trace: Fix parameter types in hw/virtio, Eric Blake, 2017/03/13
- Re: [Qemu-devel] [PATCH v2 29/30] trace: Fix parameter types in hw/virtio,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH v2 25/30] trace: Fix parameter types in hw/scsi, Eric Blake, 2017/03/13
- Re: [Qemu-devel] [PATCH for-2.9 v2 00/30] trace type mismatch cleanups, no-reply, 2017/03/13