perf: define EVENT_DEFINE_RANGE_FORMAT_LITE helper
authorsukadev@linux.vnet.ibm.com <sukadev@linux.vnet.ibm.com>
Fri, 30 Jan 2015 21:45:59 +0000 (13:45 -0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 2 Feb 2015 06:56:38 +0000 (17:56 +1100)
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>
arch/powerpc/perf/hv-common.h

index 5d79cecbd73da1d7eb370d245aacb5fa8029d738..349aaba4d2d1102b02bf7dd6798a3f33b4bbdd9d 100644 (file)
@@ -20,6 +20,16 @@ unsigned long hv_perf_caps_get(struct hv_perf_caps *caps);
 PMU_FORMAT_ATTR(name, #attr_var ":" #bit_start "-" #bit_end);          \
 EVENT_DEFINE_RANGE(name, attr_var, bit_start, bit_end)
 
+/*
+ * The EVENT_DEFINE_RANGE_FORMAT() macro above includes helper functions
+ * for the fields (eg: event_get_starting_index()). For some fields we
+ * need the bit-range definition, but no the helper functions. Define a
+ * lite version of the above macro without the helpers and silence
+ * compiler warnings unused static functions.
+ */
+#define EVENT_DEFINE_RANGE_FORMAT_LITE(name, attr_var, bit_start, bit_end) \
+PMU_FORMAT_ATTR(name, #attr_var ":" #bit_start "-" #bit_end);
+
 #define EVENT_DEFINE_RANGE(name, attr_var, bit_start, bit_end) \
 static u64 event_get_##name##_max(void)                                        \
 {                                                                      \