[PATCH] hw/remote: Fix vfu_cfg trace offset format

Mattias Nissler posted 1 patch 1 year ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230426093518.966397-1-mnissler@rivosinc.com
hw/remote/trace-events | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] hw/remote: Fix vfu_cfg trace offset format
Posted by Mattias Nissler 1 year ago
The printed offset value is prefixed with 0x, but was actually printed
in decimal. To spare others the confusion, adjust the format specifier
to hexadecimal.

Signed-off-by: Mattias Nissler <mnissler@rivosinc.com>
---
 hw/remote/trace-events | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/remote/trace-events b/hw/remote/trace-events
index c167b3c7a5..0d1b7d56a5 100644
--- a/hw/remote/trace-events
+++ b/hw/remote/trace-events
@@ -5,8 +5,8 @@ mpqemu_recv_io_error(int cmd, int size, int nfds) "failed to receive %d size %d,
 
 # vfio-user-obj.c
 vfu_prop(const char *prop, const char *val) "vfu: setting %s as %s"
-vfu_cfg_read(uint32_t offset, uint32_t val) "vfu: cfg: 0x%u -> 0x%x"
-vfu_cfg_write(uint32_t offset, uint32_t val) "vfu: cfg: 0x%u <- 0x%x"
+vfu_cfg_read(uint32_t offset, uint32_t val) "vfu: cfg: 0x%x -> 0x%x"
+vfu_cfg_write(uint32_t offset, uint32_t val) "vfu: cfg: 0x%x <- 0x%x"
 vfu_dma_register(uint64_t gpa, size_t len) "vfu: registering GPA 0x%"PRIx64", %zu bytes"
 vfu_dma_unregister(uint64_t gpa) "vfu: unregistering GPA 0x%"PRIx64""
 vfu_bar_register(int i, uint64_t addr, uint64_t size) "vfu: BAR %d: addr 0x%"PRIx64" size 0x%"PRIx64""
-- 
2.25.1
Re: [PATCH] hw/remote: Fix vfu_cfg trace offset format
Posted by Philippe Mathieu-Daudé 1 year ago
On 26/4/23 11:35, Mattias Nissler wrote:
> The printed offset value is prefixed with 0x, but was actually printed
> in decimal. To spare others the confusion, adjust the format specifier
> to hexadecimal.
> 
> Signed-off-by: Mattias Nissler <mnissler@rivosinc.com>
> ---
>   hw/remote/trace-events | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>


Re: [PATCH] hw/remote: Fix vfu_cfg trace offset format
Posted by Jag Raman 1 year ago
Thank you!

> On Apr 26, 2023, at 5:35 AM, Mattias Nissler <mnissler@rivosinc.com> wrote:
> 
> The printed offset value is prefixed with 0x, but was actually printed
> in decimal. To spare others the confusion, adjust the format specifier
> to hexadecimal.
> 
> Signed-off-by: Mattias Nissler <mnissler@rivosinc.com>

Reviewed-by: Jagannathan Raman <jag.raman@oracle.com>

> ---
> hw/remote/trace-events | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/remote/trace-events b/hw/remote/trace-events
> index c167b3c7a5..0d1b7d56a5 100644
> --- a/hw/remote/trace-events
> +++ b/hw/remote/trace-events
> @@ -5,8 +5,8 @@ mpqemu_recv_io_error(int cmd, int size, int nfds) "failed to receive %d size %d,
> 
> # vfio-user-obj.c
> vfu_prop(const char *prop, const char *val) "vfu: setting %s as %s"
> -vfu_cfg_read(uint32_t offset, uint32_t val) "vfu: cfg: 0x%u -> 0x%x"
> -vfu_cfg_write(uint32_t offset, uint32_t val) "vfu: cfg: 0x%u <- 0x%x"
> +vfu_cfg_read(uint32_t offset, uint32_t val) "vfu: cfg: 0x%x -> 0x%x"
> +vfu_cfg_write(uint32_t offset, uint32_t val) "vfu: cfg: 0x%x <- 0x%x"
> vfu_dma_register(uint64_t gpa, size_t len) "vfu: registering GPA 0x%"PRIx64", %zu bytes"
> vfu_dma_unregister(uint64_t gpa) "vfu: unregistering GPA 0x%"PRIx64""
> vfu_bar_register(int i, uint64_t addr, uint64_t size) "vfu: BAR %d: addr 0x%"PRIx64" size 0x%"PRIx64""
> -- 
> 2.25.1
>