|
|
@@ -1451,7 +1451,6 @@ func (c *Container) AttachUprobes(tracer *ebpftracer.Tracer, pid uint32) error {
|
|
|
c.DetachUprobes(pid, APP_UPROBE_ERROR)
|
|
|
return err
|
|
|
}
|
|
|
- c.l7AttachSuccess()
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
@@ -1471,22 +1470,26 @@ func (c *Container) attachTlsUprobes(tracer *ebpftracer.Tracer, pid uint32) erro
|
|
|
if p == nil {
|
|
|
return nil
|
|
|
}
|
|
|
+ if p.openSslUprobesChecked || p.goTlsUprobesChecked {
|
|
|
+ return nil
|
|
|
+ }
|
|
|
if !p.openSslUprobesChecked {
|
|
|
+ p.openSslUprobesChecked = true
|
|
|
sslProbes, err := tracer.AttachOpenSslUprobes(pid)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
p.uprobes = append(p.uprobes, sslProbes...)
|
|
|
- p.openSslUprobesChecked = true
|
|
|
}
|
|
|
if !p.goTlsUprobesChecked {
|
|
|
+ p.goTlsUprobesChecked = true
|
|
|
codeType := c.GetCodeTypeFromCache(pid)
|
|
|
goProbes, err := tracer.AttachGoTlsUprobes(pid, &c.AppInfo, uint16(codeType))
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
p.uprobes = append(p.uprobes, goProbes...)
|
|
|
- p.goTlsUprobesChecked = true
|
|
|
+ c.l7AttachSuccess()
|
|
|
}
|
|
|
|
|
|
return nil
|
|
|
@@ -1523,6 +1526,7 @@ func (c *Container) attachJVMUprobes(tracer *ebpftracer.Tracer, pid uint32) erro
|
|
|
major, minor, patch, err := ebpftracer.ParseVersion(v)
|
|
|
klog.Infof("[attach] version: %s (Major: %d, Minor: %d, Patch: %d)", v, major, minor, patch)
|
|
|
if major != 1 || minor != 8 {
|
|
|
+ klog.Errorf("[attach] Unsupported Java version.")
|
|
|
return fmt.Errorf("[attach] Unsupported Java version")
|
|
|
}
|
|
|
}
|
|
|
@@ -1541,8 +1545,9 @@ func (c *Container) attachJVMUprobes(tracer *ebpftracer.Tracer, pid uint32) erro
|
|
|
}
|
|
|
p.uprobes = append(p.uprobes, libNetProbes...)
|
|
|
//p.jvmUprobesChecked = true
|
|
|
+ c.l7AttachSuccess()
|
|
|
} else {
|
|
|
- klog.Infof("[attach] %s-%d already attach", codeType.String(), pid)
|
|
|
+ klog.Infof("[attach] %s-%d already attach status:%v", codeType.String(), pid, c.Isl7AttachSuccess())
|
|
|
}
|
|
|
return nil
|
|
|
}
|
|
|
@@ -1596,6 +1601,7 @@ func (c *Container) attachJavaAotUprobes(tracer *ebpftracer.Tracer, pid uint32)
|
|
|
}
|
|
|
p.uprobes = append(p.uprobes, libNetProbes...)
|
|
|
//p.jvmUprobesChecked = true
|
|
|
+ c.l7AttachSuccess()
|
|
|
} else {
|
|
|
klog.Infof("[attach] %s-%d already attach", codeType.String(), pid)
|
|
|
}
|
|
|
@@ -1635,6 +1641,7 @@ func (c *Container) attachNetCoreUprobes(tracer *ebpftracer.Tracer, pid uint32)
|
|
|
return err
|
|
|
}
|
|
|
p.uprobes = append(p.uprobes, WriteProbes...)
|
|
|
+ c.l7AttachSuccess()
|
|
|
}
|
|
|
|
|
|
return nil
|