lkml.org 
[lkml]   [2009]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH tracing/kprobes v4] perf: Add perf probe subcommand for kprobe-event setup helper
Frederic Weisbecker wrote:
> On Thu, Oct 08, 2009 at 05:17:38PM -0400, Masami Hiramatsu wrote:
>> +#ifdef DEBUG
>> +#define debug(fmt ...) \
>> + fprintf(stderr, "DBG(" __FILE__ ":" stringify(__LINE__) "): " fmt)
>> +#else
>> +#define debug(fmt ...) do {} while (0)
>> +#endif
>
>
>
> We have that too:
>
> int eprintf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
> int dump_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));

Thanks, I'll use that.

>> +#define ERR_IF(cnd) \
>> + do { if (cnd) { \
>> + fprintf(stderr, "Error (" __FILE__ ":" stringify(__LINE__) \
>> + "): " stringify(cnd) "\n"); \
>> + exit(1); \
>> + } } while (0)
>
>
> And that would be nice to have in util/debug.h but more
> perhaps more as a DIE_IF()
>

Sure :-)

Thank you,

--
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com



\
 
 \ /
  Last update: 2009-10-12 21:03    [W:0.468 / U:0.660 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site