Lines Matching defs:cache
772 struct rb_root *root = &dso->data.cache;
777 struct dso_cache *cache;
779 cache = rb_entry(next, struct dso_cache, rb_node);
780 next = rb_next(&cache->rb_node);
781 rb_erase(&cache->rb_node, root);
782 free(cache);
789 const struct rb_root *root = &dso->data.cache;
792 struct dso_cache *cache;
798 cache = rb_entry(parent, struct dso_cache, rb_node);
799 end = cache->offset + DSO__DATA_CACHE_SIZE;
801 if (offset < cache->offset)
806 return cache;
815 struct rb_root *root = &dso->data.cache;
818 struct dso_cache *cache;
826 cache = rb_entry(parent, struct dso_cache, rb_node);
827 end = cache->offset + DSO__DATA_CACHE_SIZE;
829 if (offset < cache->offset)
840 cache = NULL;
843 return cache;
846 static ssize_t dso_cache__memcpy(struct dso_cache *cache, u64 offset, u8 *data,
849 u64 cache_offset = offset - cache->offset;
850 u64 cache_size = min(cache->size - cache_offset, size);
853 memcpy(data, cache->data + cache_offset, cache_size);
855 memcpy(cache->data + cache_offset, data, cache_size);
889 struct dso_cache *cache;
892 cache = zalloc(sizeof(*cache) + DSO__DATA_CACHE_SIZE);
893 if (!cache) {
899 *ret = bpf_read(dso, cache_offset, cache->data);
903 *ret = file_read(dso, machine, cache_offset, cache->data);
906 free(cache);
910 cache->offset = cache_offset;
911 cache->size = *ret;
913 old = dso_cache__insert(dso, cache);
916 free(cache);
917 cache = old;
920 return cache;
928 struct dso_cache *cache = __dso_cache__find(dso, offset);
930 return cache ? cache : dso_cache__populate(dso, machine, offset, ret);
936 struct dso_cache *cache;
939 cache = dso_cache__find(dso, machine, offset, &ret);
940 if (!cache)
943 return dso_cache__memcpy(cache, offset, data, size, out);
949 * by cached data. Writes update the cache only, not the backing file.
1002 pr_err("dso cache fstat failed: %s\n",
1100 * dso__data_write_cache_offs - Write data to dso data cache at file offset
1107 * Write into the dso file data cache, but do not change the file itself.
1121 * dso__data_write_cache_addr - Write data to dso data cache at dso address
1128 * External interface to write into the dso file data cache, but do not change
1254 dso->data.cache = RB_ROOT;