hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/tools/perf/bench/futex-wake-parallel.c
....@@ -29,7 +29,8 @@
2929 #include <linux/time64.h>
3030 #include <errno.h>
3131 #include "futex.h"
32
-#include "cpumap.h"
32
+#include <internal/cpumap.h>
33
+#include <perf/cpumap.h>
3334
3435 #include <err.h>
3536 #include <stdlib.h>
....@@ -138,7 +139,7 @@
138139 }
139140
140141 static void block_threads(pthread_t *w, pthread_attr_t thread_attr,
141
- struct cpu_map *cpu)
142
+ struct perf_cpu_map *cpu)
142143 {
143144 cpu_set_t cpuset;
144145 unsigned int i;
....@@ -224,7 +225,7 @@
224225 struct sigaction act;
225226 pthread_attr_t thread_attr;
226227 struct thread_data *waking_worker;
227
- struct cpu_map *cpu;
228
+ struct perf_cpu_map *cpu;
228229
229230 argc = parse_options(argc, argv, options,
230231 bench_futex_wake_parallel_usage, 0);
....@@ -233,11 +234,12 @@
233234 exit(EXIT_FAILURE);
234235 }
235236
237
+ memset(&act, 0, sizeof(act));
236238 sigfillset(&act.sa_mask);
237239 act.sa_sigaction = toggle_done;
238240 sigaction(SIGINT, &act, NULL);
239241
240
- cpu = cpu_map__new(NULL);
242
+ cpu = perf_cpu_map__new(NULL);
241243 if (!cpu)
242244 err(EXIT_FAILURE, "calloc");
243245
....@@ -318,6 +320,7 @@
318320 print_summary();
319321
320322 free(blocked_worker);
323
+ perf_cpu_map__put(cpu);
321324 return ret;
322325 }
323326 #endif /* HAVE_PTHREAD_BARRIER */