Skip to contentSkip to conversation

libperf tests: Update a use of the new cpumap api.

PATCH Applied Ian Rogers 2 participants 2 messages Jan 14, 2022 perf events

lore
Share & tools
lore

Ian Rogers

author reviewer
#0 lore raw

PATCH 1/1 libperf tests: Update a use of the new cpumap api.

Fixes a build breakage.

Fixes 6d18804b963b ("perf cpumap: Give CPUs their own type")
---
 tools/lib/perf/tests/test-evlist.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
tools/lib/perf/tests/test-evlist.c +3 -2
index e7afff12c35a..b3479dfa9a1c 100644
@@ -334,7 +334,8 @@ static int test_mmap_cpus(void)
 	};
 	cpu_set_t saved_mask;
 	char path[PATH_MAX];
-	int id, err, cpu, tmp;
+	int id, err, tmp;
+	struct perf_cpu cpu;
 	union perf_event *event;
 	int count = 0;
 
@@ -377,7 +378,7 @@ static int test_mmap_cpus(void)
 		cpu_set_t mask;
 
 		CPU_ZERO(&mask);
-		CPU_SET(cpu, &mask);
+		CPU_SET(cpu.cpu, &mask);
 
 		err = sched_setaffinity(0, sizeof(mask), &mask);
 		__T("sched_setaffinity failed", err == 0);
Signature · 1 line
2.34.1.703.g22d0c6ccf7-goog
maintainer Applied
#1 lore raw

Em Thu, Jan 13, 2022 at 10:51:05PM -0800, Ian Rogers escreveu:

Quoted 3 lines

Fixes a build breakage.

Fixes 6d18804b963b ("perf cpumap: Give CPUs their own type")

I wonder how I didn't catch this in my tests...

Thanks, applied.

- Arnaldo

Quoted 30 lines
---
 tools/lib/perf/tests/test-evlist.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
tools/lib/perf/tests/test-evlist.c +3 -2
index e7afff12c35a..b3479dfa9a1c 100644
@@ -334,7 +334,8 @@ static int test_mmap_cpus(void)
 	};
 	cpu_set_t saved_mask;
 	char path[PATH_MAX];
-	int id, err, cpu, tmp;
+	int id, err, tmp;
+	struct perf_cpu cpu;
 	union perf_event *event;
 	int count = 0;
 
@@ -377,7 +378,7 @@ static int test_mmap_cpus(void)
 		cpu_set_t mask;
 
 		CPU_ZERO(&mask);
-		CPU_SET(cpu, &mask);
+		CPU_SET(cpu.cpu, &mask);
 
 		err = sched_setaffinity(0, sizeof(mask), &mask);
 		__T("sched_setaffinity failed", err == 0);
Signature · 1 line
2.34.1.703.g22d0c6ccf7-goog
Signature · 1 line
- Arnaldo