|
|
@@ -7,6 +7,11 @@ import (
|
|
|
"debug/elf"
|
|
|
"errors"
|
|
|
"fmt"
|
|
|
+ "os"
|
|
|
+ "regexp"
|
|
|
+ "strconv"
|
|
|
+ "strings"
|
|
|
+
|
|
|
"github.com/cilium/ebpf/link"
|
|
|
"github.com/coroot/coroot-node-agent/ebpftracer/tracer"
|
|
|
"github.com/coroot/coroot-node-agent/proc"
|
|
|
@@ -15,10 +20,6 @@ import (
|
|
|
"golang.org/x/arch/arm64/arm64asm"
|
|
|
"golang.org/x/arch/x86/x86asm"
|
|
|
"golang.org/x/mod/semver"
|
|
|
- "os"
|
|
|
- "regexp"
|
|
|
- "strconv"
|
|
|
- "strings"
|
|
|
)
|
|
|
|
|
|
const (
|
|
|
@@ -99,15 +100,19 @@ func (t *Tracer) AttachOpenSslUprobes(pid uint32) ([]link.Link, error) {
|
|
|
for _, p := range progs {
|
|
|
if p.uprobe != "" {
|
|
|
l, err := exe.Uprobe(p.symbol, t.uprobes[p.uprobe], nil)
|
|
|
+ klog.Infoln("fucktls crypto/tls uprobes attached", p.symbol)
|
|
|
if err != nil {
|
|
|
//log("failed to attach uprobe", err)
|
|
|
+ klog.Infoln("fucktls crypto/tls uprobes attached error", p.symbol)
|
|
|
return nil, err
|
|
|
}
|
|
|
links = append(links, l)
|
|
|
}
|
|
|
if p.uretprobe != "" {
|
|
|
+ klog.Infoln("fucktls crypto/tls uprobes attached ret", p.symbol)
|
|
|
l, err := exe.Uretprobe(p.symbol, t.uprobes[p.uretprobe], nil)
|
|
|
if err != nil {
|
|
|
+ klog.Infoln("fucktls crypto/tls uprobes attached ret error", p.symbol)
|
|
|
//log("failed to attach uretprobe", err)
|
|
|
return nil, err
|
|
|
}
|
|
|
@@ -266,7 +271,7 @@ func (t *Tracer) AttachGoTlsUprobes(pid uint32, appInfo *AppInfo, codeType uint1
|
|
|
continue
|
|
|
}
|
|
|
switch s.Name {
|
|
|
- //case goTlsWriteSymbol, goTlsReadSymbol:
|
|
|
+ case goTlsWriteSymbol, goTlsReadSymbol:
|
|
|
case goExecute, goNewproc1, goRunqget, goServeHTTP, goTransport:
|
|
|
default:
|
|
|
continue
|
|
|
@@ -413,6 +418,7 @@ func (t *Tracer) AttachGoTlsUprobes(pid uint32, appInfo *AppInfo, codeType uint1
|
|
|
}
|
|
|
|
|
|
case goTlsWriteSymbol:
|
|
|
+ klog.Infoln("fucktls goTlsWriteSymbol crypto/tls uprobes attached")
|
|
|
l, err := exe.Uprobe(s.Name, t.uprobes["go_crypto_tls_write_enter"], &link.UprobeOptions{Address: address})
|
|
|
if err != nil {
|
|
|
klog.WithError(err).Errorln("failed to attach write_enter uprobe")
|
|
|
@@ -420,6 +426,7 @@ func (t *Tracer) AttachGoTlsUprobes(pid uint32, appInfo *AppInfo, codeType uint1
|
|
|
}
|
|
|
links = append(links, l)
|
|
|
case goTlsReadSymbol:
|
|
|
+ klog.Infoln("fucktls goTlsReadSymbol crypto/tls uprobes attached")
|
|
|
l, err := exe.Uprobe(s.Name, t.uprobes["go_crypto_tls_read_enter"], &link.UprobeOptions{Address: address})
|
|
|
if err != nil {
|
|
|
klog.WithError(err).Errorln("failed to attach read_enter uprobe")
|