Skip to content

Commit

Permalink
libbcc: assume HAVE_BCC_USDT_ADDSEM
Browse files Browse the repository at this point in the history
  • Loading branch information
Delyan Kratunov authored and BurntBrunch committed Nov 2, 2022
1 parent d03160f commit 20beac2
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 31 deletions.
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ endif(STATIC_BPF_BCC)
get_filename_component(LIBBCC_LIBDIR ${LIBBCC_LIBRARIES} DIRECTORY)
set(CMAKE_REQUIRED_LINK_OPTIONS -L${LIBBCC_LIBDIR})

check_symbol_exists(bcc_usdt_addsem_probe "${LIBBCC_INCLUDE_DIRS}/bcc/bcc_usdt.h" HAVE_BCC_USDT_ADDSEM)
check_symbol_exists(bcc_procutils_which_so "${LIBBCC_INCLUDE_DIRS}/bcc/bcc_proc.h" HAVE_BCC_WHICH_SO)

set(CMAKE_REQUIRED_LIBRARIES)
Expand Down Expand Up @@ -213,10 +212,6 @@ if(HAVE_NAME_TO_HANDLE_AT)
set(BPFTRACE_FLAGS "${BPFTRACE_FLAGS}" HAVE_NAME_TO_HANDLE_AT=1)
endif(HAVE_NAME_TO_HANDLE_AT)

if(HAVE_BCC_USDT_ADDSEM)
set(BPFTRACE_FLAGS "${BPFTRACE_FLAGS}" HAVE_BCC_USDT_ADDSEM)
endif(HAVE_BCC_USDT_ADDSEM)

if(HAVE_BCC_WHICH_SO)
set(BPFTRACE_FLAGS "${BPFTRACE_FLAGS}" HAVE_BCC_WHICH_SO)
endif(HAVE_BCC_WHICH_SO)
Expand Down
14 changes: 0 additions & 14 deletions src/attached_probe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,6 @@ int AttachedProbe::usdt_sem_up_manual(const std::string &fn_name, void *ctx)
return err;
}

#ifdef HAVE_BCC_USDT_ADDSEM
int AttachedProbe::usdt_sem_up_manual_addsem(int pid,
const std::string &fn_name,
void *ctx)
Expand Down Expand Up @@ -952,15 +951,6 @@ int AttachedProbe::usdt_sem_up_manual_addsem(int pid,

return err;
}
#else
int AttachedProbe::usdt_sem_up_manual_addsem(int pid __attribute__((unused)),
const std::string &fn_name
__attribute__((unused)),
void *ctx __attribute__((unused)))
{
return 0;
}
#endif // HAVE_BCC_USDT_ADDSEM

int AttachedProbe::usdt_sem_up([[maybe_unused]] BPFfeature &feature,
[[maybe_unused]] int pid,
Expand All @@ -976,11 +966,7 @@ int AttachedProbe::usdt_sem_up([[maybe_unused]] BPFfeature &feature,
return 0;
}

#if defined(HAVE_BCC_USDT_ADDSEM)
return usdt_sem_up_manual_addsem(pid, fn_name, ctx);
#else
return usdt_sem_up_manual(fn_name, ctx);
#endif
}

void AttachedProbe::attach_usdt(int pid, BPFfeature &feature)
Expand Down
6 changes: 0 additions & 6 deletions src/build_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ std::string BuildInfo::report()
<< "yes" << std::endl;
#else
<< "no" << std::endl;
#endif
buf << " bcc_usdt_addsem: "
#ifdef HAVE_BCC_USDT_ADDSEM
<< "yes" << std::endl;
#else
<< "no" << std::endl;
#endif
buf << " bcc library path resolution: "
#ifdef HAVE_BCC_WHICH_SO
Expand Down
1 change: 0 additions & 1 deletion tests/runtime/engine/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ def __read_test_struct(test, test_suite):
"probe_read_kernel",
"dpath",
"uprobe_refcount",
"bcc_usdt_addsem",
"signal",
"iter:task",
"iter:task_file",
Expand Down
1 change: 0 additions & 1 deletion tests/runtime/engine/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ def __get_bpffeature():
bpffeature["dpath"] = output.find("dpath: yes") != -1
bpffeature["uprobe_refcount"] = \
output.find("uprobe refcount (depends on Build:bcc bpf_attach_uprobe refcount): yes") != -1
bpffeature["bcc_usdt_addsem"] = output.find("bcc_usdt_addsem: yes") != -1
bpffeature["signal"] = output.find("send_signal: yes") != -1
bpffeature["iter:task"] = output.find("iter:task: yes") != -1
bpffeature["iter:task_file"] = output.find("iter:task_file: yes") != -1
Expand Down
4 changes: 0 additions & 4 deletions tests/runtime/usdt
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,9 @@ RUN {{BPFTRACE}} -e 'usdt:./testprogs/usdt_test*::* { printf("here\n" ); exit();
EXPECT Attaching 3 probes...
TIMEOUT 5

# Wasn't fully debugged, but looks like old bcc API (bcc_usdt_enable_fully_specified_probe)
# doesn't like inlined usdt probes very much. So that's why the bcc_usdt_addsem feature is
# required
NAME "usdt probes - attach to probe on multiple files by wildcard"
PROG usdt:./testprogs/usdt*::* { printf("here\n" ); exit(); }
EXPECT Attaching 41 probes...
REQUIRES_FEATURE bcc_usdt_addsem
TIMEOUT 5

NAME "usdt probes - attach to probe on multiple providers by wildcard and pid"
Expand Down

0 comments on commit 20beac2

Please sign in to comment.