Browse Source

Fixed #TSB-1234 test

ilucky.si 2 years ago
parent
commit
d0a8d29b2f
2 changed files with 4 additions and 3 deletions
  1. 2 2
      ebpftracer/ebpf/java/httpurlconnection.bpf.c
  2. 2 1
      ebpftracer/tls.go

+ 2 - 2
ebpftracer/ebpf/java/httpurlconnection.bpf.c

@@ -1,5 +1,5 @@
 SEC("uprobe/HandlerFunc_HttpURLConnection_setRequestProperty")
 int uprobe_HttpURLConnection_setRequestProperty(struct pt_regs *ctx) {
-	bpf_printk("[uprobe_HttpURLConnection_setRequestProperty]");
-	return NULL;
+	bpf_printk("[==============================uprobe_HttpURLConnection_setRequestProperty===========================]");
+	return 0;
 }

+ 2 - 1
ebpftracer/tls.go

@@ -156,8 +156,9 @@ func (t *Tracer) AttachTlsUprobes4Java(pid uint32) []link.Link {
 	//}
 
 	prog := t.uprobes["uprobe_HttpURLConnection_setRequestProperty"]
-	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
+	// 报错: 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})
 	if err != nil {
 		fmt.Println("exe.Uprobe error: ", err) // 报错: TODO: exe.Uprobe error:  prog cannot be nil: invalid input