Lines Matching refs:pcache
415 static int probe_cache__open(struct probe_cache *pcache, const char *target, in probe_cache__open() argument
470 pcache->fd = fd; in probe_cache__open()
475 static int probe_cache__load(struct probe_cache *pcache) in probe_cache__load() argument
482 fddup = dup(pcache->fd); in probe_cache__load()
516 list_add_tail(&entry->node, &pcache->entries); in probe_cache__load()
536 struct probe_cache *pcache = zalloc(sizeof(*pcache)); in probe_cache__alloc() local
538 if (pcache) { in probe_cache__alloc()
539 INIT_LIST_HEAD(&pcache->entries); in probe_cache__alloc()
540 pcache->fd = -EINVAL; in probe_cache__alloc()
542 return pcache; in probe_cache__alloc()
545 void probe_cache__purge(struct probe_cache *pcache) in probe_cache__purge() argument
549 list_for_each_entry_safe(entry, n, &pcache->entries, node) { in probe_cache__purge()
555 void probe_cache__delete(struct probe_cache *pcache) in probe_cache__delete() argument
557 if (!pcache) in probe_cache__delete()
560 probe_cache__purge(pcache); in probe_cache__delete()
561 if (pcache->fd > 0) in probe_cache__delete()
562 close(pcache->fd); in probe_cache__delete()
563 free(pcache); in probe_cache__delete()
568 struct probe_cache *pcache = probe_cache__alloc(); in probe_cache__new() local
571 if (!pcache) in probe_cache__new()
574 ret = probe_cache__open(pcache, target, nsi); in probe_cache__new()
580 ret = probe_cache__load(pcache); in probe_cache__new()
586 return pcache; in probe_cache__new()
589 probe_cache__delete(pcache); in probe_cache__new()
605 probe_cache__find(struct probe_cache *pcache, struct perf_probe_event *pev) in probe_cache__find() argument
613 for_each_probe_cache_entry(entry, pcache) { in probe_cache__find()
638 probe_cache__find_by_name(struct probe_cache *pcache, in probe_cache__find_by_name() argument
643 for_each_probe_cache_entry(entry, pcache) { in probe_cache__find_by_name()
655 int probe_cache__add_entry(struct probe_cache *pcache, in probe_cache__add_entry() argument
663 if (!pcache || !pev || !tevs || ntevs <= 0) { in probe_cache__add_entry()
669 entry = probe_cache__find(pcache, pev); in probe_cache__add_entry()
695 list_add_tail(&entry->node, &pcache->entries); in probe_cache__add_entry()
838 int probe_cache__scan_sdt(struct probe_cache *pcache, const char *pathname) in probe_cache__scan_sdt() argument
858 entry = probe_cache__find_by_name(pcache, sdtgrp, note->name); in probe_cache__scan_sdt()
872 list_add_tail(&entry->node, &pcache->entries); in probe_cache__scan_sdt()
939 int probe_cache__commit(struct probe_cache *pcache) in probe_cache__commit() argument
945 ret = lseek(pcache->fd, 0, SEEK_SET); in probe_cache__commit()
949 ret = ftruncate(pcache->fd, 0); in probe_cache__commit()
953 for_each_probe_cache_entry(entry, pcache) { in probe_cache__commit()
954 ret = probe_cache_entry__write(entry, pcache->fd); in probe_cache__commit()
975 int probe_cache__filter_purge(struct probe_cache *pcache, in probe_cache__filter_purge() argument
980 list_for_each_entry_safe(entry, tmp, &pcache->entries, node) { in probe_cache__filter_purge()
990 static int probe_cache__show_entries(struct probe_cache *pcache, in probe_cache__show_entries() argument
995 for_each_probe_cache_entry(entry, pcache) { in probe_cache__show_entries()
1005 struct probe_cache *pcache; in probe_cache__show_all_caches() local
1019 pcache = probe_cache__new(nd->s, NULL); in probe_cache__show_all_caches()
1020 if (!pcache) in probe_cache__show_all_caches()
1022 if (!list_empty(&pcache->entries)) { in probe_cache__show_all_caches()
1026 probe_cache__show_entries(pcache, filter); in probe_cache__show_all_caches()
1028 probe_cache__delete(pcache); in probe_cache__show_all_caches()