|
@@ -119,8 +119,8 @@ func (t *Tracer) AttachGoTlsUprobes(pid uint32) []link.Link { // TODO: 核心方
|
|
|
|
|
|
|
|
fmt.Println("AttachGoTlsUprobes------------pid: ", pid)
|
|
fmt.Println("AttachGoTlsUprobes------------pid: ", pid)
|
|
|
// TODO: 区分语言
|
|
// TODO: 区分语言
|
|
|
- // return t.AttachTlsUprobes4GO(pid)
|
|
|
|
|
- return t.AttachTlsUprobes4Java(pid)
|
|
|
|
|
|
|
+ return t.AttachTlsUprobes4GO(pid)
|
|
|
|
|
+ // return t.AttachTlsUprobes4Java(pid)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func (t *Tracer) AttachTlsUprobes4Java(pid uint32) []link.Link {
|
|
func (t *Tracer) AttachTlsUprobes4Java(pid uint32) []link.Link {
|
|
@@ -159,7 +159,8 @@ func (t *Tracer) AttachTlsUprobes4Java(pid uint32) []link.Link {
|
|
|
fmt.Println("t.uprobes[\"uprobe_HttpURLConnection_setRequestProperty\"]=", prog)
|
|
fmt.Println("t.uprobes[\"uprobe_HttpURLConnection_setRequestProperty\"]=", prog)
|
|
|
// 733f8cc7aaa0 fd0 Lsun/net/www/protocol/http/HttpURLConnection;::setRequestProperty
|
|
// 733f8cc7aaa0 fd0 Lsun/net/www/protocol/http/HttpURLConnection;::setRequestProperty
|
|
|
// 报错: creating perf_uprobe PMU: token /proc/13096/exe:0x733f8cc7aaa0: opening perf event: invalid argument
|
|
// 报错: creating perf_uprobe PMU: token /proc/13096/exe:0x733f8cc7aaa0: opening perf event: invalid argument
|
|
|
- link, err := exe.Uprobe("Lsun/net/www/protocol/http/HttpURLConnection;::setRequestProperty", prog, &link.UprobeOptions{Address: 0x733f8cc7aaa0, Offset: 0xfd0, PID: 13096})
|
|
|
|
|
|
|
+ // &link.UprobeOptions{Address: 0x733f8cc7aaa0, Offset: 0xfd0, PID: 13096}
|
|
|
|
|
+ link, err := exe.Uprobe("Lsun/net/www/protocol/http/HttpURLConnection;::setRequestProperty", prog, &link.UprobeOptions{Address: 0x733f8cc7aaa0})
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
fmt.Println("exe.Uprobe error: ", err) // 报错: TODO: exe.Uprobe error: prog cannot be nil: invalid input
|
|
fmt.Println("exe.Uprobe error: ", err) // 报错: TODO: exe.Uprobe error: prog cannot be nil: invalid input
|
|
|
return nil
|
|
return nil
|
|
@@ -308,7 +309,7 @@ func (t *Tracer) AttachTlsUprobes4GO(pid uint32) []link.Link {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
fmt.Println("s.Name-----:", s.Name) // TODO: s.Name-----: runtime.execute | net/http.serverHandler.ServeHTTP
|
|
fmt.Println("s.Name-----:", s.Name) // TODO: s.Name-----: runtime.execute | net/http.serverHandler.ServeHTTP
|
|
|
-
|
|
|
|
|
|
|
+ fmt.Println("s.Value-----:", s.Value)
|
|
|
switch s.Name {
|
|
switch s.Name {
|
|
|
case goExecute:
|
|
case goExecute:
|
|
|
l, err := exe.Uprobe(s.Name, t.uprobes["runtime_execute"], &link.UprobeOptions{Address: address})
|
|
l, err := exe.Uprobe(s.Name, t.uprobes["runtime_execute"], &link.UprobeOptions{Address: address})
|