aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/tests/topology.c
diff options
context:
space:
mode:
authorJames Clark2020-11-26 16:13:27 +0200
committerArnaldo Carvalho de Melo2020-12-24 10:05:25 -0300
commitb993381779da406ca9ca0ae1e1b3968e9075ce77 (patch)
treebc92012f8ffb0e16d567f8597f9ada48a724507c /tools/perf/tests/topology.c
parentba2ee166d92b201078cb941956547ab9828989d3 (diff)
perf stat aggregation: Add separate core member
Add core as a separate member so that it doesn't have to be packed into the int value. Signed-off-by: James Clark <james.clark@arm.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Acked-by: Jiri Olsa <jolsa@redhat.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Tested-by: John Garry <john.garry@huawei.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Richter <tmricht@linux.ibm.com> Link: https://lore.kernel.org/r/20201126141328.6509-12-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests/topology.c')
-rw-r--r--tools/perf/tests/topology.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/perf/tests/topology.c b/tools/perf/tests/topology.c
index e3f822890a84..a6e289f2c6db 100644
--- a/tools/perf/tests/topology.c
+++ b/tools/perf/tests/topology.c
@@ -111,7 +111,7 @@ static int check_cpu_topology(char *path, struct perf_cpu_map *map)
for (i = 0; i < map->nr; i++) {
id = cpu_map__get_core(map, i, NULL);
TEST_ASSERT_VAL("Core map - Core ID doesn't match",
- session->header.env.cpu[map->map[i]].core_id == cpu_map__id_to_cpu(id.id));
+ session->header.env.cpu[map->map[i]].core_id == id.core);
TEST_ASSERT_VAL("Core map - Socket ID doesn't match",
session->header.env.cpu[map->map[i]].socket_id == id.socket);
@@ -119,6 +119,7 @@ static int check_cpu_topology(char *path, struct perf_cpu_map *map)
TEST_ASSERT_VAL("Core map - Die ID doesn't match",
session->header.env.cpu[map->map[i]].die_id == id.die);
TEST_ASSERT_VAL("Core map - Node ID is set", id.node == -1);
+ TEST_ASSERT_VAL("Core map - ID is set", id.id == -1);
}
// Test that die ID contains socket and die
@@ -132,6 +133,7 @@ static int check_cpu_topology(char *path, struct perf_cpu_map *map)
TEST_ASSERT_VAL("Die map - Node ID is set", id.node == -1);
TEST_ASSERT_VAL("Die map - ID is set", id.id == -1);
+ TEST_ASSERT_VAL("Die map - Core is set", id.core == -1);
}
// Test that socket ID contains only socket
@@ -143,6 +145,7 @@ static int check_cpu_topology(char *path, struct perf_cpu_map *map)
TEST_ASSERT_VAL("Socket map - Node ID is set", id.node == -1);
TEST_ASSERT_VAL("Socket map - Die ID is set", id.die == -1);
TEST_ASSERT_VAL("Socket map - ID is set", id.id == -1);
+ TEST_ASSERT_VAL("Socket map - Core is set", id.core == -1);
}
// Test that node ID contains only node
@@ -153,6 +156,7 @@ static int check_cpu_topology(char *path, struct perf_cpu_map *map)
TEST_ASSERT_VAL("Node map - ID is set", id.id == -1);
TEST_ASSERT_VAL("Node map - Socket is set", id.socket == -1);
TEST_ASSERT_VAL("Node map - Die ID is set", id.die == -1);
+ TEST_ASSERT_VAL("Node map - Core is set", id.core == -1);
}
perf_session__delete(session);