Commit 73e2f2d7 authored by Teng Qin's avatar Teng Qin

Move BCC debug options to an installed header file

parent 94d15bc8
......@@ -33,6 +33,21 @@ class Type;
}
namespace ebpf {
// Options to enable different debug logging.
enum {
// Debug output compiled LLVM IR.
DEBUG_LLVM_IR = 0x1,
// Debug output loaded BPF bytecode and register state on branches.
DEBUG_BPF = 0x2,
// Debug output pre-processor result.
DEBUG_PREPROCESSOR = 0x4,
// Debug output ASM instructions embedded with source.
DEBUG_SOURCE = 0x8,
// Debug output register state on all instructions in addition to DEBUG_BPF.
DEBUG_BPF_REGISTER_STATE = 0x10,
};
class TableDesc;
class TableStorage;
class BLoader;
......
......@@ -23,20 +23,6 @@
namespace ebpf {
// debug flags
enum {
// Debug output compiled LLVM IR.
DEBUG_LLVM_IR = 0x1,
// Debug output loaded BPF bytecode and register state on branches.
DEBUG_BPF = 0x2,
// Debug output pre-processor result.
DEBUG_PREPROCESSOR = 0x4,
// Debug output ASM instructions embedded with source.
DEBUG_SOURCE = 0x8,
// Debug output register state on all instructions in addition to DEBUG_BPF.
DEBUG_BPF_REGISTER_STATE = 0x16,
};
template <class T, class... Args>
typename std::enable_if<!std::is_array<T>::value, std::unique_ptr<T>>::type
make_unique(Args &&... args) {
......
......@@ -26,8 +26,9 @@
#include <clang/Rewrite/Core/Rewriter.h>
#include "b_frontend_action.h"
#include "loader.h"
#include "bpf_module.h"
#include "common.h"
#include "loader.h"
#include "table_storage.h"
#include "libbpf.h"
......
......@@ -49,8 +49,8 @@
#include <llvm/IR/Module.h>
#include "common.h"
#include "bcc_exception.h"
#include "bpf_module.h"
#include "exported_files.h"
#include "kbuild_helper.h"
#include "b_frontend_action.h"
......
......@@ -50,7 +50,7 @@ DEBUG_PREPROCESSOR = 0x4
# Debug output ASM instructions embedded with source.
DEBUG_SOURCE = 0x8
#Debug output register state on all instructions in addition to DEBUG_BPF.
DEBUG_BPF_REGISTER_STATE = 0x16
DEBUG_BPF_REGISTER_STATE = 0x10
class SymbolCache(object):
def __init__(self, pid):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment