On 13/12/2018 17:34, Eric Blake wrote:
> On 12/13/18 10:27 AM, Laurent Vivier wrote:
>> Signed-off-by: Laurent Vivier <[email protected]>
>> Reviewed-by: Richard W.M. Jones <[email protected]>
>> Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
>> ---
>>
>> Notes:
>> v2: use %zu with size_t
>> change an uint64_t to int64_t to match % PRIi64
>
> Why PRIi64? It's identical to PRId64, but the sources show a strong
> preference for %d over %i:
>
> $ git grep PRIi[0-9] | wc
> 25 172 1885
> $ git grep PRId[0-9] | wc
> 415 3991 40345
>
> $ git grep '%i' | wc
> 231 1664 18269
> $ git grep '%d' | wc
> 5492 46211 498225
>
Yes, you're right but I have only moved the existing format string[1] to
trace-event:
diff --git a/block/ssh.c b/block/ssh.c
--- a/block/ssh.c
+++ b/block/ssh.c
@@ -1003,7 +991,7 @@ static void ssh_seek(BDRVSSHState *s, int64_t
offset, int flags)
bool force = (flags & SSH_SEEK_FORCE) != 0;
if (force || op_read != s->offset_op_read || offset != s->offset) {
- DPRINTF("seeking to offset=%" PRIi64, offset);
+ trace_ssh_seek(offset);
diff --git a/block/trace-events b/block/trace-events
--- a/block/trace-events
+++ b/block/trace-events
...
+ssh_seek(int64_t offset) "seeking to offset=%" PRIi64
Thanks,
Laurent
[1] in fact, I have a coccinelle script to do that automatically.