Skip to content

Commit

Permalink
check libPthread value.
Browse files Browse the repository at this point in the history
Signed-off-by: cfc4n <cfc4n.cs@gmail.com>
  • Loading branch information
cfc4n committed Nov 25, 2023
1 parent 463cdbe commit 71b4d41
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions user/module/probe_openssl.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,17 +393,19 @@ func (m *MOpenSSLProbe) setupManagersUprobe() error {
},
}

// detect libpthread.so path
_, err = os.Stat(libPthread)
if err == nil {
m.logger.Printf("%s\tlibPthread:%s\n", m.Name(), libPthread)
m.bpfManager.Probes = append(m.bpfManager.Probes, &manager.Probe{
Section: "uprobe/connect",
EbpfFuncName: "probe_connect",
AttachToFuncName: "connect",
BinaryPath: libPthread,
UID: "uprobe_connect",
})
if libPthread != "" {
// detect libpthread.so path
_, err = os.Stat(libPthread)
if err == nil {
m.logger.Printf("%s\tlibPthread:%s\n", m.Name(), libPthread)
m.bpfManager.Probes = append(m.bpfManager.Probes, &manager.Probe{
Section: "uprobe/connect",
EbpfFuncName: "probe_connect",
AttachToFuncName: "connect",
BinaryPath: libPthread,
UID: "uprobe_connect",
})
}
}

m.bpfManagerOptions = manager.Options{
Expand Down

0 comments on commit 71b4d41

Please sign in to comment.