The Cavium ThunderX2 UNCORE PMU driver doesn't support any event
filtering. Let's advertise the PERF_PMU_CAP_NO_EXCLUDE capability to
simplify the code.

Signed-off-by: Andrew Murray <andrew.mur...@arm.com>
---
 drivers/perf/thunderx2_pmu.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/perf/thunderx2_pmu.c b/drivers/perf/thunderx2_pmu.c
index c9a1701..43d76c8 100644
--- a/drivers/perf/thunderx2_pmu.c
+++ b/drivers/perf/thunderx2_pmu.c
@@ -424,15 +424,6 @@ static int tx2_uncore_event_init(struct perf_event *event)
        if (is_sampling_event(event) || event->attach_state & PERF_ATTACH_TASK)
                return -EINVAL;
 
-       /* We have no filtering of any kind */
-       if (event->attr.exclude_user    ||
-           event->attr.exclude_kernel  ||
-           event->attr.exclude_hv      ||
-           event->attr.exclude_idle    ||
-           event->attr.exclude_host    ||
-           event->attr.exclude_guest)
-               return -EINVAL;
-
        if (event->cpu < 0)
                return -EINVAL;
 
@@ -572,6 +563,7 @@ static int tx2_uncore_pmu_register(
                .start          = tx2_uncore_event_start,
                .stop           = tx2_uncore_event_stop,
                .read           = tx2_uncore_event_read,
+               .capabilities   = PERF_PMU_CAP_NO_EXCLUDE,
        };
 
        tx2_pmu->pmu.name = devm_kasprintf(dev, GFP_KERNEL,
-- 
2.7.4

Reply via email to