Lines Matching refs:cache
61 static void cache_get(struct log_cache *cache, uintptr_t id, in cache_get() argument
64 uint32_t hit = log_cache_get_hit(cache); in cache_get()
65 uint32_t miss = log_cache_get_miss(cache); in cache_get()
68 res = log_cache_get(cache, id, buf); in cache_get()
71 zassert_equal(hit + 1, log_cache_get_hit(cache), "line %u\n", line); in cache_get()
72 zassert_equal(miss, log_cache_get_miss(cache), "line %u\n", line); in cache_get()
74 zassert_equal(hit, log_cache_get_hit(cache), "line %u\n", line); in cache_get()
75 zassert_equal(miss + 1, log_cache_get_miss(cache), "line %u\n", line); in cache_get()
91 struct log_cache cache; in ZTEST() local
105 err = log_cache_init(&cache, &config); in ZTEST()
109 cache_get(&cache, id0.raw, &buf, false, __LINE__); in ZTEST()
113 log_cache_put(&cache, buf); in ZTEST()
116 cache_get(&cache, id0.raw, &buf, true, __LINE__); in ZTEST()
120 cache_get(&cache, id1.raw, &buf, false, __LINE__); in ZTEST()
122 log_cache_put(&cache, buf); in ZTEST()
125 cache_get(&cache, id2.raw, &buf, false, __LINE__); in ZTEST()
127 log_cache_put(&cache, buf); in ZTEST()
133 cache_get(&cache, id0.raw, &buf, true, __LINE__); in ZTEST()
134 cache_get(&cache, id1.raw, &buf, true, __LINE__); in ZTEST()
135 cache_get(&cache, id2.raw, &buf, true, __LINE__); in ZTEST()
136 cache_get(&cache, id3.raw, &buf, false, __LINE__); in ZTEST()
138 log_cache_put(&cache, buf); in ZTEST()
141 cache_get(&cache, id0.raw, &buf, false, __LINE__); in ZTEST()
143 log_cache_put(&cache, buf); in ZTEST()
146 cache_get(&cache, id0.raw, &buf, true, __LINE__); in ZTEST()
149 cache_get(&cache, id1.raw, &buf, false, __LINE__); in ZTEST()
151 log_cache_put(&cache, buf); in ZTEST()