Compare commits

...

No commits in common. "imports/c8-beta/bpftrace-0.9-2.el8" and "c8" have entirely different histories.

14 changed files with 1033 additions and 702 deletions

View File

@ -1 +0,0 @@
a6409319efe13b553b05b8343077e2976b03a951 SOURCES/bpftrace-0.9.tar.gz

3
.gitignore vendored
View File

@ -1 +1,2 @@
SOURCES/bpftrace-0.9.tar.gz
SOURCES/bpftrace-0.16.0.tar.gz
SOURCES/cereal-1.3.2.tar.gz

View File

@ -0,0 +1,90 @@
From 45f0302773923accd7cc324d839b733c27c92f38 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 6 Jul 2023 08:59:41 -0700
Subject: [PATCH] Adjust to build with llvm 17
- PassManagerBuilder has been removed
- itaniumDemangle() API signature has changed
- update MAX_LLVM_MAJOR in CMakeLists.txt
- update bcc and libbpf submodules to their latest versions to allow
building bcc with llvm 17
- replaced JITEvaluatedSymbol by ExecutorSymbolDef in ORC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Viktor Malik <viktor.malik@gmail.com>
---
CMakeLists.txt | 2 +-
src/ast/bpforc/bpforc.h | 2 +-
src/ast/passes/codegen_llvm.cpp | 4 ++++
src/cxxdemangler/cxxdemangler_llvm.cpp | 4 ++++
4 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 433153be..a11a5c36 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -169,7 +169,7 @@ else()
endif()
set(MIN_LLVM_MAJOR 6)
- set(MAX_LLVM_MAJOR 16)
+ set(MAX_LLVM_MAJOR 17)
if((${LLVM_VERSION_MAJOR} VERSION_LESS ${MIN_LLVM_MAJOR}) OR (${LLVM_VERSION_MAJOR} VERSION_GREATER ${MAX_LLVM_MAJOR}))
message(SEND_ERROR "Unsupported LLVM version found via ${LLVM_INCLUDE_DIRS}: ${LLVM_VERSION_MAJOR}")
diff --git a/src/ast/bpforc/bpforc.h b/src/ast/bpforc/bpforc.h
index 58914419..8d2f1e63 100644
--- a/src/ast/bpforc/bpforc.h
+++ b/src/ast/bpforc/bpforc.h
@@ -157,7 +157,7 @@ public:
}
#ifdef LLVM_ORC_V2
- Expected<JITEvaluatedSymbol> lookup(StringRef Name)
+ Expected<ExecutorSymbolDef> lookup(StringRef Name)
{
return ES->lookup({ &MainJD }, Mangle(Name.str()));
}
diff --git a/src/ast/passes/codegen_llvm.cpp b/src/ast/passes/codegen_llvm.cpp
index 2b888087..a75a0fd1 100644
--- a/src/ast/passes/codegen_llvm.cpp
+++ b/src/ast/passes/codegen_llvm.cpp
@@ -7,7 +7,9 @@
#include <ctime>
#include <fstream>
+#if LLVM_VERSION_MAJOR <= 16
#include <llvm-c/Transforms/IPO.h>
+#endif
#include <llvm/IR/Constants.h>
#include <llvm/IR/LLVMContext.h>
#include <llvm/IR/LegacyPassManager.h>
@@ -17,7 +19,9 @@
#include <llvm/Passes/PassBuilder.h>
#endif
#include <llvm/Transforms/IPO.h>
+#if LLVM_VERSION_MAJOR <= 16
#include <llvm/Transforms/IPO/PassManagerBuilder.h>
+#endif
#include "arch/arch.h"
#include "ast.h"
diff --git a/src/cxxdemangler/cxxdemangler_llvm.cpp b/src/cxxdemangler/cxxdemangler_llvm.cpp
index e9a9db24..1b0bf7ea 100644
--- a/src/cxxdemangler/cxxdemangler_llvm.cpp
+++ b/src/cxxdemangler/cxxdemangler_llvm.cpp
@@ -6,7 +6,11 @@ namespace bpftrace {
char* cxxdemangle(const char* mangled)
{
+#if LLVM_VERSION_MAJOR <= 16
return llvm::itaniumDemangle(mangled, nullptr, nullptr, nullptr);
+#else
+ return llvm::itaniumDemangle(mangled);
+#endif
}
} // namespace bpftrace
--
2.41.0

View File

@ -0,0 +1,457 @@
From dfc1f92653707c8d11bdb3be98e68f8297b9bc71 Mon Sep 17 00:00:00 2001
From: Viktor Malik <viktor.malik@gmail.com>
Date: Mon, 10 Oct 2022 14:26:38 +0200
Subject: [PATCH] IR builder: get rid of getPointerElementType calls
Usage of Value::getPointerElementType is deprecated and will be dropped
in LLVM 16 [1].
There are several places where we use this method:
- function (value) calls - the called function type is usually
available, so just pass it to createCall, the only exception is
CreateProbeReadStr which must have been refactored
- getting the type of alloca instruction - there is a dedicated
AllocaInst::getAllocatedType method that can be used instead
- strncmp - pass sizes of the strings to CreateStrncmp to be able to get
the correct string type (which is array of uint8)
[1] https://llvm.org/docs/OpaquePointers.html
---
src/ast/irbuilderbpf.cpp | 143 ++++++++++++--------------------
src/ast/irbuilderbpf.h | 23 +++--
src/ast/passes/codegen_llvm.cpp | 30 +++++--
3 files changed, 86 insertions(+), 110 deletions(-)
diff --git a/src/ast/irbuilderbpf.cpp b/src/ast/irbuilderbpf.cpp
index d49883f7..4036b2df 100644
--- a/src/ast/irbuilderbpf.cpp
+++ b/src/ast/irbuilderbpf.cpp
@@ -288,17 +288,16 @@ CallInst *IRBuilderBPF::CreateHelperCall(libbpf::bpf_func_id func_id,
Constant *helper_func = ConstantExpr::getCast(Instruction::IntToPtr,
getInt64(func_id),
helper_ptr_type);
- return createCall(helper_func, args, Name);
+ return createCall(helper_type, helper_func, args, Name);
}
-CallInst *IRBuilderBPF::createCall(Value *callee,
+CallInst *IRBuilderBPF::createCall(FunctionType *callee_type,
+ Value *callee,
ArrayRef<Value *> args,
const Twine &Name)
{
#if LLVM_VERSION_MAJOR >= 11
- auto *calleePtrType = cast<PointerType>(callee->getType());
- auto *calleeType = cast<FunctionType>(calleePtrType->getPointerElementType());
- return CreateCall(calleeType, callee, args, Name);
+ return CreateCall(callee_type, callee, args, Name);
#else
return CreateCall(callee, args, Name);
#endif
@@ -307,7 +306,7 @@ CallInst *IRBuilderBPF::createCall(Value *callee,
CallInst *IRBuilderBPF::CreateBpfPseudoCallId(int mapid)
{
Function *pseudo_func = module_.getFunction("llvm.bpf.pseudo");
- return createCall(pseudo_func,
+ return CreateCall(pseudo_func,
{ getInt64(BPF_PSEUDO_MAP_FD), getInt64(mapid) },
"pseudo");
}
@@ -346,7 +345,8 @@ CallInst *IRBuilderBPF::createMapLookup(int mapid, Value *key)
Instruction::IntToPtr,
getInt64(libbpf::BPF_FUNC_map_lookup_elem),
lookup_func_ptr_type);
- return createCall(lookup_func, { map_ptr, key }, "lookup_elem");
+ return createCall(
+ lookup_func_type, lookup_func, { map_ptr, key }, "lookup_elem");
}
CallInst *IRBuilderBPF::CreateGetJoinMap(Value *ctx, const location &loc)
@@ -397,8 +397,7 @@ Value *IRBuilderBPF::CreateMapLookupElem(Value *ctx,
CREATE_MEMCPY(value, call, type.GetSize(), 1);
else
{
- assert(value->getType()->isPointerTy() &&
- (value->getType()->getPointerElementType() == getInt64Ty()));
+ assert(value->getAllocatedType() == getInt64Ty());
// createMapLookup returns an u8*
auto *cast = CreatePointerCast(call, value->getType(), "cast");
CreateStore(CreateLoad(getInt64Ty(), cast), value);
@@ -448,7 +447,8 @@ void IRBuilderBPF::CreateMapUpdateElem(Value *ctx,
Instruction::IntToPtr,
getInt64(libbpf::BPF_FUNC_map_update_elem),
update_func_ptr_type);
- CallInst *call = createCall(update_func,
+ CallInst *call = createCall(update_func_type,
+ update_func,
{ map_ptr, key, val, flags },
"update_elem");
CreateHelperErrorCond(ctx, call, libbpf::BPF_FUNC_map_update_elem, loc);
@@ -472,7 +472,8 @@ void IRBuilderBPF::CreateMapDeleteElem(Value *ctx,
Instruction::IntToPtr,
getInt64(libbpf::BPF_FUNC_map_delete_elem),
delete_func_ptr_type);
- CallInst *call = createCall(delete_func, { map_ptr, key }, "delete_elem");
+ CallInst *call = createCall(
+ delete_func_type, delete_func, { map_ptr, key }, "delete_elem");
CreateHelperErrorCond(ctx, call, libbpf::BPF_FUNC_map_delete_elem, loc);
}
@@ -508,72 +509,53 @@ void IRBuilderBPF::CreateProbeRead(Value *ctx,
Constant *proberead_func = ConstantExpr::getCast(Instruction::IntToPtr,
getInt64(read_fn),
proberead_func_ptr_type);
- CallInst *call = createCall(proberead_func,
+ CallInst *call = createCall(proberead_func_type,
+ proberead_func,
{ dst, size, src },
probeReadHelperName(read_fn));
CreateHelperErrorCond(ctx, call, read_fn, loc);
}
-Constant *IRBuilderBPF::createProbeReadStrFn(llvm::Type *dst,
- llvm::Type *src,
- AddrSpace as)
-{
- assert(src && (src->isIntegerTy() || src->isPointerTy()));
- // int bpf_probe_read_str(void *dst, int size, const void *unsafe_ptr)
- FunctionType *probereadstr_func_type = FunctionType::get(
- getInt64Ty(), { dst, getInt32Ty(), src }, false);
- PointerType *probereadstr_func_ptr_type = PointerType::get(
- probereadstr_func_type, 0);
- return ConstantExpr::getCast(Instruction::IntToPtr,
- getInt64(selectProbeReadHelper(as, true)),
- probereadstr_func_ptr_type);
-}
-
CallInst *IRBuilderBPF::CreateProbeReadStr(Value *ctx,
- AllocaInst *dst,
+ Value *dst,
size_t size,
Value *src,
AddrSpace as,
const location &loc)
{
- assert(ctx && ctx->getType() == getInt8PtrTy());
return CreateProbeReadStr(ctx, dst, getInt32(size), src, as, loc);
}
CallInst *IRBuilderBPF::CreateProbeReadStr(Value *ctx,
Value *dst,
- size_t size,
- Value *src,
- AddrSpace as,
- const location &loc)
-{
- assert(ctx && ctx->getType() == getInt8PtrTy());
- Constant *fn = createProbeReadStrFn(dst->getType(), src->getType(), as);
- auto read_fn = selectProbeReadHelper(as, true);
- CallInst *call = createCall(fn,
- { dst, getInt32(size), src },
- probeReadHelperName(read_fn));
- CreateHelperErrorCond(ctx, call, read_fn, loc);
- return call;
-}
-
-CallInst *IRBuilderBPF::CreateProbeReadStr(Value *ctx,
- AllocaInst *dst,
llvm::Value *size,
Value *src,
AddrSpace as,
const location &loc)
{
assert(ctx && ctx->getType() == getInt8PtrTy());
- assert(dst && dst->getAllocatedType()->isArrayTy() &&
- dst->getAllocatedType()->getArrayElementType() == getInt8Ty());
assert(size && size->getType()->isIntegerTy());
+ if (auto *dst_alloca = dyn_cast<AllocaInst>(dst))
+ {
+ assert(dst_alloca->getAllocatedType()->isArrayTy() &&
+ dst_alloca->getAllocatedType()->getArrayElementType() ==
+ getInt8Ty());
+ }
- auto *size_i32 = CreateIntCast(size, getInt32Ty(), false);
+ auto *size_i32 = size;
+ if (size_i32->getType()->getScalarSizeInBits() != 32)
+ size_i32 = CreateIntCast(size_i32, getInt32Ty(), false);
- Constant *fn = createProbeReadStrFn(dst->getType(), src->getType(), as);
auto read_fn = selectProbeReadHelper(as, true);
- CallInst *call = createCall(fn,
+ // int bpf_probe_read_str(void *dst, int size, const void *unsafe_ptr)
+ FunctionType *probereadstr_func_type = FunctionType::get(
+ getInt64Ty(), { dst->getType(), getInt32Ty(), src->getType() }, false);
+ PointerType *probereadstr_func_ptr_type = PointerType::get(
+ probereadstr_func_type, 0);
+ Constant *probereadstr_callee = ConstantExpr::getCast(
+ Instruction::IntToPtr, getInt64(read_fn), probereadstr_func_ptr_type);
+ CallInst *call = createCall(probereadstr_func_type,
+ probereadstr_callee,
{ dst, size_i32, src },
probeReadHelperName(read_fn));
CreateHelperErrorCond(ctx, call, read_fn, loc);
@@ -732,8 +714,10 @@ Value *IRBuilderBPF::CreateUSDTReadArgument(Value *ctx,
return result;
}
-Value *IRBuilderBPF::CreateStrncmp(Value *val1,
- Value *val2,
+Value *IRBuilderBPF::CreateStrncmp(Value *str1,
+ uint64_t str1_size,
+ Value *str2,
+ uint64_t str2_size,
uint64_t n,
bool inverse)
{
@@ -762,40 +746,21 @@ Value *IRBuilderBPF::CreateStrncmp(Value *val1,
// Check if the compared strings are literals.
// If so, we can avoid storing the literal in memory.
std::optional<std::string> literal1;
- if (auto constString1 = dyn_cast<ConstantDataArray>(val1))
+ if (auto constString1 = dyn_cast<ConstantDataArray>(str1))
literal1 = constString1->getAsString();
- else if (isa<ConstantAggregateZero>(val1))
+ else if (isa<ConstantAggregateZero>(str1))
literal1 = "";
else
literal1 = std::nullopt;
std::optional<std::string> literal2;
- if (auto constString2 = dyn_cast<ConstantDataArray>(val2))
+ if (auto constString2 = dyn_cast<ConstantDataArray>(str2))
literal2 = constString2->getAsString();
- else if (isa<ConstantAggregateZero>(val2))
+ else if (isa<ConstantAggregateZero>(str2))
literal2 = "";
else
literal2 = std::nullopt;
- auto *val1p = dyn_cast<PointerType>(val1->getType());
- auto *val2p = dyn_cast<PointerType>(val2->getType());
-#ifndef NDEBUG
- if (!literal1)
- {
- assert(val1p);
- assert(val1p->getPointerElementType()->isArrayTy() &&
- val1p->getPointerElementType()->getArrayElementType() ==
- getInt8Ty());
- }
- if (!literal2)
- {
- assert(val2p);
- assert(val2p->getPointerElementType()->isArrayTy() &&
- val2p->getPointerElementType()->getArrayElementType() ==
- getInt8Ty());
- }
-#endif
-
Function *parent = GetInsertBlock()->getParent();
AllocaInst *store = CreateAllocaBPF(getInt1Ty(), "strcmp.result");
BasicBlock *str_ne = BasicBlock::Create(module_.getContext(),
@@ -822,8 +787,8 @@ Value *IRBuilderBPF::CreateStrncmp(Value *val1,
l = getInt8(literal1->c_str()[i]);
else
{
- auto *ptr_l = CreateGEP(val1p->getPointerElementType(),
- val1,
+ auto *ptr_l = CreateGEP(ArrayType::get(getInt8Ty(), str1_size),
+ str1,
{ getInt32(0), getInt32(i) });
l = CreateLoad(getInt8Ty(), ptr_l);
}
@@ -833,8 +798,8 @@ Value *IRBuilderBPF::CreateStrncmp(Value *val1,
r = getInt8(literal2->c_str()[i]);
else
{
- auto *ptr_r = CreateGEP(val2p->getPointerElementType(),
- val2,
+ auto *ptr_r = CreateGEP(ArrayType::get(getInt8Ty(), str2_size),
+ str2,
{ getInt32(0), getInt32(i) });
r = CreateLoad(getInt8Ty(), ptr_r);
}
@@ -994,11 +959,9 @@ void IRBuilderBPF::CreateGetCurrentComm(Value *ctx,
size_t size,
const location &loc)
{
- assert(buf->getType()->getPointerElementType()->isArrayTy() &&
- buf->getType()->getPointerElementType()->getArrayNumElements() >=
- size &&
- buf->getType()->getPointerElementType()->getArrayElementType() ==
- getInt8Ty());
+ assert(buf->getAllocatedType()->isArrayTy() &&
+ buf->getAllocatedType()->getArrayNumElements() >= size &&
+ buf->getAllocatedType()->getArrayElementType() == getInt8Ty());
// long bpf_get_current_comm(char *buf, int size_of_buf)
// Return: 0 on success or negative error
@@ -1077,7 +1040,7 @@ void IRBuilderBPF::CreateSignal(Value *ctx, Value *sig, const location &loc)
Instruction::IntToPtr,
getInt64(libbpf::BPF_FUNC_send_signal),
signal_func_ptr_type);
- CallInst *call = createCall(signal_func, { sig }, "signal");
+ CallInst *call = createCall(signal_func_type, signal_func, { sig }, "signal");
CreateHelperErrorCond(ctx, call, libbpf::BPF_FUNC_send_signal, loc);
}
@@ -1091,7 +1054,7 @@ void IRBuilderBPF::CreateOverrideReturn(Value *ctx, Value *rc)
Constant *override_func = ConstantExpr::getCast(Instruction::IntToPtr,
getInt64(libbpf::BPF_FUNC_override_return),
override_func_ptr_type);
- createCall(override_func, { ctx, rc }, "override");
+ createCall(override_func_type, override_func, { ctx, rc }, "override");
}
CallInst *IRBuilderBPF::CreateSkbOutput(Value *skb,
@@ -1126,7 +1089,8 @@ CallInst *IRBuilderBPF::CreateSkbOutput(Value *skb,
Instruction::IntToPtr,
getInt64(libbpf::BPF_FUNC_skb_output),
skb_output_func_ptr_type);
- CallInst *call = createCall(skb_output_func,
+ CallInst *call = createCall(skb_output_func_type,
+ skb_output_func,
{ skb, map_ptr, flags, data, size_val },
"skb_output");
return call;
@@ -1320,7 +1284,8 @@ void IRBuilderBPF::CreateSeqPrintf(Value *ctx,
CreateGEP(getInt64Ty(), meta, getInt64(0)),
"seq");
- CallInst *call = createCall(seq_printf_func,
+ CallInst *call = createCall(seq_printf_func_type,
+ seq_printf_func,
{ seq, fmt, fmt_size, data, data_len },
"seq_printf");
CreateHelperErrorCond(ctx, call, libbpf::BPF_FUNC_seq_printf, loc);
diff --git a/src/ast/irbuilderbpf.h b/src/ast/irbuilderbpf.h
index e124911b..c9ffb545 100644
--- a/src/ast/irbuilderbpf.h
+++ b/src/ast/irbuilderbpf.h
@@ -90,17 +90,11 @@ public:
AddrSpace as,
const location &loc);
CallInst *CreateProbeReadStr(Value *ctx,
- AllocaInst *dst,
+ Value *dst,
llvm::Value *size,
Value *src,
AddrSpace as,
const location &loc);
- CallInst *CreateProbeReadStr(Value *ctx,
- AllocaInst *dst,
- size_t size,
- Value *src,
- AddrSpace as,
- const location &loc);
CallInst *CreateProbeReadStr(Value *ctx,
Value *dst,
size_t size,
@@ -115,7 +109,12 @@ public:
pid_t pid,
AddrSpace as,
const location &loc);
- Value *CreateStrncmp(Value *val1, Value *val2, uint64_t n, bool inverse);
+ Value *CreateStrncmp(Value *str1,
+ uint64_t str1_size,
+ Value *str2,
+ uint64_t str2_size,
+ uint64_t n,
+ bool inverse);
CallInst *CreateGetNs(bool boot_time, const location &loc);
CallInst *CreateGetPidTgid(const location &loc);
CallInst *CreateGetCurrentCgroupId(const location &loc);
@@ -131,7 +130,10 @@ public:
ArrayRef<Value *> args,
const Twine &Name,
const location *loc = nullptr);
- CallInst *createCall(Value *callee, ArrayRef<Value *> args, const Twine &Name);
+ CallInst *createCall(FunctionType *callee_type,
+ Value *callee,
+ ArrayRef<Value *> args,
+ const Twine &Name);
void CreateGetCurrentComm(Value *ctx, AllocaInst *buf, size_t size, const location& loc);
void CreatePerfEventOutput(Value *ctx,
Value *data,
@@ -185,9 +187,6 @@ private:
AddrSpace as,
const location &loc);
CallInst *createMapLookup(int mapid, Value *key);
- Constant *createProbeReadStrFn(llvm::Type *dst,
- llvm::Type *src,
- AddrSpace as);
libbpf::bpf_func_id selectProbeReadHelper(AddrSpace as, bool str);
std::map<std::string, StructType *> structs_;
diff --git a/src/ast/passes/codegen_llvm.cpp b/src/ast/passes/codegen_llvm.cpp
index a818ca0b..2b888087 100644
--- a/src/ast/passes/codegen_llvm.cpp
+++ b/src/ast/passes/codegen_llvm.cpp
@@ -1133,8 +1133,12 @@ void CodegenLLVM::visit(Call &call)
auto left_string = getString(left_arg);
auto right_string = getString(right_arg);
- expr_ = b_.CreateStrncmp(
- left_string.first, right_string.first, size, false);
+ expr_ = b_.CreateStrncmp(left_string.first,
+ left_string.second,
+ right_string.first,
+ right_string.second,
+ size,
+ false);
}
else if (call.func == "override")
{
@@ -1269,8 +1273,7 @@ void CodegenLLVM::visit(Variable &var)
else
{
auto *var_alloca = variables_[var.ident];
- expr_ = b_.CreateLoad(var_alloca->getType()->getPointerElementType(),
- var_alloca);
+ expr_ = b_.CreateLoad(var_alloca->getAllocatedType(), var_alloca);
}
}
@@ -1310,7 +1313,12 @@ void CodegenLLVM::binop_string(Binop &binop)
auto right_string = getString(binop.right);
size_t len = std::min(left_string.second, right_string.second);
- expr_ = b_.CreateStrncmp(left_string.first, right_string.first, len, inverse);
+ expr_ = b_.CreateStrncmp(left_string.first,
+ left_string.second,
+ right_string.first,
+ right_string.second,
+ len,
+ inverse);
}
void CodegenLLVM::binop_buf(Binop &binop)
@@ -1334,7 +1342,12 @@ void CodegenLLVM::binop_buf(Binop &binop)
size_t len = std::min(binop.left->type.GetSize(),
binop.right->type.GetSize());
- expr_ = b_.CreateStrncmp(left_string, right_string, len, inverse);
+ expr_ = b_.CreateStrncmp(left_string,
+ binop.left->type.GetSize(),
+ right_string,
+ binop.right->type.GetSize(),
+ len,
+ inverse);
}
void CodegenLLVM::binop_int(Binop &binop)
@@ -3528,9 +3541,8 @@ void CodegenLLVM::createIncDec(Unop &unop)
else if (unop.expr->is_variable)
{
Variable &var = static_cast<Variable &>(*unop.expr);
- Value *oldval = b_.CreateLoad(
- variables_[var.ident]->getType()->getPointerElementType(),
- variables_[var.ident]);
+ Value *oldval = b_.CreateLoad(variables_[var.ident]->getAllocatedType(),
+ variables_[var.ident]);
Value *newval;
if (is_increment)
newval = b_.CreateAdd(oldval, b_.GetIntSameSize(step, oldval));
--
2.38.1

View File

@ -0,0 +1,64 @@
From 7598b2b918835ab71e48bd7617812bde3a2537a7 Mon Sep 17 00:00:00 2001
From: Jerome Marchand <jmarchan@redhat.com>
Date: Thu, 11 Jun 2020 14:56:36 +0200
Subject: [PATCH 4/6] RHEL-8: aarch64: fixes statsnoop and opensnoop
On aarch64 the open syscall has been dropped. Only openat remains,
wich is called by libc open() function.
The state of *stat* syscalls, is a mess. They are several generations
of the system calls, and not all arches provides all of them. For
instance, new(l)stat are missing from aarch64.
The only way I can think of fixing thess is RHEL-8 only arch specific
patches.
---
tools/opensnoop.bt | 2 --
tools/statsnoop.bt | 8 ++------
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/tools/opensnoop.bt b/tools/opensnoop.bt
index a7de8026..d99db93e 100755
--- a/tools/opensnoop.bt
+++ b/tools/opensnoop.bt
@@ -21,13 +21,11 @@ BEGIN
printf("%-6s %-16s %4s %3s %s\n", "PID", "COMM", "FD", "ERR", "PATH");
}
-tracepoint:syscalls:sys_enter_open,
tracepoint:syscalls:sys_enter_openat
{
@filename[tid] = args->filename;
}
-tracepoint:syscalls:sys_exit_open,
tracepoint:syscalls:sys_exit_openat
/@filename[tid]/
{
diff --git a/tools/statsnoop.bt b/tools/statsnoop.bt
index b2d529e2..f612ea94 100755
--- a/tools/statsnoop.bt
+++ b/tools/statsnoop.bt
@@ -30,17 +30,13 @@ tracepoint:syscalls:sys_enter_statfs
@filename[tid] = args->pathname;
}
-tracepoint:syscalls:sys_enter_statx,
-tracepoint:syscalls:sys_enter_newstat,
-tracepoint:syscalls:sys_enter_newlstat
+tracepoint:syscalls:sys_enter_statx
{
@filename[tid] = args->filename;
}
tracepoint:syscalls:sys_exit_statfs,
-tracepoint:syscalls:sys_exit_statx,
-tracepoint:syscalls:sys_exit_newstat,
-tracepoint:syscalls:sys_exit_newlstat
+tracepoint:syscalls:sys_exit_statx
/@filename[tid]/
{
$ret = args->ret;
--
2.35.3

View File

@ -0,0 +1,82 @@
From 7e813d0e3048f52781199384a120f5e5cbad22ae Mon Sep 17 00:00:00 2001
From: Viktor Malik <viktor.malik@gmail.com>
Date: Mon, 5 Dec 2022 13:31:25 +0100
Subject: [PATCH] RHEL8: remove not existing attachpoints from tools
tools/bio* attempt to attach each probe to multiple kprobes to cover all
possible systems. Remove probes which do not exist in RHEL8 to remove
unnecessary warnings.
---
tools/biolatency.bt | 6 ++----
tools/biostacks.bt | 4 +---
tools/old/biosnoop.bt | 6 ++----
3 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/tools/biolatency.bt b/tools/biolatency.bt
index d5af1f29..4ea910b4 100755
--- a/tools/biolatency.bt
+++ b/tools/biolatency.bt
@@ -16,14 +16,12 @@ BEGIN
printf("Tracing block device I/O... Hit Ctrl-C to end.\n");
}
-kprobe:blk_account_io_start,
-kprobe:__blk_account_io_start
+kprobe:blk_account_io_start
{
@start[arg0] = nsecs;
}
-kprobe:blk_account_io_done,
-kprobe:__blk_account_io_done
+kprobe:blk_account_io_done
/@start[arg0]/
{
@usecs = hist((nsecs - @start[arg0]) / 1000);
diff --git a/tools/biostacks.bt b/tools/biostacks.bt
index 1bc9f819..80d8cb9e 100755
--- a/tools/biostacks.bt
+++ b/tools/biostacks.bt
@@ -18,14 +18,12 @@ BEGIN
printf("Tracing block I/O with init stacks. Hit Ctrl-C to end.\n");
}
-kprobe:blk_account_io_start,
-kprobe:__blk_account_io_start
+kprobe:blk_account_io_start
{
@reqstack[arg0] = kstack;
@reqts[arg0] = nsecs;
}
-kprobe:blk_start_request,
kprobe:blk_mq_start_request
/@reqts[arg0]/
{
diff --git a/tools/old/biosnoop.bt b/tools/old/biosnoop.bt
index 1a99643a..327251e3 100755
--- a/tools/old/biosnoop.bt
+++ b/tools/old/biosnoop.bt
@@ -22,8 +22,7 @@ BEGIN
printf("%-12s %-7s %-16s %-6s %7s\n", "TIME(ms)", "DISK", "COMM", "PID", "LAT(ms)");
}
-kprobe:blk_account_io_start,
-kprobe:__blk_account_io_start
+kprobe:blk_account_io_start
{
@start[arg0] = nsecs;
@iopid[arg0] = pid;
@@ -31,8 +30,7 @@ kprobe:__blk_account_io_start
@disk[arg0] = ((struct request *)arg0)->rq_disk->disk_name;
}
-kprobe:blk_account_io_done,
-kprobe:__blk_account_io_done
+kprobe:blk_account_io_done
/@start[arg0] != 0 && @iopid[arg0] != 0 && @iocomm[arg0] != ""/
{
--
2.38.1

View File

@ -0,0 +1,26 @@
From b74ab9e00b4628e0d8607c6ead8a674bedf280b9 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 10 Mar 2023 00:08:27 -0800
Subject: [PATCH] cmake: Raise max llvm major version to 16
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e63bc83c..433153be 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -169,7 +169,7 @@ else()
endif()
set(MIN_LLVM_MAJOR 6)
- set(MAX_LLVM_MAJOR 15)
+ set(MAX_LLVM_MAJOR 16)
if((${LLVM_VERSION_MAJOR} VERSION_LESS ${MIN_LLVM_MAJOR}) OR (${LLVM_VERSION_MAJOR} VERSION_GREATER ${MAX_LLVM_MAJOR}))
message(SEND_ERROR "Unsupported LLVM version found via ${LLVM_INCLUDE_DIRS}: ${LLVM_VERSION_MAJOR}")
--
2.40.1

View File

@ -0,0 +1,173 @@
From e661f2a043f8b6548e0bb3e0cc5992d7c0ff3b0f Mon Sep 17 00:00:00 2001
From: Rong Tao <rongtao@cestc.cn>
Date: Sat, 1 Oct 2022 16:15:27 +0800
Subject: [PATCH] tcpdrop: Fix: ERROR: Error attaching probe: 'kprobe:tcp_drop'
kernel commit 8fbf195798b5('tcp_drop() is no longer needed.') remove
the kprobe:tcp_drop, bcc commit 16eab39171eb('Add
tracepoint:skb:kfree_skb if no tcp_drop() kprobe.') already fix this
problem.
CI old kernel is too old and not support the 'reason' field, move the
old tools/tcpdrop.bt into tools/old/tcpdrop.bt and set the CI to use
it.
Since 5.17 support trace_kfree_skb(skb, ..., reason) 'reason' field.
Since 5.19 remove tcp_drop() function.
ERROR log:
$ sudo ./tcpdrop.bt
./tcpdrop.bt:49-51: WARNING: tcp_drop is not traceable (either non-existing, inlined, or marked as "notrace"); attaching to it will likely fail
Attaching 3 probes...
cannot attach kprobe, probe entry may not exist
ERROR: Error attaching probe: 'kprobe:tcp_drop'
Link: https://github.com/iovisor/bpftrace/pull/2379
Signed-off-by: Rong Tao <rongtao@cestc.cn>
---
tools/old/tcpdrop.bt | 85 ++++++++++++++++++++++++++++++++++++++++++++
tools/tcpdrop.bt | 22 ++++++------
2 files changed, 97 insertions(+), 10 deletions(-)
create mode 100755 tools/old/tcpdrop.bt
diff --git a/tools/old/tcpdrop.bt b/tools/old/tcpdrop.bt
new file mode 100755
index 00000000..685a5f6a
--- /dev/null
+++ b/tools/old/tcpdrop.bt
@@ -0,0 +1,85 @@
+#!/usr/bin/env bpftrace
+/*
+ * tcpdrop.bt Trace TCP kernel-dropped packets/segments.
+ * For Linux, uses bpftrace and eBPF.
+ *
+ * USAGE: tcpdrop.bt
+ *
+ * This is a bpftrace version of the bcc tool of the same name.
+ * It is limited to ipv4 addresses, and cannot show tcp flags.
+ *
+ * This provides information such as packet details, socket state, and kernel
+ * stack trace for packets/segments that were dropped via tcp_drop().
+
+ * WARNING: this script attaches to the tcp_drop kprobe which is likely inlined
+ * on newer kernels and not replaced by anything else, therefore
+ * the script will stop working
+ *
+ * For Linux <= 5.18.
+ *
+ * Copyright (c) 2018 Dale Hamel.
+ * Licensed under the Apache License, Version 2.0 (the "License")
+ *
+ * 23-Nov-2018 Dale Hamel created this.
+ */
+
+#ifndef BPFTRACE_HAVE_BTF
+#include <linux/socket.h>
+#include <net/sock.h>
+#else
+#include <sys/socket.h>
+#endif
+
+BEGIN
+{
+ printf("Tracing tcp drops. Hit Ctrl-C to end.\n");
+ printf("%-8s %-8s %-16s %-21s %-21s %-8s\n", "TIME", "PID", "COMM", "SADDR:SPORT", "DADDR:DPORT", "STATE");
+
+ // See https://github.com/torvalds/linux/blob/master/include/net/tcp_states.h
+ @tcp_states[1] = "ESTABLISHED";
+ @tcp_states[2] = "SYN_SENT";
+ @tcp_states[3] = "SYN_RECV";
+ @tcp_states[4] = "FIN_WAIT1";
+ @tcp_states[5] = "FIN_WAIT2";
+ @tcp_states[6] = "TIME_WAIT";
+ @tcp_states[7] = "CLOSE";
+ @tcp_states[8] = "CLOSE_WAIT";
+ @tcp_states[9] = "LAST_ACK";
+ @tcp_states[10] = "LISTEN";
+ @tcp_states[11] = "CLOSING";
+ @tcp_states[12] = "NEW_SYN_RECV";
+}
+
+kprobe:tcp_drop
+{
+ $sk = ((struct sock *) arg0);
+ $inet_family = $sk->__sk_common.skc_family;
+
+ if ($inet_family == AF_INET || $inet_family == AF_INET6) {
+ if ($inet_family == AF_INET) {
+ $daddr = ntop($sk->__sk_common.skc_daddr);
+ $saddr = ntop($sk->__sk_common.skc_rcv_saddr);
+ } else {
+ $daddr = ntop($sk->__sk_common.skc_v6_daddr.in6_u.u6_addr8);
+ $saddr = ntop($sk->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr8);
+ }
+ $lport = $sk->__sk_common.skc_num;
+ $dport = $sk->__sk_common.skc_dport;
+
+ // Destination port is big endian, it must be flipped
+ $dport = bswap($dport);
+
+ $state = $sk->__sk_common.skc_state;
+ $statestr = @tcp_states[$state];
+
+ time("%H:%M:%S ");
+ printf("%-8d %-16s ", pid, comm);
+ printf("%39s:%-6d %39s:%-6d %-10s\n", $saddr, $lport, $daddr, $dport, $statestr);
+ printf("%s\n", kstack);
+ }
+}
+
+END
+{
+ clear(@tcp_states);
+}
diff --git a/tools/tcpdrop.bt b/tools/tcpdrop.bt
index 3450a533..bb31107f 100755
--- a/tools/tcpdrop.bt
+++ b/tools/tcpdrop.bt
@@ -9,16 +9,15 @@
* It is limited to ipv4 addresses, and cannot show tcp flags.
*
* This provides information such as packet details, socket state, and kernel
- * stack trace for packets/segments that were dropped via tcp_drop().
-
- * WARNING: this script attaches to the tcp_drop kprobe which is likely inlined
- * on newer kernels and not replaced by anything else, therefore
- * the script will stop working
-
+ * stack trace for packets/segments that were dropped via kfree_skb.
+ *
+ * For Linux 5.17+ (see tools/old for script for lower versions).
+ *
* Copyright (c) 2018 Dale Hamel.
* Licensed under the Apache License, Version 2.0 (the "License")
-
+ *
* 23-Nov-2018 Dale Hamel created this.
+ * 01-Oct-2022 Rong Tao use tracepoint:skb:kfree_skb
*/
#ifndef BPFTRACE_HAVE_BTF
@@ -48,12 +47,15 @@ BEGIN
@tcp_states[12] = "NEW_SYN_RECV";
}
-kprobe:tcp_drop
+tracepoint:skb:kfree_skb
{
- $sk = ((struct sock *) arg0);
+ $reason = args->reason;
+ $skb = (struct sk_buff *)args->skbaddr;
+ $sk = ((struct sock *) $skb->sk);
$inet_family = $sk->__sk_common.skc_family;
- if ($inet_family == AF_INET || $inet_family == AF_INET6) {
+ if ($reason > SKB_DROP_REASON_NOT_SPECIFIED &&
+ ($inet_family == AF_INET || $inet_family == AF_INET6)) {
if ($inet_family == AF_INET) {
$daddr = ntop($sk->__sk_common.skc_daddr);
$saddr = ntop($sk->__sk_common.skc_rcv_saddr);
--
2.38.1

View File

@ -0,0 +1,27 @@
From 31a42a47b90f97a2a8c2446101c0007cf09288bc Mon Sep 17 00:00:00 2001
From: Viktor Malik <viktor.malik@gmail.com>
Date: Mon, 5 Dec 2022 11:57:24 +0100
Subject: [PATCH] tools/old/mdflush.bt: fix BPFTRACE_HAVE_BTF macro
The correct macro to use is called BPFTRACE_HAVE_BTF, not
__BPFTRACE_HAVE_BTF.
---
tools/old/mdflush.bt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/old/mdflush.bt b/tools/old/mdflush.bt
index 921c8f1b..23c7dd51 100755
--- a/tools/old/mdflush.bt
+++ b/tools/old/mdflush.bt
@@ -15,7 +15,7 @@
* 08-Sep-2018 Brendan Gregg Created this.
*/
-#ifndef __BPFTRACE_HAVE_BTF
+#ifndef BPFTRACE_HAVE_BTF
#include <linux/genhd.h>
#include <linux/bio.h>
#endif
--
2.38.1

View File

@ -1,43 +0,0 @@
From 1dce61acfec57712f84cfdf2a8f4c69d27744b04 Mon Sep 17 00:00:00 2001
From: Jerome Marchand <jmarchan@redhat.com>
Date: Tue, 11 Jun 2019 16:41:59 +0200
Subject: RHEL 8 fixes
Fixes the following RHEL 8 specific issues:
- library path in gethostlatency
---
tools/gethostlatency.bt | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/gethostlatency.bt b/tools/gethostlatency.bt
index a1ac1b2..ade1005 100755
--- a/tools/gethostlatency.bt
+++ b/tools/gethostlatency.bt
@@ -26,17 +26,17 @@ BEGIN
"HOST");
}
-uprobe:/lib/x86_64-linux-gnu/libc.so.6:getaddrinfo,
-uprobe:/lib/x86_64-linux-gnu/libc.so.6:gethostbyname,
-uprobe:/lib/x86_64-linux-gnu/libc.so.6:gethostbyname2
+uprobe:/lib64/libc.so.6:getaddrinfo,
+uprobe:/lib64/libc.so.6:gethostbyname,
+uprobe:/lib64/libc.so.6:gethostbyname2
{
@start[tid] = nsecs;
@name[tid] = arg0;
}
-uretprobe:/lib/x86_64-linux-gnu/libc.so.6:getaddrinfo,
-uretprobe:/lib/x86_64-linux-gnu/libc.so.6:gethostbyname,
-uretprobe:/lib/x86_64-linux-gnu/libc.so.6:gethostbyname2
+uretprobe:/lib64/libc.so.6:getaddrinfo,
+uretprobe:/lib64/libc.so.6:gethostbyname,
+uretprobe:/lib64/libc.so.6:gethostbyname2
/@start[tid]/
{
$latms = (nsecs - @start[tid]) / 1000000;
--
2.20.1

View File

@ -1,255 +0,0 @@
From acb0ee316d5ed776253b6d7bfccfb21e0005919b Mon Sep 17 00:00:00 2001
From: Jerome Marchand <jmarchan@redhat.com>
Date: Thu, 16 May 2019 14:56:50 +0200
Subject: [PATCH] fix clang_parser for LLVM 8+
LLVM changed the behavior of clang_Cursor_isAnonymous in [1]. The old
behavior would returned false for direct-acccess anonymous structs
within other structs, whereas LLVM 8 returns true. To circumvent this
behavior change among LLVM versions, we keep track of all structs
defined within a struct. We don't parse the substruct recursively (if we
do it might be parsed multiple times, and since we don't know yet if
this is a direct or indirect strucutre, we might parse it incorrectly),
instead we keep the cursor saved in a map. If this substruct is later
declared as an attribute of the supersctruct, that means we have a
direct-accessible struct. We remove it from our map, and we parse
recursively (parsing recursively the cursor pointing to the declaration
will effectively parse the struct definition).
After the first parse, any struct left in our map is an indirect struct.
Since we skipped the parsing stage for those, we need to run
`clang_visitChildren` again for each struct cursor we have saved. We
repeat this until there's no unvisited structs in the map. Keep in mind
that while visiting a new struct we might find more indirect structs.
Also add Travis jobs to test against LLVM and clang 8 on Ubuntu.
[1]: llvm/llvm-project@c05e6f4
---
.travis.yml | 4 ++
docker/Dockerfile.bionic-llvm8 | 36 ++++++++++++++
src/bpforc.h | 9 ++++
src/clang_parser.cpp | 87 +++++++++++++++++++++++-----------
4 files changed, 108 insertions(+), 28 deletions(-)
create mode 100644 docker/Dockerfile.bionic-llvm8
diff --git a/.travis.yml b/.travis.yml
index 7fbff63..b539868 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -20,6 +20,10 @@ sudo: required
env: BASE=fedora29 TYPE=Debug
- name: "LLVM 7 Release"
env: BASE=fedora29 TYPE=Release
+ - name: "LLVM 8 Debug"
+ env: BASE=bionic-llvm8 TYPE=Debug
+ - name: "LLVM 8 Release"
+ env: BASE=bionic-llvm8 TYPE=Release
allow_failures:
- name: "Static LLVM 5 Debug"
env: BASE=alpine TYPE=Debug STATIC_LINKING=ON TEST_ARGS="--gtest_filter=-codegen.string_equal_comparison:codegen.string_not_equal_comparison"
diff --git a/docker/Dockerfile.bionic-llvm8 b/docker/Dockerfile.bionic-llvm8
new file mode 100644
index 0000000..ebf10d3
--- /dev/null
+++ b/docker/Dockerfile.bionic-llvm8
@@ -0,0 +1,36 @@
+FROM ubuntu:bionic
+
+ENV llvmVersion=8
+
+RUN apt-get update && apt-get install -y curl gnupg &&\
+ llvmRepository='\n\
+deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main\n\
+deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic main\n\
+# 8\n\
+deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-8 main\n\
+deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic-8 main' && \
+ echo $llvmRepository >> /etc/apt/sources.list && \
+ curl -L https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
+ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4052245BD4284CDD && \
+ echo "deb https://repo.iovisor.org/apt/bionic bionic main" | tee /etc/apt/sources.list.d/iovisor.list
+
+RUN apt-get update && apt-get install -y \
+ bison \
+ cmake \
+ flex \
+ g++ \
+ git \
+ libelf-dev \
+ zlib1g-dev \
+ libbcc \
+ clang-${llvmVersion} \
+ libclang-${llvmVersion}-dev \
+ libclang-common-${llvmVersion}-dev \
+ libclang1-${llvmVersion} \
+ llvm-${llvmVersion} \
+ llvm-${llvmVersion}-dev \
+ llvm-${llvmVersion}-runtime \
+ libllvm${llvmVersion}
+
+COPY build.sh /build.sh
+ENTRYPOINT ["bash", "/build.sh"]
diff --git a/src/bpforc.h b/src/bpforc.h
index 1c134d0..8eede31 100644
--- a/src/bpforc.h
+++ b/src/bpforc.h
@@ -80,8 +80,13 @@ class BpfOrc
ExecutionSession ES;
std::unique_ptr<TargetMachine> TM;
std::shared_ptr<SymbolResolver> Resolver;
+#if LLVM_VERSION_MAJOR >= 8
+ LegacyRTDyldObjectLinkingLayer ObjectLayer;
+ LegacyIRCompileLayer<decltype(ObjectLayer), SimpleCompiler> CompileLayer;
+#else
RTDyldObjectLinkingLayer ObjectLayer;
IRCompileLayer<decltype(ObjectLayer), SimpleCompiler> CompileLayer;
+#endif
public:
std::map<std::string, std::tuple<uint8_t *, uintptr_t>> sections_;
@@ -91,7 +96,11 @@ class BpfOrc
Resolver(createLegacyLookupResolver(ES,
[](const std::string &Name __attribute__((unused))) -> JITSymbol { return nullptr; },
[](Error Err) { cantFail(std::move(Err), "lookup failed"); })),
+#if LLVM_VERSION_MAJOR >= 8
+ ObjectLayer(ES, [this](VModuleKey) { return LegacyRTDyldObjectLinkingLayer::Resources{std::make_shared<MemoryManager>(sections_), Resolver}; }),
+#else
ObjectLayer(ES, [this](VModuleKey) { return RTDyldObjectLinkingLayer::Resources{std::make_shared<MemoryManager>(sections_), Resolver}; }),
+#endif
CompileLayer(ObjectLayer, SimpleCompiler(*TM)) {}
void compileModule(std::unique_ptr<Module> M) {
diff --git a/src/clang_parser.cpp b/src/clang_parser.cpp
index 4bb8f87..7bb8d6a 100644
--- a/src/clang_parser.cpp
+++ b/src/clang_parser.cpp
@@ -1,5 +1,7 @@
#include <clang-c/Index.h>
#include <iostream>
+#include <unordered_map>
+#include <unordered_set>
#include <string.h>
#include <sys/utsname.h>
#include <sys/stat.h>
@@ -13,6 +15,9 @@
namespace bpftrace {
+std::unordered_map<std::string, CXCursor> indirect_structs;
+std::unordered_set<std::string> unvisited_indirect_structs;
+
static std::string get_clang_string(CXString string)
{
std::string str = clang_getCString(string);
@@ -30,8 +35,9 @@ static CXCursor get_indirect_field_parent_struct(CXCursor c)
{
CXCursor parent = clang_getCursorSemanticParent(c);
- while (!clang_Cursor_isNull(parent) && clang_Cursor_isAnonymous(parent))
- parent = clang_getCursorSemanticParent(parent);
+ while (!clang_Cursor_isNull(parent) && indirect_structs.count(get_clang_string(clang_getTypeSpelling(clang_getCanonicalType(clang_getCursorType(parent))))) > 0) {
+ parent = clang_getCursorSemanticParent(parent);
+ }
return parent;
}
@@ -253,44 +259,69 @@ void ClangParser::parse(ast::Program *program, BPFtrace &bpftrace)
std::cerr << "Input (" << input.size() << "): " << input << std::endl;
}
- CXCursor cursor = clang_getTranslationUnitCursor(translation_unit);
+ indirect_structs.clear();
+ unvisited_indirect_structs.clear();
- clang_visitChildren(
- cursor,
- [](CXCursor c, CXCursor parent, CXClientData client_data)
- {
+ CXCursor cursor = clang_getTranslationUnitCursor(translation_unit);
- if (clang_getCursorKind(parent) != CXCursor_StructDecl &&
- clang_getCursorKind(parent) != CXCursor_UnionDecl)
- return CXChildVisit_Recurse;
+ bool iterate = true;
- if (clang_getCursorKind(c) == CXCursor_FieldDecl)
+ do {
+ clang_visitChildren(
+ cursor,
+ [](CXCursor c, CXCursor parent, CXClientData client_data)
{
- auto &structs = static_cast<BPFtrace*>(client_data)->structs_;
- auto struct_name = get_parent_struct_name(c);
- auto ident = get_clang_string(clang_getCursorSpelling(c));
- auto offset = clang_Cursor_getOffsetOfField(c) / 8;
- auto type = clang_getCanonicalType(clang_getCursorType(c));
+ if (clang_getCursorKind(parent) != CXCursor_StructDecl &&
+ clang_getCursorKind(parent) != CXCursor_UnionDecl)
+ return CXChildVisit_Recurse;
auto ptype = clang_getCanonicalType(clang_getCursorType(parent));
auto ptypestr = get_clang_string(clang_getTypeSpelling(ptype));
auto ptypesize = clang_Type_getSizeOf(ptype);
- if(clang_Cursor_isAnonymous(parent))
- offset = get_indirect_field_offset(c);
+ if (clang_getCursorKind(c) == CXCursor_StructDecl ||
+ clang_getCursorKind(c) == CXCursor_UnionDecl) {
+ auto struct_name = get_clang_string(clang_getTypeSpelling(clang_getCanonicalType(clang_getCursorType(c))));
+ indirect_structs[struct_name] = c;
+ unvisited_indirect_structs.insert(struct_name);
- if (struct_name == "")
- struct_name = ptypestr;
- remove_struct_prefix(struct_name);
+ return CXChildVisit_Continue;
+ }
- structs[struct_name].fields[ident].offset = offset;
- structs[struct_name].fields[ident].type = get_sized_type(type);
- structs[struct_name].size = ptypesize;
- }
+ if (clang_getCursorKind(c) == CXCursor_FieldDecl)
+ {
+ auto &structs = static_cast<BPFtrace*>(client_data)->structs_;
+ auto struct_name = get_parent_struct_name(c);
+ auto ident = get_clang_string(clang_getCursorSpelling(c));
+ auto offset = clang_Cursor_getOffsetOfField(c) / 8;
+ auto type = clang_getCanonicalType(clang_getCursorType(c));
+ auto typestr = get_clang_string(clang_getTypeSpelling(type));
- return CXChildVisit_Recurse;
- },
- &bpftrace);
+ if (indirect_structs.count(typestr))
+ indirect_structs.erase(typestr);
+
+ if(indirect_structs.count(ptypestr))
+ offset = get_indirect_field_offset(c);
+
+ if (struct_name == "")
+ struct_name = ptypestr;
+ remove_struct_prefix(struct_name);
+
+ structs[struct_name].fields[ident].offset = offset;
+ structs[struct_name].fields[ident].type = get_sized_type(type);
+ structs[struct_name].size = ptypesize;
+ }
+
+ return CXChildVisit_Recurse;
+ },
+ &bpftrace);
+ if (unvisited_indirect_structs.size()) {
+ cursor = indirect_structs[*unvisited_indirect_structs.begin()];
+ unvisited_indirect_structs.erase(unvisited_indirect_structs.begin());
+ } else {
+ iterate = false;
+ }
+ } while (iterate);
clang_disposeTranslationUnit(translation_unit);
clang_disposeIndex(index);
--
2.20.1

View File

@ -1,356 +0,0 @@
From 5143209e8744d242431229972d9affa32ba3cc1a Mon Sep 17 00:00:00 2001
From: Matheus Marchini <mat@mmarchini.me>
Date: Fri, 12 Apr 2019 16:27:51 -0700
Subject: [PATCH 1/3] [clang_parser] pass BPFtrace as arg instead of StructMap
---
src/clang_parser.cpp | 6 +--
src/clang_parser.h | 3 +-
src/main.cpp | 2 +-
tests/clang_parser.cpp | 71 +++++++++++++++++++++++------------
tests/codegen/call_kstack.cpp | 4 +-
tests/codegen/call_ustack.cpp | 4 +-
tests/codegen/common.h | 2 +-
tests/codegen/general.cpp | 2 +-
tests/probe.cpp | 2 +-
tests/semantic_analyser.cpp | 2 +-
10 files changed, 61 insertions(+), 37 deletions(-)
diff --git a/src/clang_parser.cpp b/src/clang_parser.cpp
index b1db8ff..4bb8f87 100644
--- a/src/clang_parser.cpp
+++ b/src/clang_parser.cpp
@@ -172,7 +172,7 @@ static std::tuple<std::string, std::string> get_kernel_dirs(const struct utsname
return std::make_tuple(ksrc, kobj);
}
-void ClangParser::parse(ast::Program *program, StructMap &structs)
+void ClangParser::parse(ast::Program *program, BPFtrace &bpftrace)
{
auto input = program->c_definitions;
if (input.size() == 0)
@@ -259,7 +259,6 @@ void ClangParser::parse(ast::Program *program, StructMap &structs)
cursor,
[](CXCursor c, CXCursor parent, CXClientData client_data)
{
- auto &structs = *static_cast<StructMap*>(client_data);
if (clang_getCursorKind(parent) != CXCursor_StructDecl &&
clang_getCursorKind(parent) != CXCursor_UnionDecl)
@@ -267,6 +266,7 @@ void ClangParser::parse(ast::Program *program, StructMap &structs)
if (clang_getCursorKind(c) == CXCursor_FieldDecl)
{
+ auto &structs = static_cast<BPFtrace*>(client_data)->structs_;
auto struct_name = get_parent_struct_name(c);
auto ident = get_clang_string(clang_getCursorSpelling(c));
auto offset = clang_Cursor_getOffsetOfField(c) / 8;
@@ -290,7 +290,7 @@ void ClangParser::parse(ast::Program *program, StructMap &structs)
return CXChildVisit_Recurse;
},
- &structs);
+ &bpftrace);
clang_disposeTranslationUnit(translation_unit);
clang_disposeIndex(index);
diff --git a/src/clang_parser.h b/src/clang_parser.h
index d2ada5d..4289796 100644
--- a/src/clang_parser.h
+++ b/src/clang_parser.h
@@ -1,6 +1,7 @@
#pragma once
#include "struct.h"
+#include "bpftrace.h"
namespace bpftrace {
@@ -11,7 +12,7 @@ using StructMap = std::map<std::string, Struct>;
class ClangParser
{
public:
- void parse(ast::Program *program, StructMap &structs);
+ void parse(ast::Program *program, BPFtrace &bpftrace);
};
} // namespace bpftrace
diff --git a/src/main.cpp b/src/main.cpp
index ec3882d..f6659bf 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -272,7 +272,7 @@ int main(int argc, char *argv[])
}
ClangParser clang;
- clang.parse(driver.root_, bpftrace.structs_);
+ clang.parse(driver.root_, bpftrace);
ast::SemanticAnalyser semantics(driver.root_, bpftrace);
err = semantics.analyse();
diff --git a/tests/clang_parser.cpp b/tests/clang_parser.cpp
index f12a5e4..0c1ca31 100644
--- a/tests/clang_parser.cpp
+++ b/tests/clang_parser.cpp
@@ -1,25 +1,28 @@
#include "gtest/gtest.h"
#include "clang_parser.h"
#include "driver.h"
+#include "bpftrace.h"
namespace bpftrace {
namespace test {
namespace clang_parser {
-void parse(const std::string &input, StructMap &structs)
+void parse(const std::string &input, BPFtrace &bpftrace)
{
auto extended_input = input + "kprobe:sys_read { 1 }";
Driver driver;
ASSERT_EQ(driver.parse_str(extended_input), 0);
ClangParser clang;
- clang.parse(driver.root_, structs);
+ clang.parse(driver.root_, bpftrace);
}
TEST(clang_parser, integers)
{
- StructMap structs;
- parse("struct Foo { int x; int y, z; }", structs);
+ BPFtrace bpftrace;
+ parse("struct Foo { int x; int y, z; }", bpftrace);
+
+ StructMap &structs = bpftrace.structs_;
ASSERT_EQ(structs.size(), 1U);
ASSERT_EQ(structs.count("Foo"), 1U);
@@ -45,8 +48,10 @@ TEST(clang_parser, integers)
TEST(clang_parser, c_union)
{
- StructMap structs;
- parse("union Foo { char c; short s; int i; long l; }", structs);
+ BPFtrace bpftrace;
+ parse("union Foo { char c; short s; int i; long l; }", bpftrace);
+
+ StructMap &structs = bpftrace.structs_;
ASSERT_EQ(structs.size(), 1U);
ASSERT_EQ(structs.count("Foo"), 1U);
@@ -77,8 +82,10 @@ TEST(clang_parser, c_union)
TEST(clang_parser, integer_ptr)
{
- StructMap structs;
- parse("struct Foo { int *x; }", structs);
+ BPFtrace bpftrace;
+ parse("struct Foo { int *x; }", bpftrace);
+
+ StructMap &structs = bpftrace.structs_;
ASSERT_EQ(structs.size(), 1U);
ASSERT_EQ(structs.count("Foo"), 1U);
@@ -96,8 +103,10 @@ TEST(clang_parser, integer_ptr)
TEST(clang_parser, string_ptr)
{
- StructMap structs;
- parse("struct Foo { char *str; }", structs);
+ BPFtrace bpftrace;
+ parse("struct Foo { char *str; }", bpftrace);
+
+ StructMap &structs = bpftrace.structs_;
ASSERT_EQ(structs.size(), 1U);
ASSERT_EQ(structs.count("Foo"), 1U);
@@ -115,8 +124,10 @@ TEST(clang_parser, string_ptr)
TEST(clang_parser, string_array)
{
- StructMap structs;
- parse("struct Foo { char str[32]; }", structs);
+ BPFtrace bpftrace;
+ parse("struct Foo { char str[32]; }", bpftrace);
+
+ StructMap &structs = bpftrace.structs_;
ASSERT_EQ(structs.size(), 1U);
ASSERT_EQ(structs.count("Foo"), 1U);
@@ -132,8 +143,10 @@ TEST(clang_parser, string_array)
TEST(clang_parser, nested_struct_named)
{
- StructMap structs;
- parse("struct Bar { int x; } struct Foo { struct Bar bar; }", structs);
+ BPFtrace bpftrace;
+ parse("struct Bar { int x; } struct Foo { struct Bar bar; }", bpftrace);
+
+ StructMap &structs = bpftrace.structs_;
ASSERT_EQ(structs.size(), 2U);
ASSERT_EQ(structs.count("Foo"), 1U);
@@ -151,8 +164,10 @@ TEST(clang_parser, nested_struct_named)
TEST(clang_parser, nested_struct_ptr_named)
{
- StructMap structs;
- parse("struct Bar { int x; } struct Foo { struct Bar *bar; }", structs);
+ BPFtrace bpftrace;
+ parse("struct Bar { int x; } struct Foo { struct Bar *bar; }", bpftrace);
+
+ StructMap &structs = bpftrace.structs_;
ASSERT_EQ(structs.size(), 2U);
ASSERT_EQ(structs.count("Foo"), 1U);
@@ -172,8 +187,10 @@ TEST(clang_parser, nested_struct_ptr_named)
TEST(clang_parser, nested_struct_anon)
{
- StructMap structs;
- parse("struct Foo { struct { int x; } bar; }", structs);
+ BPFtrace bpftrace;
+ parse("struct Foo { struct { int x; } bar; }", bpftrace);
+
+ StructMap &structs = bpftrace.structs_;
ASSERT_EQ(structs.size(), 2U);
ASSERT_EQ(structs.count("Foo"), 1U);
@@ -190,8 +207,10 @@ TEST(clang_parser, nested_struct_anon)
TEST(clang_parser, nested_struct_indirect_fields)
{
- StructMap structs;
- parse("struct Foo { struct { int x; int y;}; int a; struct { int z; }; }", structs);
+ BPFtrace bpftrace;
+ parse("struct Foo { struct { int x; int y;}; int a; struct { int z; }; }", bpftrace);
+
+ StructMap &structs = bpftrace.structs_;
ASSERT_EQ(structs["Foo"].fields.size(), 4U);
EXPECT_EQ(structs["Foo"].fields["x"].offset, 0);
@@ -206,8 +225,10 @@ TEST(clang_parser, nested_struct_indirect_fields)
TEST(clang_parser, nested_struct_anon_union_struct)
{
- StructMap structs;
- parse("struct Foo { union { long long _xy; struct { int x; int y;}; }; int a; struct { int z; }; }", structs);
+ BPFtrace bpftrace;
+ parse("struct Foo { union { long long _xy; struct { int x; int y;}; }; int a; struct { int z; }; }", bpftrace);
+
+ StructMap &structs = bpftrace.structs_;
ASSERT_EQ(structs["Foo"].fields.size(), 5U);
EXPECT_EQ(structs["Foo"].fields["_xy"].offset, 0);
@@ -225,8 +246,10 @@ TEST(clang_parser, nested_struct_anon_union_struct)
TEST(clang_parser, builtin_headers)
{
// size_t is definied in stddef.h
- StructMap structs;
- parse("#include <stddef.h>\nstruct Foo { size_t x, y, z; }", structs);
+ BPFtrace bpftrace;
+ parse("#include <stddef.h>\nstruct Foo { size_t x, y, z; }", bpftrace);
+
+ StructMap &structs = bpftrace.structs_;
ASSERT_EQ(structs.count("Foo"), 1U);
diff --git a/tests/codegen/call_kstack.cpp b/tests/codegen/call_kstack.cpp
index a184af2..e64d498 100644
--- a/tests/codegen/call_kstack.cpp
+++ b/tests/codegen/call_kstack.cpp
@@ -68,7 +68,7 @@ TEST(codegen, call_kstack_mapids)
ASSERT_EQ(driver.parse_str("kprobe:f { @x = kstack(5); @y = kstack(6); @z = kstack(6) }"), 0);
ClangParser clang;
- clang.parse(driver.root_, bpftrace.structs_);
+ clang.parse(driver.root_, bpftrace);
ast::SemanticAnalyser semantics(driver.root_, bpftrace);
ASSERT_EQ(semantics.analyse(), 0);
@@ -96,7 +96,7 @@ TEST(codegen, call_kstack_modes_mapids)
ASSERT_EQ(driver.parse_str("kprobe:f { @x = kstack(perf); @y = kstack(bpftrace); @z = kstack() }"), 0);
ClangParser clang;
- clang.parse(driver.root_, bpftrace.structs_);
+ clang.parse(driver.root_, bpftrace);
ast::SemanticAnalyser semantics(driver.root_, bpftrace);
ASSERT_EQ(semantics.analyse(), 0);
diff --git a/tests/codegen/call_ustack.cpp b/tests/codegen/call_ustack.cpp
index 8e80558..1941d36 100644
--- a/tests/codegen/call_ustack.cpp
+++ b/tests/codegen/call_ustack.cpp
@@ -74,7 +74,7 @@ TEST(codegen, call_ustack_mapids)
ASSERT_EQ(driver.parse_str("kprobe:f { @x = ustack(5); @y = ustack(6); @z = ustack(6) }"), 0);
ClangParser clang;
- clang.parse(driver.root_, bpftrace.structs_);
+ clang.parse(driver.root_, bpftrace);
ast::SemanticAnalyser semantics(driver.root_, bpftrace);
ASSERT_EQ(semantics.analyse(), 0);
@@ -102,7 +102,7 @@ TEST(codegen, call_ustack_modes_mapids)
ASSERT_EQ(driver.parse_str("kprobe:f { @x = ustack(perf); @y = ustack(bpftrace); @z = ustack() }"), 0);
ClangParser clang;
- clang.parse(driver.root_, bpftrace.structs_);
+ clang.parse(driver.root_, bpftrace);
ast::SemanticAnalyser semantics(driver.root_, bpftrace);
ASSERT_EQ(semantics.analyse(), 0);
diff --git a/tests/codegen/common.h b/tests/codegen/common.h
index 32f8bc8..bdf733a 100644
--- a/tests/codegen/common.h
+++ b/tests/codegen/common.h
@@ -30,7 +30,7 @@ static void test(const std::string &input, const std::string expected_output)
ASSERT_EQ(driver.parse_str(input), 0);
ClangParser clang;
- clang.parse(driver.root_, bpftrace.structs_);
+ clang.parse(driver.root_, bpftrace);
ast::SemanticAnalyser semantics(driver.root_, bpftrace);
ASSERT_EQ(semantics.analyse(), 0);
diff --git a/tests/codegen/general.cpp b/tests/codegen/general.cpp
index e7e7439..e67ae10 100644
--- a/tests/codegen/general.cpp
+++ b/tests/codegen/general.cpp
@@ -45,7 +45,7 @@ TEST(codegen, printf_offsets)
// TODO (mmarchini): also test printf with a string argument
ASSERT_EQ(driver.parse_str("struct Foo { char c; int i; } kprobe:f { $foo = (Foo*)0; printf(\"%c %u\\n\", $foo->c, $foo->i) }"), 0);
ClangParser clang;
- clang.parse(driver.root_, bpftrace.structs_);
+ clang.parse(driver.root_, bpftrace);
ast::SemanticAnalyser semantics(driver.root_, bpftrace);
ASSERT_EQ(semantics.analyse(), 0);
ASSERT_EQ(semantics.create_maps(true), 0);
diff --git a/tests/probe.cpp b/tests/probe.cpp
index e030830..cb9b765 100644
--- a/tests/probe.cpp
+++ b/tests/probe.cpp
@@ -28,7 +28,7 @@ void gen_bytecode(const std::string &input, std::stringstream &out)
ASSERT_EQ(driver.parse_str(input), 0);
ClangParser clang;
- clang.parse(driver.root_, bpftrace.structs_);
+ clang.parse(driver.root_, bpftrace);
ast::SemanticAnalyser semantics(driver.root_, bpftrace);
ASSERT_EQ(semantics.analyse(), 0);
diff --git a/tests/semantic_analyser.cpp b/tests/semantic_analyser.cpp
index 2067ed9..4e2485b 100644
--- a/tests/semantic_analyser.cpp
+++ b/tests/semantic_analyser.cpp
@@ -16,7 +16,7 @@ void test(BPFtrace &bpftrace, Driver &driver, const std::string &input, int expe
ASSERT_EQ(driver.parse_str(input), 0);
ClangParser clang;
- clang.parse(driver.root_, bpftrace.structs_);
+ clang.parse(driver.root_, bpftrace);
std::stringstream out;
ast::SemanticAnalyser semantics(driver.root_, bpftrace, out);
--
2.20.1

View File

@ -1,32 +0,0 @@
From 151351ea22c855e4e605b8fd2058c19dc4ae5ed6 Mon Sep 17 00:00:00 2001
From: Matheus Marchini <mat@mmarchini.me>
Date: Tue, 16 Apr 2019 12:06:01 -0700
Subject: [PATCH 2/2] fix struct definition from headers
Regression caused by iovisor/bpftrace@80ce138c7. With the changes on how
we identify the parent struct, we ended up with our parent cursor in the
header file sometimes instead of a valid cursor. This PR checks if the
parent cursor is a struct, otherwise returns an empty string and let the
caller handle the situation (which is similar to the previous behavior).
---
src/clang_parser.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/clang_parser.cpp b/src/clang_parser.cpp
index b1db8ff..b787b67 100644
--- a/src/clang_parser.cpp
+++ b/src/clang_parser.cpp
@@ -40,6 +40,10 @@ static std::string get_parent_struct_name(CXCursor c)
{
CXCursor parent = get_indirect_field_parent_struct(c);
+ if (clang_getCursorKind(parent) != CXCursor_StructDecl &&
+ clang_getCursorKind(parent) != CXCursor_UnionDecl)
+ return "";
+
return get_clang_string(clang_getCursorSpelling(parent));
}
--
2.20.1

View File

@ -1,17 +1,27 @@
%bcond_without llvm_static
Name: bpftrace
Version: 0.9
Release: 2%{?dist}
Version: 0.16.0
Release: 5%{?dist}
Summary: High-level tracing language for Linux eBPF
License: ASL 2.0
%define cereal_version 1.3.2
URL: https://github.com/iovisor/bpftrace
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
Patch0: %{name}-%{version}-clang_parser-pass-BPFtrace-as-arg-instead-of-StructM.patch
Patch1: %{name}-%{version}-clang_parser-fix-clang_parser-for-LLVM-8.patch
Patch2: %{name}-%{version}-fix-struct-definition-from-headers.patch
Patch3: %{name}-%{version}-RHEL-8-fixes.patch
# Cereal is a header-only serialization library which is not packaged into
# RHEL8, so we download it manually. This is ok to do as it is only necessary
# for build.
Source1: https://github.com/USCiLab/cereal/archive/v%{cereal_version}/cereal-%{cereal_version}.tar.gz
Patch0: %{name}-%{version}-IR-builder-get-rid-of-getPointerElementType-calls.patch
Patch1: %{name}-%{version}-tools-old-mdflush.bt-fix-BPFTRACE_HAVE_BTF-macro.patch
Patch2: %{name}-%{version}-tcpdrop-Fix-ERROR-Error-attaching-probe-kprobe-tcp_d.patch
Patch3: %{name}-%{version}-RHEL8-remove-not-existing-attachpoints-from-tools.patch
Patch4: %{name}-%{version}-cmake-Raise-max-llvm-major-version-to-16.patch
Patch5: %{name}-%{version}-Adjust-to-build-with-llvm-17.patch
Patch10: %{name}-%{version}-RHEL-8-aarch64-fixes-statsnoop-and-opensnoop.patch
# Arches will be included as upstream support is added and dependencies are
# satisfied in the respective arches
@ -26,11 +36,17 @@ BuildRequires: zlib-devel
BuildRequires: llvm-devel
BuildRequires: clang-devel
BuildRequires: bcc-devel
BuildRequires: libbpf-devel
BuildRequires: libbpf-static
BuildRequires: binutils-devel
%if %{with llvm_static}
BuildRequires: llvm-static
%endif
# We don't need kernel-devel to use bpftrace, but some tools need it
Recommends: kernel-devel
%description
BPFtrace is a high-level tracing language for Linux enhanced Berkeley Packet
Filter (eBPF) available in recent Linux kernels (4.x). BPFtrace uses LLVM as a
@ -42,28 +58,40 @@ and predecessor tracers such as DTrace and SystemTap
%prep
%autosetup -p1
%autosetup -N -a 1
%autopatch -p1 -M 9
%ifarch aarch64
%patch10 -p1
%endif
%build
# Set CPATH so that CMake finds the cereal headers
CPATH=$PWD/cereal-%{cereal_version}/include:$CPATH
export CPATH
%cmake . \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_TESTING:BOOL=OFF \
-DBUILD_SHARED_LIBS:BOOL=OFF \
-DLLVM_DIR=/usr/lib64/llvm7.0/lib/cmake/llvm/
-DBUILD_SHARED_LIBS:BOOL=OFF
%make_build
%install
# The post hooks strip the binary which removes
# the BEGIN_trigger and END_trigger functions
# which are needed for the BEGIN and END probes
%global __os_install_post %{nil}
%global _find_debuginfo_opts -g
%make_install
# Fix shebangs (https://fedoraproject.org/wiki/Packaging:Guidelines#Shebang_lines)
find %{buildroot}%{_datadir}/%{name}/tools -type f -exec \
sed -i -e '1s=^#!/usr/bin/env %{name}\([0-9.]\+\)\?$=#!%{_bindir}/%{name}=' {} \;
# Move man pages to the right location
mkdir -p %{buildroot}%{_mandir}
mv %{buildroot}%{_prefix}/man/* %{buildroot}%{_mandir}/
# Some tools require old versions for RHEL8
cp %{buildroot}/%{_datadir}/%{name}/tools/old/biosnoop.bt %{buildroot}/%{_datadir}/%{name}/tools
cp %{buildroot}/%{_datadir}/%{name}/tools/old/mdflush.bt %{buildroot}/%{_datadir}/%{name}/tools
%files
@ -73,14 +101,84 @@ mv %{buildroot}%{_prefix}/man/* %{buildroot}%{_mandir}/
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/tools
%dir %{_datadir}/%{name}/tools/doc
%dir %{_datadir}/%{name}/tools/old
%{_bindir}/%{name}
%{_bindir}/%{name}-aotrt
%{_mandir}/man8/*
%attr(0755,-,-) %{_datadir}/%{name}/tools/*.bt
%{_datadir}/%{name}/tools/doc/*.txt
# Do not include old versions of tools.
# Those that are needed were already installed as normal tools.
%exclude %{_datadir}/%{name}/tools/old
%changelog
* Wed Jun 12 2019 Jerome Marchand <jmarchan@redhat.com> - 0.9.2
* Mon Nov 06 2023 - 0.16.0-5
- Rebuild for LLVM17
- Resolves: RHEL-10690
* Fri Jun 09 2023 Viktor Malik <vmalik@redhat.com> - 0.16.0-3
- Add forgotten patch raising LLVM version in CMake
- Resolves: rhbz#2192950
* Fri Jun 09 2023 Viktor Malik <vmalik@redhat.com> - 0.16.0-2
- Rebuild for LLVM16
- Resolves: rhbz#2192950
* Wed Nov 30 2022 Viktor Malik <vmalik@redhat.com> - 0.16.0-1
- Rebase on bpftrace 0.16.0
- Rebuild for LLVM15
- Download the cereal library (not packaged into RHEL8)
* Thu Jun 02 2022 Jerome Marchand <jmarchan@redhat.com> - 0.13.1-1
- Rebase on bpftrace 0.13.1
- Rebuild on LLVM14
* Thu Dec 02 2021 Jerome Marchand <jmarchan@redhat.com> - 0.12.1-4
- Rebuild on LLVM13
- Small spec cleanup
* Thu Jun 24 2021 Jerome Marchand <jmarchan@redhat.com> - 0.12.1-3
- Have threadsnoop points to libpthread.so.0
* Wed Jun 09 2021 Jerome Marchand <jmarchan@redhat.com> - 0.12.1-2
- Rebuild on LLVM12
* Fri Apr 30 2021 Jerome Marchand <jmarchan@redhat.com> - 0.12.1-1
- Rebase on bpftrace 0.12.1
* Thu Jan 28 2021 Jerome Marchand <jmarchan@redhat.com> - 0.11.1-3
- Add missing libbpf and binutils-dev dependencies
* Wed Nov 11 2020 Jerome Marchand <jmarchan@redhat.com> - 0.11.1-2
- Fix statsnoop and opensnoop on aarch64 again
* Fri Nov 06 2020 Jerome Marchand <jmarchan@redhat.com> - 0.11.1-1
- Rebase on bpftrace 0.11.1
* Tue Oct 27 2020 Jerome Marchand <jmarchan@redhat.com> - 0.10.0-5
- Rebuild for bcc 0.16.0
* Thu Jun 11 2020 Jerome Marchand <jmarchan@redhat.com> - 0.10.0-4
- Fix KBUILD_MODNAME
* Thu Jun 11 2020 Jerome Marchand <jmarchan@redhat.com> - 0.10.0-3
- Fix ENOMEM issue on arm64 machine with many cpus
- Fix statsnoop and opensnoop on aarch64
- Drop tcpdrop on ppc64
* Tue May 05 2020 Jerome Marchand <jmarchan@redhat.com> - 0.10.0-2
- Fix libpthread path in threadsnoop
* Wed Apr 22 2020 Jerome Marchand <jmarchan@redhat.com> - 0.10.0-1
- Rebase on bpftrace 0.10.0
* Fri Nov 08 2019 Jerome Marchand <jmarchan@redhat.com> - 0.9.2-1
- Rebase on bpftrace 0.9.2
* Tue Jun 18 2019 Jerome Marchand <jmarchan@redhat.com> - 0.9-3
- Don't allow to raw_spin_lock* kprobes that can deadlock the kernel.
* Wed Jun 12 2019 Jerome Marchand <jmarchan@redhat.com> - 0.9-2
- Fixes gethostlatency
- Fixes a struct definition issue that made several tools fail
- Add CI gating