File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 8
8
#include <unistd.h>
9
9
#include <api/fs/fs.h>
10
10
#include <linux/kernel.h>
11
+ #include "cpumap.h"
11
12
#include "map_symbol.h"
12
13
#include "mem-events.h"
13
14
#include "mem-info.h"
@@ -242,6 +243,7 @@ int perf_mem_events__record_args(const char **rec_argv, int *argv_nr)
242
243
int i = * argv_nr ;
243
244
const char * s ;
244
245
char * copy ;
246
+ struct perf_cpu_map * cpu_map = NULL ;
245
247
246
248
while ((pmu = perf_pmus__scan_mem (pmu )) != NULL ) {
247
249
for (int j = 0 ; j < PERF_MEM_EVENTS__MAX ; j ++ ) {
@@ -266,7 +268,19 @@ int perf_mem_events__record_args(const char **rec_argv, int *argv_nr)
266
268
267
269
rec_argv [i ++ ] = "-e" ;
268
270
rec_argv [i ++ ] = copy ;
271
+
272
+ cpu_map = perf_cpu_map__merge (cpu_map , pmu -> cpus );
273
+ }
274
+ }
275
+
276
+ if (cpu_map ) {
277
+ if (!perf_cpu_map__equal (cpu_map , cpu_map__online ())) {
278
+ char buf [200 ];
279
+
280
+ cpu_map__snprint (cpu_map , buf , sizeof (buf ));
281
+ pr_warning ("Memory events are enabled on a subset of CPUs: %s\n" , buf );
269
282
}
283
+ perf_cpu_map__put (cpu_map );
270
284
}
271
285
272
286
* argv_nr = i ;
You can’t perform that action at this time.
0 commit comments