• Home
  • Raw
  • Download

Lines Matching refs:cache

574 	struct rb_root *root = &dso->data.cache;  in dso_cache__free()
579 struct dso_cache *cache; in dso_cache__free() local
581 cache = rb_entry(next, struct dso_cache, rb_node); in dso_cache__free()
582 next = rb_next(&cache->rb_node); in dso_cache__free()
583 rb_erase(&cache->rb_node, root); in dso_cache__free()
584 free(cache); in dso_cache__free()
591 const struct rb_root *root = &dso->data.cache; in dso_cache__find()
594 struct dso_cache *cache; in dso_cache__find() local
600 cache = rb_entry(parent, struct dso_cache, rb_node); in dso_cache__find()
601 end = cache->offset + DSO__DATA_CACHE_SIZE; in dso_cache__find()
603 if (offset < cache->offset) in dso_cache__find()
608 return cache; in dso_cache__find()
617 struct rb_root *root = &dso->data.cache; in dso_cache__insert()
620 struct dso_cache *cache; in dso_cache__insert() local
628 cache = rb_entry(parent, struct dso_cache, rb_node); in dso_cache__insert()
629 end = cache->offset + DSO__DATA_CACHE_SIZE; in dso_cache__insert()
631 if (offset < cache->offset) in dso_cache__insert()
642 cache = NULL; in dso_cache__insert()
645 return cache; in dso_cache__insert()
649 dso_cache__memcpy(struct dso_cache *cache, u64 offset, in dso_cache__memcpy() argument
652 u64 cache_offset = offset - cache->offset; in dso_cache__memcpy()
653 u64 cache_size = min(cache->size - cache_offset, size); in dso_cache__memcpy()
655 memcpy(data, cache->data + cache_offset, cache_size); in dso_cache__memcpy()
663 struct dso_cache *cache; in dso_cache__read() local
670 cache = zalloc(sizeof(*cache) + DSO__DATA_CACHE_SIZE); in dso_cache__read()
671 if (!cache) in dso_cache__read()
690 ret = pread(dso->data.fd, cache->data, DSO__DATA_CACHE_SIZE, cache_offset); in dso_cache__read()
694 cache->offset = cache_offset; in dso_cache__read()
695 cache->size = ret; in dso_cache__read()
701 old = dso_cache__insert(dso, cache); in dso_cache__read()
704 free(cache); in dso_cache__read()
705 cache = old; in dso_cache__read()
708 ret = dso_cache__memcpy(cache, offset, data, size); in dso_cache__read()
712 free(cache); in dso_cache__read()
720 struct dso_cache *cache; in dso_cache_read() local
722 cache = dso_cache__find(dso, offset); in dso_cache_read()
723 if (cache) in dso_cache_read()
724 return dso_cache__memcpy(cache, offset, data, size); in dso_cache_read()
1067 dso->data.cache = RB_ROOT; in dso__new()