Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove support for B and P4 languages #3759

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/cc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${llvm_lib_exclude_f

# bcc_common_libs_for_a for archive libraries
# bcc_common_libs_for_s for shared libraries
set(bcc_common_libs b_frontend clang_frontend
set(bcc_common_libs clang_frontend
-Wl,--whole-archive ${clang_libs} ${llvm_libs} -Wl,--no-whole-archive
${LIBELF_LIBRARIES})
if (LIBDEBUGINFOD_FOUND)
list(APPEND bcc_common_libs ${LIBDEBUGINFOD_LIBRARIES})
endif (LIBDEBUGINFOD_FOUND)
set(bcc_common_libs_for_a ${bcc_common_libs})
set(bcc_common_libs_for_s ${bcc_common_libs})
set(bcc_common_libs_for_lua b_frontend clang_frontend
set(bcc_common_libs_for_lua clang_frontend
${clang_libs} ${llvm_libs} ${LIBELF_LIBRARIES})
if(LIBBPF_FOUND)
list(APPEND bcc_common_libs_for_a ${LIBBPF_LIBRARIES})
Expand Down
10 changes: 0 additions & 10 deletions src/cc/bcc_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@
#include "bpf_module.h"

extern "C" {
void * bpf_module_create_b(const char *filename, const char *proto_filename, unsigned flags,
const char *dev_name) {
auto mod = new ebpf::BPFModule(flags, nullptr, true, "", true, dev_name);
if (mod->load_b(filename, proto_filename) != 0) {
delete mod;
return nullptr;
}
return mod;
}

void * bpf_module_create_c(const char *filename, unsigned flags, const char *cflags[],
int ncflags, bool allow_rlimit, const char *dev_name) {
auto mod = new ebpf::BPFModule(flags, nullptr, true, "", allow_rlimit, dev_name);
Expand Down
2 changes: 0 additions & 2 deletions src/cc/bcc_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
extern "C" {
#endif

void * bpf_module_create_b(const char *filename, const char *proto_filename, unsigned flags,
const char *dev_name);
void * bpf_module_create_c(const char *filename, unsigned flags, const char *cflags[], int ncflags,
bool allow_rlimit, const char *dev_name);
void * bpf_module_create_c_from_string(const char *text, unsigned flags, const char *cflags[],
Expand Down
38 changes: 0 additions & 38 deletions src/cc/bpf_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#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"
#include "bpf_module.h"
Expand Down Expand Up @@ -834,43 +833,6 @@ int BPFModule::table_leaf_scanf(size_t id, const char *leaf_str, void *leaf) {
return 0;
}

// load a B file, which comes in two parts
int BPFModule::load_b(const string &filename, const string &proto_filename) {
if (!sections_.empty()) {
fprintf(stderr, "Program already initialized\n");
return -1;
}
if (filename.empty() || proto_filename.empty()) {
fprintf(stderr, "Invalid filenames\n");
return -1;
}

// Helpers are inlined in the following file (C). Load the definitions and
// pass the partially compiled module to the B frontend to continue with.
auto helpers_h = ExportedFiles::headers().find("/virtual/include/bcc/helpers.h");
if (helpers_h == ExportedFiles::headers().end()) {
fprintf(stderr, "Internal error: missing bcc/helpers.h");
return -1;
}
if (int rc = load_includes(helpers_h->second))
return rc;

BLoader b_loader(flags_);
used_b_loader_ = true;
if (int rc = b_loader.parse(&*mod_, filename, proto_filename, *ts_, id_,
maps_ns_))
return rc;
if (rw_engine_enabled_) {
if (int rc = annotate())
return rc;
} else {
annotate_light();
}
if (int rc = finalize())
return rc;
return 0;
}

// load a C file
int BPFModule::load_c(const string &filename, const char *cflags[], int ncflags) {
if (!sections_.empty()) {
Expand Down
1 change: 0 additions & 1 deletion src/cc/bpf_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ class BPFModule {
const char *dev_name = nullptr);
~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);
std::string id() const { return id_; }
Expand Down
1 change: 0 additions & 1 deletion src/cc/frontends/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Copyright (c) PLUMgrid, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")

add_subdirectory(b)
add_subdirectory(clang)
15 changes: 0 additions & 15 deletions src/cc/frontends/b/CMakeLists.txt

This file was deleted.

Loading