hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/tools/perf/bench/futex-requeue.c
....@@ -20,9 +20,10 @@
2020 #include <linux/kernel.h>
2121 #include <linux/time64.h>
2222 #include <errno.h>
23
+#include <internal/cpumap.h>
24
+#include <perf/cpumap.h>
2325 #include "bench.h"
2426 #include "futex.h"
25
-#include "cpumap.h"
2627
2728 #include <err.h>
2829 #include <stdlib.h>
....@@ -84,7 +85,7 @@
8485 }
8586
8687 static void block_threads(pthread_t *w,
87
- pthread_attr_t thread_attr, struct cpu_map *cpu)
88
+ pthread_attr_t thread_attr, struct perf_cpu_map *cpu)
8889 {
8990 cpu_set_t cpuset;
9091 unsigned int i;
....@@ -117,16 +118,17 @@
117118 unsigned int i, j;
118119 struct sigaction act;
119120 pthread_attr_t thread_attr;
120
- struct cpu_map *cpu;
121
+ struct perf_cpu_map *cpu;
121122
122123 argc = parse_options(argc, argv, options, bench_futex_requeue_usage, 0);
123124 if (argc)
124125 goto err;
125126
126
- cpu = cpu_map__new(NULL);
127
+ cpu = perf_cpu_map__new(NULL);
127128 if (!cpu)
128129 err(EXIT_FAILURE, "cpu_map__new");
129130
131
+ memset(&act, 0, sizeof(act));
130132 sigfillset(&act.sa_mask);
131133 act.sa_sigaction = toggle_done;
132134 sigaction(SIGINT, &act, NULL);
....@@ -214,6 +216,7 @@
214216 print_summary();
215217
216218 free(worker);
219
+ perf_cpu_map__put(cpu);
217220 return ret;
218221 err:
219222 usage_with_options(bench_futex_requeue_usage, options);