hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/tools/perf/bench/futex-wake.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>
....@@ -90,7 +91,7 @@
9091 }
9192
9293 static void block_threads(pthread_t *w,
93
- pthread_attr_t thread_attr, struct cpu_map *cpu)
94
+ pthread_attr_t thread_attr, struct perf_cpu_map *cpu)
9495 {
9596 cpu_set_t cpuset;
9697 unsigned int i;
....@@ -123,7 +124,7 @@
123124 unsigned int i, j;
124125 struct sigaction act;
125126 pthread_attr_t thread_attr;
126
- struct cpu_map *cpu;
127
+ struct perf_cpu_map *cpu;
127128
128129 argc = parse_options(argc, argv, options, bench_futex_wake_usage, 0);
129130 if (argc) {
....@@ -131,10 +132,11 @@
131132 exit(EXIT_FAILURE);
132133 }
133134
134
- cpu = cpu_map__new(NULL);
135
+ cpu = perf_cpu_map__new(NULL);
135136 if (!cpu)
136137 err(EXIT_FAILURE, "calloc");
137138
139
+ memset(&act, 0, sizeof(act));
138140 sigfillset(&act.sa_mask);
139141 act.sa_sigaction = toggle_done;
140142 sigaction(SIGINT, &act, NULL);
....@@ -208,5 +210,6 @@
208210 print_summary();
209211
210212 free(worker);
213
+ perf_cpu_map__put(cpu);
211214 return ret;
212215 }