[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC v2 04/22] block/pcache: add pcache debug bui
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH RFC v2 04/22] block/pcache: add pcache debug build |
Date: |
Thu, 8 Sep 2016 13:42:59 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
On 09/08/2016 11:05 AM, Pavel Butsykin wrote:
>>>
>>> #ifdef PCACHE_DEBUG
>>> # define PCACHE_DEBUG_PRINT 1
>>> #else
>>> # define PCACHE_DEBUG_PRINT 0
>>> #endif
>>> #define DPRINTF(fmt, ...) \
>>> do { \
>>> if (PCACHE_DEBUG_PRINT) { \
>>> fprintf(stderr, ... __VA_ARGS__) \
>>> } \
>>> } while (0)
>>>
>>
>> OK, thanks!
>
> Can I replace DPRINTFs on tracepoints?
>
Yes, tracepoints are even better than conditional printfs. They are a
bit trickier to set up, but more powerful in the end. And they are
equally immune to the bitrot that I was trying to prevent with your
definition of DPRINTF.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature