Skip to content

Commit

Permalink
Log when kfunc fails to attach on an older kernel
Browse files Browse the repository at this point in the history
Signed-off-by: kpattaswamy <[email protected]>
  • Loading branch information
kpattaswamy committed Jan 7, 2025
1 parent e478ecf commit 8d77b86
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/stirling/source_connectors/tcp_stats/tcp_stats_connector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,19 @@ Status TCPStatsConnector::InitImpl() {

// We deploy kfunc probes for the tcp_sendmsg function to side step a probe insertion conflict
// with the socket tracer since it already deploys kprobes for the tcp_sendmsg function.
PX_RETURN_IF_ERROR(bcc_->AttachKFuncs(kFuncSpecs));
const auto kfunc_attach_status = bcc_->AttachKFuncs(kFuncSpecs);
if (!kfunc_attach_status.ok()) {
const auto kernel_version = system::GetCachedKernelVersion();
LOG(INFO) << absl::Substitute(
"Could not attach kfunc probes for tcp_sendmsg: $0, detected kernel version: $1. Note: "
"kfunc probes are supported on kernel version 5.5 and newer.",
kfunc_attach_status.msg(), kernel_version.ToString());
} else {
LOG(INFO) << absl::Substitute("Successfully deployed $0 kfunc probes.", kFuncSpecs.size());
}

PX_RETURN_IF_ERROR(bcc_->OpenPerfBuffers(perf_buffer_specs));
LOG(INFO) << absl::Substitute("Successfully deployed $0 kprobes.", kProbeSpecs.size());
LOG(INFO) << absl::Substitute("Successfully deployed $0 kfunc probes.", kFuncSpecs.size());

return Status::OK();
}
Expand Down

0 comments on commit 8d77b86

Please sign in to comment.