@@ -1219,21 +1219,22 @@ static int perf_mux_hrtimer_restart_ipi(void *arg)
1219
1219
1220
1220
void perf_pmu_disable (struct pmu * pmu )
1221
1221
{
1222
- int * count = this_cpu_ptr (pmu -> pmu_disable_count ) ;
1222
+ int * count = & this_cpu_ptr (pmu -> cpu_pmu_context ) -> pmu_disable_count ;
1223
1223
if (!(* count )++ )
1224
1224
pmu -> pmu_disable (pmu );
1225
1225
}
1226
1226
1227
1227
void perf_pmu_enable (struct pmu * pmu )
1228
1228
{
1229
- int * count = this_cpu_ptr (pmu -> pmu_disable_count ) ;
1229
+ int * count = & this_cpu_ptr (pmu -> cpu_pmu_context ) -> pmu_disable_count ;
1230
1230
if (!-- (* count ))
1231
1231
pmu -> pmu_enable (pmu );
1232
1232
}
1233
1233
1234
1234
static void perf_assert_pmu_disabled (struct pmu * pmu )
1235
1235
{
1236
- WARN_ON_ONCE (* this_cpu_ptr (pmu -> pmu_disable_count ) == 0 );
1236
+ int * count = & this_cpu_ptr (pmu -> cpu_pmu_context )-> pmu_disable_count ;
1237
+ WARN_ON_ONCE (* count == 0 );
1237
1238
}
1238
1239
1239
1240
static inline void perf_pmu_read (struct perf_event * event )
@@ -11906,7 +11907,6 @@ static bool idr_cmpxchg(struct idr *idr, unsigned long id, void *old, void *new)
11906
11907
11907
11908
static void perf_pmu_free (struct pmu * pmu )
11908
11909
{
11909
- free_percpu (pmu -> pmu_disable_count );
11910
11910
if (pmu_bus_running && pmu -> dev && pmu -> dev != PMU_NULL_DEV ) {
11911
11911
if (pmu -> nr_addr_filters )
11912
11912
device_remove_file (pmu -> dev , & dev_attr_nr_addr_filters );
@@ -11925,10 +11925,6 @@ int perf_pmu_register(struct pmu *_pmu, const char *name, int type)
11925
11925
struct pmu * pmu __free (pmu_unregister ) = _pmu ;
11926
11926
guard (mutex )(& pmus_lock );
11927
11927
11928
- pmu -> pmu_disable_count = alloc_percpu (int );
11929
- if (!pmu -> pmu_disable_count )
11930
- return - ENOMEM ;
11931
-
11932
11928
if (WARN_ONCE (!name , "Can not register anonymous pmu.\n" ))
11933
11929
return - EINVAL ;
11934
11930
0 commit comments