Merge branch 'x86-cache-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / kernel / events / core.c
index ce64f3fed5c64e9f258ce6a97a8cb6b66a8c3fc6..294f1927f944510a951763b3a19c4c6e9f849817 100644 (file)
@@ -3673,10 +3673,7 @@ unlock:
 
 static inline u64 perf_event_count(struct perf_event *event)
 {
-       if (event->pmu->count)
-               return event->pmu->count(event);
-
-       return __perf_event_count(event);
+       return local64_read(&event->count) + atomic64_read(&event->child_count);
 }
 
 /*
@@ -3707,15 +3704,6 @@ int perf_event_read_local(struct perf_event *event, u64 *value)
                goto out;
        }
 
-       /*
-        * It must not have a pmu::count method, those are not
-        * NMI safe.
-        */
-       if (event->pmu->count) {
-               ret = -EOPNOTSUPP;
-               goto out;
-       }
-
        /* If this is a per-task event, it must be for current */
        if ((event->attach_state & PERF_ATTACH_TASK) &&
            event->hw.target != current) {