Re: [PATCH] qed: Add and use specific logging functions to reduce object size
From: Joe Perches
Date: Tue Jul 26 2016 - 21:24:21 EST
On Tue, 2016-07-26 at 14:25 -0700, Joe Perches wrote:
> Current DP_ macros generate a lot of code.
> Using functions with vsprintf extension %pV helps reduce that size.
Yuval, I used the same KERN_<LEVEL> output types, but it
is unusual that DP_INFO outputs at KERN_NOTICE.
Was that a copy/paste defect or should it be emitted at
KERN_INFO and DP_VERBOSE be emitted at KERN_DEBUG?
> define DP_INFO(cdev, fmt, ...) \
> - do { \
> - if (unlikely((cdev)->dp_level <= QED_LEVEL_INFO)) { \
> - pr_notice("[%s:%d(%s)]" fmt, \
> - __func__, __LINE__, \
> - DP_NAME(cdev) ? DP_NAME(cdev) : "", \
> - ## __VA_ARGS__); \
> - } \
> - } while (0)
[]
> -#define DP_VERBOSE(cdev, module, fmt, ...) \
> - do { \
> - if (unlikely(((cdev)->dp_level <= QED_LEVEL_VERBOSE) && \
> - ((cdev)->dp_module & module))) { \
> - pr_notice("[%s:%d(%s)]" fmt, \
> - __func__, __LINE__, \
> - DP_NAME(cdev) ? DP_NAME(cdev) : "", \
> - ## __VA_ARGS__); \
> - } \
> - } while (0)