diff --git a/user/config/config_openssl_linux.go b/user/config/config_openssl_linux.go index c2167f655..9dbc3715f 100644 --- a/user/config/config_openssl_linux.go +++ b/user/config/config_openssl_linux.go @@ -139,6 +139,7 @@ func (oc *OpensslConfig) checkConnect() error { //如果没找到,则报错。 if !found || funcName == "" { + oc.Pthread = "" return errors.New(fmt.Sprintf("cant found 'connect' function to hook in files::%v", connectSharedObjects)) } return nil @@ -173,7 +174,8 @@ func (oc *OpensslConfig) Check() error { } if !checkedConnect { - return oc.checkConnect() + // Optional check + _ = oc.checkConnect() } s, e := checkCgroupPath(oc.CGroupPath) if e != nil { diff --git a/user/module/probe_openssl.go b/user/module/probe_openssl.go index e3311ae01..713f47c4e 100644 --- a/user/module/probe_openssl.go +++ b/user/module/probe_openssl.go @@ -297,7 +297,8 @@ func (m *MOpenSSLProbe) setupManagersUprobe() error { libPthread = m.conf.(*config.OpensslConfig).Pthread if libPthread == "" { - libPthread = "/lib/x86_64-linux-gnu/libpthread.so.0" + //libPthread = "/lib/x86_64-linux-gnu/libpthread.so.0" + m.logger.Printf("%s\tlibPthread path not found, IP info lost.\n", m.Name()) } _, err := os.Stat(binaryPath) @@ -392,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{