return static_cast<void *>(new ProcSyms(pid));
}
+void bcc_free_symcache(void *symcache, int pid) {
+ if (pid < 0)
+ delete static_cast<KSyms*>(symcache);
+ else
+ delete static_cast<ProcSyms*>(symcache);
+}
+
int bcc_symcache_resolve(void *resolver, uint64_t addr,
struct bcc_symbol *sym) {
SymbolCache *cache = static_cast<SymbolCache *>(resolver);
return 0;
SYM_CB cb = (SYM_CB) payload;
- return cb(symname, addr);
+ return cb(symname, addr);
}
int bcc_foreach_symbol(const char *module, SYM_CB cb) {
typedef int(* SYM_CB)(const char *symname, uint64_t addr);
void *bcc_symcache_new(int pid);
+void bcc_free_symcache(void *symcache, int pid);
+
int bcc_symcache_resolve(void *symcache, uint64_t addr, struct bcc_symbol *sym);
int bcc_symcache_resolve_name(void *resolver, const char *name, uint64_t *addr);
void bcc_symcache_refresh(void *resolver);
lib.bcc_symcache_new.restype = ct.c_void_p
lib.bcc_symcache_new.argtypes = [ct.c_int]
+lib.bcc_free_symcache.restype = ct.c_void_p
+lib.bcc_free_symcache.argtypes = [ct.c_void_p, ct.c_int]
+
lib.bcc_symcache_resolve.restype = ct.c_int
lib.bcc_symcache_resolve.argtypes = [ct.c_void_p, ct.c_ulonglong, ct.POINTER(bcc_symbol)]