Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf: define EVENT_DEFINE_RANGE_FORMAT_LITE helper

Define a lite version of the EVENT_DEFINE_RANGE_FORMAT() that avoids
defining helper functions for the bit-field ranges.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

sukadev@linux.vnet.ibm.com and committed by
Michael Ellerman
e08e5282 f0405b81

+10
+10
arch/powerpc/perf/hv-common.h
··· 20 20 PMU_FORMAT_ATTR(name, #attr_var ":" #bit_start "-" #bit_end); \ 21 21 EVENT_DEFINE_RANGE(name, attr_var, bit_start, bit_end) 22 22 23 + /* 24 + * The EVENT_DEFINE_RANGE_FORMAT() macro above includes helper functions 25 + * for the fields (eg: event_get_starting_index()). For some fields we 26 + * need the bit-range definition, but no the helper functions. Define a 27 + * lite version of the above macro without the helpers and silence 28 + * compiler warnings unused static functions. 29 + */ 30 + #define EVENT_DEFINE_RANGE_FORMAT_LITE(name, attr_var, bit_start, bit_end) \ 31 + PMU_FORMAT_ATTR(name, #attr_var ":" #bit_start "-" #bit_end); 32 + 23 33 #define EVENT_DEFINE_RANGE(name, attr_var, bit_start, bit_end) \ 24 34 static u64 event_get_##name##_max(void) \ 25 35 { \