From 71b4d41c1aef8a7953851c455b64c128ee26a868 Mon Sep 17 00:00:00 2001 From: cfc4n Date: Sat, 25 Nov 2023 22:12:00 +0800 Subject: [PATCH] check libPthread value. Signed-off-by: cfc4n --- user/module/probe_openssl.go | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/user/module/probe_openssl.go b/user/module/probe_openssl.go index e74858d43..713f47c4e 100644 --- a/user/module/probe_openssl.go +++ b/user/module/probe_openssl.go @@ -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{