Merge tag 'trace-v4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux...
[firefly-linux-kernel-4.4.55.git] / tools / perf / tests / thread-map.c
index 5acf000939ea5178fa7b98fb0a3d35ff0a9301af..138a0e3431fafd7ae0b6441fa24b7845f7b51ea0 100644 (file)
@@ -20,6 +20,8 @@ int test__thread_map(void)
        TEST_ASSERT_VAL("wrong comm",
                        thread_map__comm(map, 0) &&
                        !strcmp(thread_map__comm(map, 0), "perf"));
+       TEST_ASSERT_VAL("wrong refcnt",
+                       atomic_read(&map->refcnt) == 1);
        thread_map__put(map);
 
        /* test dummy pid */
@@ -33,6 +35,8 @@ int test__thread_map(void)
        TEST_ASSERT_VAL("wrong comm",
                        thread_map__comm(map, 0) &&
                        !strcmp(thread_map__comm(map, 0), "dummy"));
+       TEST_ASSERT_VAL("wrong refcnt",
+                       atomic_read(&map->refcnt) == 1);
        thread_map__put(map);
        return 0;
 }