|
|
@@ -287,6 +287,26 @@ func (t *Tracer) AttachGoTlsUprobes(pid uint32, appInfo *AppInfo, codeType uint1
|
|
|
klog.Errorf("[AttachGoTlsUprobes] STEP 11.2: Failed to get goid offset, pid=%d, version=%s", pid, bi.GoVersion)
|
|
|
}
|
|
|
|
|
|
+ // 获取 runtime.p.goidcache 偏移量
|
|
|
+ klog.Infof("[AttachGoTlsUprobes] STEP 11.3: Getting offset for runtime.p.goidcache")
|
|
|
+ goidcacheOffset, okGoidcache := tracer.GetOffset(tracer.NewID("std", "runtime", "p", "goidcache"), path)
|
|
|
+ if okGoidcache {
|
|
|
+ klog.Infof("[AttachGoTlsUprobes] STEP 11.4: Successfully got goidcache offset=%d", goidcacheOffset)
|
|
|
+ } else {
|
|
|
+ klog.Warnf("[AttachGoTlsUprobes] STEP 11.5: Failed to get goidcache offset, pid=%d, version=%s, using fallback", pid, bi.GoVersion)
|
|
|
+ goidcacheOffset = 384 // fallback value
|
|
|
+ }
|
|
|
+
|
|
|
+ // 获取 runtime.p.runnext 偏移量
|
|
|
+ klog.Infof("[AttachGoTlsUprobes] STEP 11.6: Getting offset for runtime.p.runnext")
|
|
|
+ runnextOffset, okRunnext := tracer.GetOffset(tracer.NewID("std", "runtime", "p", "runnext"), path)
|
|
|
+ if okRunnext {
|
|
|
+ klog.Infof("[AttachGoTlsUprobes] STEP 11.7: Successfully got runnext offset=%d", runnextOffset)
|
|
|
+ } else {
|
|
|
+ klog.Warnf("[AttachGoTlsUprobes] STEP 11.8: Failed to get runnext offset, pid=%d, version=%s, using fallback", pid, bi.GoVersion)
|
|
|
+ runnextOffset = 2456 // fallback value
|
|
|
+ }
|
|
|
+
|
|
|
klog.Infof("[AttachGoTlsUprobes] STEP 12: Getting offset for runtime.hmap.buckets")
|
|
|
bucketsOff, ok2 := tracer.GetOffset(tracer.NewID("std", "runtime", "hmap", "buckets"), path)
|
|
|
|
|
|
@@ -414,6 +434,8 @@ func (t *Tracer) AttachGoTlsUprobes(pid uint32, appInfo *AppInfo, codeType uint1
|
|
|
info := EbpfProcInfo{}
|
|
|
info.Version = uint32(goVersion)
|
|
|
info.Offsets[OFFSET_IDX_GOID_RUNTIME_G] = uint16(offset)
|
|
|
+ info.Offsets[OFFSET_IDX_P_GOIDCACHE] = uint16(goidcacheOffset)
|
|
|
+ info.Offsets[OFFSET_IDX_P_RUNNEXT] = uint16(runnextOffset)
|
|
|
info.NetTCPConnItab = uint64(0)
|
|
|
info.CryptoTLSConnItab = uint64(0)
|
|
|
info.CredentialsSyscallConnItab = uint64(0)
|