From: Liam Merwick <liam.merwick@oracle.com>
To: "Stefan Berger" <stefanb@linux.ibm.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@redhat.com>, liam.merwick@oracle.com
Subject: Re: [Qemu-devel] [PATCH v2 3/3] tpm_tis: fix format string specifier in tpm_tis_show_buffer()
Date: Tue, 12 Feb 2019 13:43:54 +0000 [thread overview]
Message-ID: <7339d38a-74b7-bac8-677f-a27b88226453@oracle.com> (raw)
In-Reply-To: <113577fd-71c8-972f-b658-635d3decd62d@linux.ibm.com>
On 12/02/2019 13:27, Stefan Berger wrote:
> On 2/12/19 7:31 AM, Philippe Mathieu-Daudé wrote:
>> On 2/11/19 10:13 PM, Stefan Berger wrote:
>>> On 2/11/19 3:09 PM, Liam Merwick wrote:
>>>> On 11/02/2019 19:56, Stefan Berger wrote:
>>>>> On 2/11/19 11:02 AM, Philippe Mathieu-Daudé wrote:
>>>>>> On 2/11/19 4:03 PM, Liam Merwick wrote:
>> [...]
>>>>>>> - printf("tpm_tis: %s length = %d\n", string, len);
>>>>>>> + printf("tpm_tis: %s length = %u\n", string, len);
>>>>>> So here the format is '%zu'.
>>>>>> However in code cleanup we try go get ride of printf() calls and
>>>>>> replace them with trace points.
>>>>>
>>>>> This code is only used for debugging if DEBUG_TIS has been #defined.
>>>>> No need to add tracing here.
>>>> I'd come up the attached change (but that seems like overkill).
>>>
>>> I don't think we need tracing for this.
>> So if you think the code is mature enough, let's remove the DEBUG calls!
>>
>> Else we prefer to convert DEBUG printf to trace events because (at
>> least):
>> - no need to recompile to enable debugging
>> - when compiled with debugging, you don't mess with STDIO which can be
>> used as a chardev backend.
> Fine. Then I withdraw my reviewed-by.
I don't see a way of removing the DEBUG calls without adding the
overhead of a call to tpm_tis_show_buffer() each time even if tracing is
not enabled (the 3 trace calls are interdependent and need a for loop).
Is there any example of a trace point that calls a function that then
does non-trivial printing?
I could send a v3 with the patch I attached previously with the 3 printf
calls changed to trace points but still wrapped in 'if (DEBUG_TIS)' and
optimised out in non-debug.
Regards,
Liam
next prev parent reply other threads:[~2019-02-12 13:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-11 15:03 [Qemu-devel] [PATCH v2 1/3] tpm_tis: fix loop that cancels any seizure by a lower locality Liam Merwick
2019-02-11 15:03 ` [Qemu-devel] [PATCH v2 2/3] tpm_tis: assert valid addr passed to tpm_tis_locality_from_addr() Liam Merwick
2019-02-12 17:29 ` Stefan Berger
2019-02-11 15:03 ` [Qemu-devel] [PATCH v2 3/3] tpm_tis: fix format string specifier in tpm_tis_show_buffer() Liam Merwick
2019-02-11 16:02 ` Philippe Mathieu-Daudé
2019-02-11 19:56 ` Stefan Berger
2019-02-11 20:09 ` Liam Merwick
2019-02-11 21:13 ` Stefan Berger
2019-02-12 12:31 ` Philippe Mathieu-Daudé
2019-02-12 13:27 ` Stefan Berger
2019-02-12 13:43 ` Liam Merwick [this message]
2019-02-12 14:32 ` Philippe Mathieu-Daudé
2019-02-12 12:02 ` Stefan Berger
2019-02-11 20:53 ` [Qemu-devel] [PATCH v2 1/3] tpm_tis: fix loop that cancels any seizure by a lower locality Stefan Berger
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=7339d38a-74b7-bac8-677f-a27b88226453@oracle.com \
--to=liam.merwick@oracle.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanb@linux.ibm.com \
--cc=stefanha@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).