Lines Matching refs:cache

26 static bool JoinCallChain(LRUCache& cache, uint32_t tid,  in JoinCallChain()  argument
33 cache.AddCallChain(tid, tmp_ip, tmp_sp); in JoinCallChain()
38 LRUCache cache(sizeof(CacheNode) * 2, 1); in TEST() local
39 ASSERT_EQ(cache.Stat().max_node_count, 2u); in TEST()
43 ASSERT_TRUE(JoinCallChain(cache, 0, ip, sp, ip, sp)); in TEST()
44 ASSERT_TRUE(JoinCallChain(cache, 1, ip, sp, ip, sp)); in TEST()
45 ASSERT_EQ(cache.Stat().used_node_count, 2u); in TEST()
46 ASSERT_EQ(cache.Stat().recycled_node_count, 0u); in TEST()
47 ASSERT_NE(cache.FindNode(0, ip[0], sp[0]), nullptr); in TEST()
48 ASSERT_NE(cache.FindNode(1, ip[0], sp[0]), nullptr); in TEST()
52 ASSERT_TRUE(JoinCallChain(cache, 0, ip2, sp, ip2, sp)); in TEST()
53 ASSERT_EQ(cache.Stat().used_node_count, 2u); in TEST()
54 ASSERT_EQ(cache.Stat().recycled_node_count, 1u); in TEST()
55 ASSERT_EQ(cache.FindNode(0, ip[0], sp[0]), nullptr); in TEST()
56 ASSERT_NE(cache.FindNode(0, ip2[0], sp[0]), nullptr); in TEST()
57 ASSERT_NE(cache.FindNode(1, ip[0], sp[0]), nullptr); in TEST()
61 ASSERT_TRUE(JoinCallChain(cache, 1, ip, sp2, ip, sp2)); in TEST()
62 ASSERT_EQ(cache.Stat().used_node_count, 2u); in TEST()
63 ASSERT_EQ(cache.Stat().recycled_node_count, 2u); in TEST()
64 ASSERT_EQ(cache.FindNode(1, ip[0], sp[0]), nullptr); in TEST()
65 ASSERT_NE(cache.FindNode(0, ip2[0], sp[0]), nullptr); in TEST()
66 ASSERT_NE(cache.FindNode(1, ip[0], sp2[0]), nullptr); in TEST()
98 LRUCache cache(sizeof(CacheNode) * 2, 1); in TEST() local
101 ASSERT_TRUE(JoinCallChain(cache, 0, ip, sp, ip, sp)); in TEST()
103 ASSERT_TRUE(JoinCallChain(cache, 0, ip, sp, ip, sp)); in TEST()
104 ASSERT_EQ(cache.Stat().used_node_count, 2u); in TEST()
105 ASSERT_EQ(cache.Stat().recycled_node_count, 0u); in TEST()
109 LRUCache cache(sizeof(CacheNode) * 4, 1); in TEST() local
110 ASSERT_EQ(cache.Stat().max_node_count, 4u); in TEST()
116 ASSERT_TRUE(JoinCallChain(cache, 0, ip, sp, ip, sp)); in TEST()
123 ASSERT_TRUE(JoinCallChain(cache, 0, ip, sp, origin_ip, origin_sp)); in TEST()
125 ASSERT_EQ(cache.Stat().used_node_count, 4u); in TEST()
126 ASSERT_EQ(cache.Stat().recycled_node_count, 0u); in TEST()
130 LRUCache cache(sizeof(CacheNode) * 12, 1); in TEST() local
136 ASSERT_TRUE(JoinCallChain(cache, 0, ip, sp, ip, sp)); in TEST()
139 ASSERT_TRUE(JoinCallChain(cache, 0, ip, sp, ip, sp)); in TEST()
142 ASSERT_TRUE(JoinCallChain(cache, 0, ip, sp, ip, sp)); in TEST()
143 ASSERT_EQ(cache.Stat().used_node_count, 12u); in TEST()
144 ASSERT_EQ(cache.Stat().recycled_node_count, 0u); in TEST()
145 ASSERT_TRUE(JoinCallChain(cache, 0, {1}, {1}, {1, 2, 3, 4}, {1, 2, 3, 4})); in TEST()
146 ASSERT_TRUE(JoinCallChain(cache, 0, {5, 6}, {5, 6}, {5, 6, 7, 8}, {5, 6, 7, 8})); in TEST()
147 ASSERT_TRUE(JoinCallChain(cache, 0, {0xa}, {0xb}, {0xa}, {0xb})); in TEST()
148 ASSERT_EQ(cache.Stat().used_node_count, 12u); in TEST()
149 ASSERT_EQ(cache.Stat().recycled_node_count, 1u); in TEST()
150 ASSERT_EQ(cache.FindNode(0, 0xa, 0xa), nullptr); in TEST()