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
