@@ -1218,6 +1218,8 @@ static inline bool fixed_counter_disabled(int i, struct pmu *pmu)
1218
1218
#ifdef CONFIG_CPU_SUP_AMD
1219
1219
1220
1220
int amd_pmu_init (void );
1221
+
1222
+ #ifdef CONFIG_PERF_EVENTS_AMD_BRS
1221
1223
int amd_brs_init (void );
1222
1224
void amd_brs_disable (void );
1223
1225
void amd_brs_enable (void );
@@ -1252,25 +1254,52 @@ static inline void amd_pmu_brs_del(struct perf_event *event)
1252
1254
1253
1255
void amd_pmu_brs_sched_task (struct perf_event_context * ctx , bool sched_in );
1254
1256
1255
- /*
1256
- * check if BRS is activated on the CPU
1257
- * active defined as it has non-zero users and DBG_EXT_CFG.BRSEN=1
1258
- */
1259
- static inline bool amd_brs_active (void )
1257
+ static inline s64 amd_brs_adjust_period (s64 period )
1260
1258
{
1261
- struct cpu_hw_events * cpuc = this_cpu_ptr (& cpu_hw_events );
1259
+ if (period > x86_pmu .lbr_nr )
1260
+ return period - x86_pmu .lbr_nr ;
1262
1261
1263
- return cpuc -> brs_active ;
1262
+ return period ;
1263
+ }
1264
+ #else
1265
+ static inline int amd_brs_init (void )
1266
+ {
1267
+ return 0 ;
1264
1268
}
1269
+ static inline void amd_brs_disable (void ) {}
1270
+ static inline void amd_brs_enable (void ) {}
1271
+ static inline void amd_brs_drain (void ) {}
1272
+ static inline void amd_brs_lopwr_init (void ) {}
1273
+ static inline void amd_brs_disable_all (void ) {}
1274
+ static inline int amd_brs_setup_filter (struct perf_event * event )
1275
+ {
1276
+ return 0 ;
1277
+ }
1278
+ static inline void amd_brs_reset (void ) {}
1265
1279
1266
- static inline s64 amd_brs_adjust_period ( s64 period )
1280
+ static inline void amd_pmu_brs_add ( struct perf_event * event )
1267
1281
{
1268
- if (period > x86_pmu .lbr_nr )
1269
- return period - x86_pmu .lbr_nr ;
1282
+ }
1283
+
1284
+ static inline void amd_pmu_brs_del (struct perf_event * event )
1285
+ {
1286
+ }
1287
+
1288
+ static inline void amd_pmu_brs_sched_task (struct perf_event_context * ctx , bool sched_in )
1289
+ {
1290
+ }
1270
1291
1292
+ static inline s64 amd_brs_adjust_period (s64 period )
1293
+ {
1271
1294
return period ;
1272
1295
}
1273
1296
1297
+ static inline void amd_brs_enable_all (void )
1298
+ {
1299
+ }
1300
+
1301
+ #endif
1302
+
1274
1303
#else /* CONFIG_CPU_SUP_AMD */
1275
1304
1276
1305
static inline int amd_pmu_init (void )
0 commit comments