qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 2/3] hw/mips/gt64xxx: Remove dynamic field width from trac


From: Eric Blake
Subject: Re: [PATCH v2 2/3] hw/mips/gt64xxx: Remove dynamic field width from trace events
Date: Mon, 18 Nov 2019 13:15:54 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1

On 11/18/19 1:10 PM, Philippe Mathieu-Daudé wrote:

-        trace_gt64120_write("INTRCAUSE", size << 1, val);
+        trace_gt64120_write("INTRCAUSE", size << 3, val);

Again, this isn't mentioned in the commit message.  Why are you changing parameter values?


+++ b/hw/mips/trace-events
@@ -1,4 +1,4 @@
  # gt64xxx.c
-gt64120_read(const char *regname, int width, uint64_t value) "gt64120 read %s value:0x%0*" PRIx64 -gt64120_write(const char *regname, int width, uint64_t value) "gt64120 write %s value:0x%0*" PRIx64 +gt64120_read(const char *regname, int width, uint64_t value) "gt64120 read %s width:%d value:0x%08" PRIx64 +gt64120_write(const char *regname, int width, uint64_t value) "gt64120 write %s width:%d value:0x%08" PRIx64

Huh, we were really broken - the old code (if passed to printf) would try to parse 4 parameters, even though it was only passed 3.  But it looks like you still need a v3.

Oops. I am surprise the compiler doesn't emit a warning here...

I'm sorry I can't see the 4th parameter.

My fault for chasing a red herring. I guess I was mixing the three % post-patch with the two % and one * pre-patch, and somehow mis-counting three % plus one * as four arguments. But re-reading your confusion, yes, there were only three parameters being consumed.


Before: "gt64120 read %s value:0x%0*" PRIx64

#1 's' for 'const char *regname'
#2 '0*' for 'int width'
#3 'x' for 'uint64_t value'

After: "gt64120 read %s width:%d value:0x%08" PRIx64

#1 's' for 'const char *regname'
#2 'd' for 'int width'
#3 '08x' for 'uint64_t value'

Am I missing something?

Rather, I was.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]