diff --git a/src/cc/bpf_module.cc b/src/cc/bpf_module.cc index 73235bf53128..502bd5d74916 100644 --- a/src/cc/bpf_module.cc +++ b/src/cc/bpf_module.cc @@ -35,6 +35,7 @@ #include "common.h" #include "bcc_debug.h" +#include "bcc_elf.h" #include "frontends/b/loader.h" #include "frontends/clang/loader.h" #include "frontends/clang/b_frontend_action.h" @@ -141,6 +142,10 @@ BPFModule::~BPFModule() { ts_->DeletePrefix(Path({id_})); } +int BPFModule::free_bcc_memory() { + return bcc_free_memory(); +} + // load an entire c file as a module int BPFModule::load_cfile(const string &file, bool in_memory, const char *cflags[], int ncflags) { ClangLoader clang_loader(&*ctx_, flags_); diff --git a/src/cc/bpf_module.h b/src/cc/bpf_module.h index d4bc54eed8d1..f4f56390db8b 100644 --- a/src/cc/bpf_module.h +++ b/src/cc/bpf_module.h @@ -83,6 +83,7 @@ class BPFModule { BPFModule(unsigned flags, TableStorage *ts = nullptr, bool rw_engine_enabled = true, const std::string &maps_ns = ""); ~BPFModule(); + int free_bcc_memory(); int load_b(const std::string &filename, const std::string &proto_filename); int load_c(const std::string &filename, const char *cflags[], int ncflags); int load_string(const std::string &text, const char *cflags[], int ncflags);