qemu-devel
[Top][All Lists]
Advanced

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

better file/line info for format string errors in trace events


From: Peter Maydell
Subject: better file/line info for format string errors in trace events
Date: Tue, 25 Aug 2020 22:49:08 +0100

If you have a format string error in a trace event it fails
like this:

In file included from ../../hw/block/trace.h:1:0,
                 from ../../hw/block/fdc.c:48:
./trace/trace-hw_block.h: In function '_nocheck__trace_pci_nvme_err_mdts':
./trace/trace-hw_block.h:2162:18: error: format '%llu' expects
argument of type 'long long unsigned int', but argument 6 has type
'size_t {aka unsigned int}' [-Werror=format=]
         qemu_log("%d@%zu.%06zu:pci_nvme_err_mdts " "cid %"PRIu16" len
%"PRIu64"" "\n",
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/peter.maydell/qemu/include/qemu/osdep.h:89:0,
                 from ../../hw/block/fdc.c:30:
/usr/include/inttypes.h:105:34: note: format string is defined here
 # define PRIu64  __PRI64_PREFIX "u"


which doesn't anywhere give the filename where the format
string is actually defined (hw/block/trace-events in this case),
let alone the line number in that file of the trace event.

Bit of a long shot, but I don't suppose it's possible for the
tracing subsystem to give more targeted error messages in this
situation ?

thanks
-- PMM



reply via email to

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