Lines Matching refs:cache

502 		struct dso_cache *cache;  in dso_cache__free()  local
504 cache = rb_entry(next, struct dso_cache, rb_node); in dso_cache__free()
505 next = rb_next(&cache->rb_node); in dso_cache__free()
506 rb_erase(&cache->rb_node, root); in dso_cache__free()
507 free(cache); in dso_cache__free()
515 struct dso_cache *cache; in dso_cache__find() local
521 cache = rb_entry(parent, struct dso_cache, rb_node); in dso_cache__find()
522 end = cache->offset + DSO__DATA_CACHE_SIZE; in dso_cache__find()
524 if (offset < cache->offset) in dso_cache__find()
529 return cache; in dso_cache__find()
539 struct dso_cache *cache; in dso_cache__insert() local
546 cache = rb_entry(parent, struct dso_cache, rb_node); in dso_cache__insert()
547 end = cache->offset + DSO__DATA_CACHE_SIZE; in dso_cache__insert()
549 if (offset < cache->offset) in dso_cache__insert()
560 dso_cache__memcpy(struct dso_cache *cache, u64 offset, in dso_cache__memcpy() argument
563 u64 cache_offset = offset - cache->offset; in dso_cache__memcpy()
564 u64 cache_size = min(cache->size - cache_offset, size); in dso_cache__memcpy()
566 memcpy(data, cache->data + cache_offset, cache_size); in dso_cache__memcpy()
573 struct dso_cache *cache; in dso_cache__read() local
581 cache = zalloc(sizeof(*cache) + DSO__DATA_CACHE_SIZE); in dso_cache__read()
582 if (!cache) in dso_cache__read()
587 ret = pread(dso->data.fd, cache->data, DSO__DATA_CACHE_SIZE, cache_offset); in dso_cache__read()
591 cache->offset = cache_offset; in dso_cache__read()
592 cache->size = ret; in dso_cache__read()
593 dso_cache__insert(&dso->data.cache, cache); in dso_cache__read()
595 ret = dso_cache__memcpy(cache, offset, data, size); in dso_cache__read()
600 free(cache); in dso_cache__read()
608 struct dso_cache *cache; in dso_cache_read() local
610 cache = dso_cache__find(&dso->data.cache, offset); in dso_cache_read()
611 if (cache) in dso_cache_read()
612 return dso_cache__memcpy(cache, offset, data, size); in dso_cache_read()
921 dso->data.cache = RB_ROOT; in dso__new()
964 dso_cache__free(&dso->data.cache); in dso__delete()