From: Laurent Vivier <lvivier@redhat.com>
To: Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org
Cc: "Kevin Wolf" <kwolf@redhat.com>,
qemu-block@nongnu.org, "Richard W.M. Jones" <rjones@redhat.com>,
qemu-trivial@nongnu.org,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Max Reitz" <mreitz@redhat.com>,
"Liu Yuan" <namei.unix@gmail.com>
Subject: Re: [Qemu-devel] [PATCH v2 1/4] block/ssh: Convert from DPRINTF() macro to trace events
Date: Thu, 13 Dec 2018 17:49:35 +0100 [thread overview]
Message-ID: <f0d5df55-e612-a7ac-35db-b32a82157252@redhat.com> (raw)
In-Reply-To: <827ac081-587f-d365-b682-3a65271a0a4a@redhat.com>
On 13/12/2018 17:34, Eric Blake wrote:
> On 12/13/18 10:27 AM, Laurent Vivier wrote:
>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>> Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
>> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>>
>> 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.
next prev parent reply other threads:[~2018-12-13 16:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-13 16:27 [Qemu-devel] [PATCH v2 0/4] block: Convert from DPRINTF() macro to trace event Laurent Vivier
2018-12-13 16:27 ` [Qemu-devel] [PATCH v2 1/4] block/ssh: Convert from DPRINTF() macro to trace events Laurent Vivier
2018-12-13 16:34 ` Eric Blake
2018-12-13 16:49 ` Laurent Vivier [this message]
2019-01-14 11:15 ` Max Reitz
2019-01-14 11:23 ` Philippe Mathieu-Daudé
2018-12-13 16:27 ` [Qemu-devel] [PATCH v2 2/4] block/curl: " Laurent Vivier
2018-12-13 16:27 ` [Qemu-devel] [PATCH v2 3/4] block/file-posix: " Laurent Vivier
2018-12-13 16:27 ` [Qemu-devel] [PATCH v2 4/4] block/sheepdog: " Laurent Vivier
2019-01-14 11:51 ` Max Reitz
2019-01-14 12:14 ` [Qemu-devel] [PATCH v2 0/4] block: Convert from DPRINTF() macro to trace event Max Reitz
2019-01-14 12:26 ` Philippe Mathieu-Daudé
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=f0d5df55-e612-a7ac-35db-b32a82157252@redhat.com \
--to=lvivier@redhat.com \
--cc=eblake@redhat.com \
--cc=f4bug@amsat.org \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=namei.unix@gmail.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=rjones@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).