qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: stefanha@redhat.com, Fabien Chouteau <chouteau@adacore.com>
Subject: [Qemu-devel] [PATCH v2 26/30] trace: Fix parameter types in hw/timer
Date: Mon, 13 Mar 2017 14:55:43 -0500	[thread overview]
Message-ID: <20170313195547.21466-27-eblake@redhat.com> (raw)
In-Reply-To: <20170313195547.21466-1-eblake@redhat.com>

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, as well as updating callers
to use a consistent type.

Signed-off-by: Eric Blake <eblake@redhat.com>
---
 hw/timer/grlib_gptimer.c |  6 +++---
 hw/timer/trace-events    | 14 +++++++-------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/hw/timer/grlib_gptimer.c b/hw/timer/grlib_gptimer.c
index 4ed96e9..96a5864 100644
--- a/hw/timer/grlib_gptimer.c
+++ b/hw/timer/grlib_gptimer.c
@@ -235,19 +235,19 @@ static void grlib_gptimer_write(void *opaque, hwaddr addr,
     case SCALER_OFFSET:
         value &= 0xFFFF; /* clean up the value */
         unit->scaler = value;
-        trace_grlib_gptimer_writel(-1, addr, unit->scaler);
+        trace_grlib_gptimer_writel(-1, addr, (uint64_t) unit->scaler);
         return;

     case SCALER_RELOAD_OFFSET:
         value &= 0xFFFF; /* clean up the value */
         unit->reload = value;
-        trace_grlib_gptimer_writel(-1, addr, unit->reload);
+        trace_grlib_gptimer_writel(-1, addr, (uint64_t) unit->reload);
         grlib_gptimer_set_scaler(unit, value);
         return;

     case CONFIG_OFFSET:
         /* Read Only (disable timer freeze not supported) */
-        trace_grlib_gptimer_writel(-1, addr, 0);
+        trace_grlib_gptimer_writel(-1, addr, (uint64_t) 0);
         return;

     default:
diff --git a/hw/timer/trace-events b/hw/timer/trace-events
index d17cfe6..dc4c89c 100644
--- a/hw/timer/trace-events
+++ b/hw/timer/trace-events
@@ -5,7 +5,7 @@ slavio_timer_get_out(uint64_t limit, uint32_t counthigh, uint32_t count) "limit
 slavio_timer_irq(uint32_t counthigh, uint32_t count) "callback: count %x%08x"
 slavio_timer_mem_readl_invalid(uint64_t addr) "invalid read address %"PRIx64
 slavio_timer_mem_readl(uint64_t addr, uint32_t ret) "read %"PRIx64" = %08x"
-slavio_timer_mem_writel(uint64_t addr, uint32_t val) "write %"PRIx64" = %08x"
+slavio_timer_mem_writel(uint64_t addr, uint64_t val) "write %"PRIx64" = %08" PRIx64
 slavio_timer_mem_writel_limit(unsigned int timer_index, uint64_t count) "processor %d user timer set to %016"PRIx64
 slavio_timer_mem_writel_counter_invalid(void) "not user timer"
 slavio_timer_mem_writel_status_start(unsigned int timer_index) "processor %d user timer started"
@@ -22,17 +22,17 @@ grlib_gptimer_restart(int id, uint32_t reload) "timer:%d reload val: 0x%x"
 grlib_gptimer_set_scaler(uint32_t scaler, uint32_t freq) "scaler:0x%x freq: 0x%x"
 grlib_gptimer_hit(int id) "timer:%d HIT"
 grlib_gptimer_readl(int id, uint64_t addr, uint32_t val) "timer:%d addr 0x%"PRIx64" 0x%x"
-grlib_gptimer_writel(int id, uint64_t addr, uint32_t val) "timer:%d addr 0x%"PRIx64" 0x%x"
+grlib_gptimer_writel(int id, uint64_t addr, uint64_t val) "timer:%d addr 0x%"PRIx64" 0x%" PRIx64

 # hw/timer/lm32_timer.c
-lm32_timer_memory_write(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x"
-lm32_timer_memory_read(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x"
+lm32_timer_memory_write(hwaddr addr, uint64_t value) "addr 0x%08" HWADDR_PRIx " value 0x%08" PRIx64
+lm32_timer_memory_read(hwaddr addr, uint32_t value) "addr 0x%08" HWADDR_PRIx " value 0x%08x"
 lm32_timer_hit(void) "timer hit"
 lm32_timer_irq_state(int level) "irq state %d"

 # hw/timer/milkymist-sysctl.c
-milkymist_sysctl_memory_read(uint32_t addr, uint32_t value) "addr %08x value %08x"
-milkymist_sysctl_memory_write(uint32_t addr, uint32_t value) "addr %08x value %08x"
+milkymist_sysctl_memory_read(hwaddr addr, uint32_t value) "addr %08" HWADDR_PRIx " value %08x"
+milkymist_sysctl_memory_write(hwaddr addr, uint64_t value) "addr %08" HWADDR_PRIx " value %08" PRIx64
 milkymist_sysctl_icap_write(uint32_t value) "value %08x"
 milkymist_sysctl_start_timer0(void) "Start timer0"
 milkymist_sysctl_stop_timer0(void) "Stop timer0"
@@ -54,4 +54,4 @@ aspeed_timer_read(uint64_t offset, unsigned size, uint64_t value) "From 0x%" PRI
 systick_reload(void) "systick reload"
 systick_timer_tick(void) "systick reload"
 systick_read(uint64_t addr, uint32_t value, unsigned size) "systick read addr 0x%" PRIx64 " data 0x%" PRIx32 " size %u"
-systick_write(uint64_t addr, uint32_t value, unsigned size) "systick write addr 0x%" PRIx64 " data 0x%" PRIx32 " size %u"
+systick_write(uint64_t addr, uint64_t value, unsigned size) "systick write addr 0x%" PRIx64 " data 0x%" PRIx64 " size %u"
-- 
2.9.3

  parent reply	other threads:[~2017-03-13 19:56 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-13 19:55 [Qemu-devel] [PATCH for-2.9 v2 00/30] trace type mismatch cleanups Eric Blake
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 01/30] trace: Fix backwards mirror_yield parameters Eric Blake
2017-03-16  7:36   ` Stefan Hajnoczi
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 02/30] trace: Fix incorrect megasas trace parameters Eric Blake
2017-03-14  6:49   ` Hannes Reinecke
2017-03-16  7:36   ` Stefan Hajnoczi
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 03/30] trace: Avoid abuse of amdvi_mmio_read Eric Blake
2017-03-16  7:36   ` Stefan Hajnoczi
2017-03-23 15:23   ` Stefan Hajnoczi
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 04/30] trace: Fix parameter types in block Eric Blake
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 05/30] trace: Fix parameter types in io Eric Blake
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 06/30] trace: Fix parameter types in migration Eric Blake
2017-03-13 20:07   ` Dr. David Alan Gilbert
2017-03-13 20:18     ` Eric Blake
2017-03-14 11:32       ` Dr. David Alan Gilbert
2017-03-14 14:36         ` Eric Blake
2017-03-15 19:55           ` Eric Blake
2017-03-15 22:33             ` Eric Blake
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 07/30] trace: Fix parameter types in ui Eric Blake
2017-03-14  9:16   ` Gerd Hoffmann
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 08/30] trace: Fix parameter types in top level Eric Blake
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 09/30] trace: Fix parameter types in linux-user Eric Blake
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 10/30] trace: Fix parameter types in hw/acpi Eric Blake
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 11/30] trace: Fix parameter types in hw/audio Eric Blake
2017-03-14  9:16   ` Gerd Hoffmann
2017-03-22 15:10   ` Eric Blake
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 12/30] trace: Fix parameter types in hw/block Eric Blake
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 13/30] trace: Fix parameter types in hw/char Eric Blake
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 14/30] trace: Fix parameter types in hw/display Eric Blake
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 15/30] trace: Fix parameter types in hw/dma Eric Blake
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 16/30] trace: Fix parameter types in hw/i386 Eric Blake
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 17/30] trace: Fix parameter types in hw/input Eric Blake
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 18/30] trace: Fix parameter types in hw/intc Eric Blake
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 19/30] trace: Fix parameter types in hw/isa Eric Blake
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 20/30] trace: Fix parameter types in hw/misc Eric Blake
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 21/30] trace: Fix parameter types in hw/net Eric Blake
2017-03-14  7:21   ` Dmitry Fleytman
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 22/30] trace: Fix parameter types in hw/nvram Eric Blake
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 23/30] trace: Fix parameter types in hw/ppc Eric Blake
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 24/30] trace: Fix parameter types in hw/sd Eric Blake
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 25/30] trace: Fix parameter types in hw/scsi Eric Blake
2017-03-14  6:50   ` Hannes Reinecke
2017-03-13 19:55 ` Eric Blake [this message]
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 27/30] trace: Fix parameter types in hw/usb Eric Blake
2017-03-14  9:16   ` Gerd Hoffmann
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 28/30] trace: Fix parameter types in hw/vfio Eric Blake
2017-03-13 19:55 ` [Qemu-devel] [PATCH v2 29/30] trace: Fix parameter types in hw/virtio Eric Blake
2017-03-16  7:45   ` Stefan Hajnoczi
2017-03-13 19:55 ` [Qemu-devel] [RFC PATCH v2 30/30] trace: Force compiler warnings on trace parameter type mismatches Eric Blake
2017-03-15 19:59   ` Eric Blake
2017-03-16  7:28     ` Stefan Hajnoczi
2017-03-13 20:27 ` [Qemu-devel] [PATCH for-2.9 v2 00/30] trace type mismatch cleanups no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170313195547.21466-27-eblake@redhat.com \
    --to=eblake@redhat.com \
    --cc=chouteau@adacore.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).