Re: [RFC][PATCH] perf tools: unify perf_event_attr printing

From: Jiri Olsa
Date: Thu Apr 02 2015 - 05:20:32 EST


On Wed, Apr 01, 2015 at 06:26:38PM +0200, Peter Zijlstra wrote:

SNIP

> - ret += PRINT_ATTR_U32(wakeup_events);
> - ret += PRINT_ATTR_U32(wakeup_watermark);
> - ret += PRINT_ATTR_X32(bp_type);
> - ret += PRINT_ATTR_X64(bp_addr);
> - ret += PRINT_ATTR_X64(config1);
> - ret += PRINT_ATTR_U64(bp_len);
> - ret += PRINT_ATTR_X64(config2);
> - ret += PRINT_ATTR_X64(branch_sample_type);
> - ret += PRINT_ATTR_X64(sample_regs_user);
> - ret += PRINT_ATTR_U32(sample_stack_user);
> - ret += PRINT_ATTR_U32(clockid);
> - ret += PRINT_ATTR_X64(sample_regs_intr);
> +#define PRINT_ATTR(_n, _f, _p) \
> +do { \
> + if (attr->_f) { \
> + ret += fprintf(fp, " %-32s ", _n); \
> + ret += _p(fp, attr->_f); \
> + ret += fprintf(fp, "\n"); \

missing indent ;-) other it seems ok

Acked-by: Jiri Olsa <jolsa@xxxxxxxxxx>

jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/