aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/tests/thread-maps-share.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/tests/thread-maps-share.c')
-rw-r--r--tools/perf/tests/thread-maps-share.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/tools/perf/tests/thread-maps-share.c b/tools/perf/tests/thread-maps-share.c
index 84edd82c519e..858e725318a9 100644
--- a/tools/perf/tests/thread-maps-share.c
+++ b/tools/perf/tests/thread-maps-share.c
@@ -43,12 +43,12 @@ static int test__thread_maps_share(struct test_suite *test __maybe_unused, int s
leader && t1 && t2 && t3 && other);
maps = leader->maps;
- TEST_ASSERT_EQUAL("wrong refcnt", refcount_read(&maps->refcnt), 4);
+ TEST_ASSERT_EQUAL("wrong refcnt", refcount_read(maps__refcnt(maps)), 4);
/* test the maps pointer is shared */
- TEST_ASSERT_VAL("maps don't match", maps == t1->maps);
- TEST_ASSERT_VAL("maps don't match", maps == t2->maps);
- TEST_ASSERT_VAL("maps don't match", maps == t3->maps);
+ TEST_ASSERT_VAL("maps don't match", RC_CHK_ACCESS(maps) == RC_CHK_ACCESS(t1->maps));
+ TEST_ASSERT_VAL("maps don't match", RC_CHK_ACCESS(maps) == RC_CHK_ACCESS(t2->maps));
+ TEST_ASSERT_VAL("maps don't match", RC_CHK_ACCESS(maps) == RC_CHK_ACCESS(t3->maps));
/*
* Verify the other leader was created by previous call.
@@ -71,25 +71,25 @@ static int test__thread_maps_share(struct test_suite *test __maybe_unused, int s
machine__remove_thread(machine, other_leader);
other_maps = other->maps;
- TEST_ASSERT_EQUAL("wrong refcnt", refcount_read(&other_maps->refcnt), 2);
+ TEST_ASSERT_EQUAL("wrong refcnt", refcount_read(maps__refcnt(other_maps)), 2);
- TEST_ASSERT_VAL("maps don't match", other_maps == other_leader->maps);
+ TEST_ASSERT_VAL("maps don't match", RC_CHK_ACCESS(other_maps) == RC_CHK_ACCESS(other_leader->maps));
/* release thread group */
- thread__put(leader);
- TEST_ASSERT_EQUAL("wrong refcnt", refcount_read(&maps->refcnt), 3);
-
- thread__put(t1);
- TEST_ASSERT_EQUAL("wrong refcnt", refcount_read(&maps->refcnt), 2);
+ thread__put(t3);
+ TEST_ASSERT_EQUAL("wrong refcnt", refcount_read(maps__refcnt(maps)), 3);
thread__put(t2);
- TEST_ASSERT_EQUAL("wrong refcnt", refcount_read(&maps->refcnt), 1);
+ TEST_ASSERT_EQUAL("wrong refcnt", refcount_read(maps__refcnt(maps)), 2);
- thread__put(t3);
+ thread__put(t1);
+ TEST_ASSERT_EQUAL("wrong refcnt", refcount_read(maps__refcnt(maps)), 1);
+
+ thread__put(leader);
/* release other group */
thread__put(other_leader);
- TEST_ASSERT_EQUAL("wrong refcnt", refcount_read(&other_maps->refcnt), 1);
+ TEST_ASSERT_EQUAL("wrong refcnt", refcount_read(maps__refcnt(other_maps)), 1);
thread__put(other);