Skip to content

Commit

Permalink
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
Delphix Engineering committed Dec 15, 2023
2 parents 447e9ac + 1772c21 commit f931f3b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
4 changes: 3 additions & 1 deletion src/ast/attachpoint_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ int AttachPointParser::parse()
{
for (size_t i = 0; i < probe->attach_points->size(); ++i)
{
auto &ap = *(*probe->attach_points)[i];
auto ap_ptr = (*probe->attach_points)[i];
auto &ap = *ap_ptr;
new_attach_points.clear();

State s = parse_attachpoint(ap);
Expand All @@ -88,6 +89,7 @@ int AttachPointParser::parse()
else if (s == SKIP || s == NEW_APS)
{
// Remove the current attach point
delete ap_ptr;
probe->attach_points->erase(probe->attach_points->begin() + i);
i--;
if (s == NEW_APS)
Expand Down
5 changes: 0 additions & 5 deletions src/attached_probe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -909,11 +909,6 @@ void AttachedProbe::load_prog(BPFfeature &feature)
cache_progfd();
}

static inline uint64_t ptr_to_u64(const void *ptr)
{
return (uint64_t)(unsigned long)ptr;
}

void AttachedProbe::attach_multi_kprobe(void)
{
DECLARE_LIBBPF_OPTS(bpf_link_create_opts, opts);
Expand Down
8 changes: 4 additions & 4 deletions tests/memleak-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ fi

# Add new testcases here
tests=(
'"BEGIN { exit(); }"'
$'"#include <linux/skbuff.h>\n BEGIN { \$x = ((struct sk_buff *)curtask)->data_len; exit(); }"'
'bpftrace -e "BEGIN { exit(); }"'
$'bpftrace -e "#include <linux/skbuff.h>\n BEGIN { \$x = ((struct sk_buff *)curtask)->data_len; exit(); }"'
'bpftrace -l "kprobe_seq_*"'
)

echo "${GREEN}[==========]${NC} Running ${#tests[@]} tests"

result=0
for tst in "${tests[@]}"; do
echo "${GREEN}[ RUN ]${NC} bpftrace -e $tst"
echo "${GREEN}[ RUN ]${NC} $tst"

export ASAN_OPTIONS="alloc_dealloc_mismatch=0"
if eval $BPFTRACE_ASAN -e "$tst" > /dev/null 2>&1 ; then
Expand All @@ -56,4 +57,3 @@ else
fi

exit $result

0 comments on commit f931f3b

Please sign in to comment.