Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
Signed-off-by: kpattaswamy <[email protected]>
  • Loading branch information
kpattaswamy committed Jan 6, 2025
1 parent ffcb674 commit edf06fa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 1 addition & 3 deletions src/stirling/bpf_tools/probe_specs/probe_specs.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,7 @@ struct TracepointSpec {
struct KFuncSpec {
std::string kfunc;

std::string ToString() const {
return absl::Substitute("[kfunc=$0]", kfunc);
}
std::string ToString() const { return absl::Substitute("[kfunc=$0]", kfunc); }
};

/**
Expand Down
4 changes: 1 addition & 3 deletions src/stirling/source_connectors/tcp_stats/bcc_bpf/tcp_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,7 @@ int probe_entry_tcp_retransmit_skb(struct pt_regs* ctx, struct sock* skp, struct
return 0;
}

KFUNC_PROBE(tcp_sendmsg, struct sock* sk) {
return tcp_send_entry(sk);
}
KFUNC_PROBE(tcp_sendmsg, struct sock* sk) { return tcp_send_entry(sk); }

KRETFUNC_PROBE(tcp_sendmsg, struct sock* sk, struct msghdr* msg, size_t size, int ret) {
if (ret > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ const auto kSendPageProbeSpecs = MakeArray<bpf_tools::KProbeSpec>(
{{"tcp_sendpage", ProbeType::kEntry, "probe_entry_tcp_sendpage", /*is_syscall*/ false},
{"tcp_sendpage", ProbeType::kReturn, "probe_ret_tcp_sendpage", /*is_syscall*/ false}});

const auto kFuncSpecs = MakeArray<bpf_tools::KFuncSpec>({{"kfunc__vmlinux__tcp_sendmsg"}, {"kretfunc__vmlinux__tcp_sendmsg"}});
const auto kFuncSpecs = MakeArray<bpf_tools::KFuncSpec>(
{{"kfunc__vmlinux__tcp_sendmsg"}, {"kretfunc__vmlinux__tcp_sendmsg"}});

void HandleTcpEvent(void* cb_cookie, void* data, int /*data_size*/) {
auto* connector = reinterpret_cast<TCPStatsConnector*>(cb_cookie);
Expand Down Expand Up @@ -83,8 +84,8 @@ Status TCPStatsConnector::InitImpl() {
sendpage_attach_status.msg(), kernel_version.ToString());
}

// 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.
// 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));

PX_RETURN_IF_ERROR(bcc_->OpenPerfBuffers(perf_buffer_specs));
Expand Down

0 comments on commit edf06fa

Please sign in to comment.