perf: Add helper function to return number of counters
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / sh / kernel / perf_event.c
index 7a3dc356725839f2cf8579491efd8d02ba11b483..2cb9ad59d4b1bf3b8b8e74fe8303f25accdee753 100644 (file)
@@ -59,6 +59,15 @@ static inline int sh_pmu_initialized(void)
        return !!sh_pmu;
 }
 
+int perf_num_counters(void)
+{
+       if (!sh_pmu)
+               return 0;
+
+       return sh_pmu->num_events;
+}
+EXPORT_SYMBOL_GPL(perf_num_counters);
+
 /*
  * Release the PMU if this is the last perf_event.
  */