|
|
@@ -297,7 +297,7 @@ func (t *Tracer) AttachGoTlsUprobes(pid uint32, appInfo *AppInfo, codeType uint1
|
|
|
}
|
|
|
switch s.Name {
|
|
|
case goTlsWriteSymbol, goTlsReadSymbol:
|
|
|
- case goExecute, goNewproc1, goRunqget, goServeHTTP, goTransport, goGrpcHttp2OperateHeader,goGrpcServerHandleStream:
|
|
|
+ case goExecute, goNewproc1, goRunqget, goServeHTTP, goTransport, goGrpcHttp2OperateHeader,goGrpcServerHandleStream,goGrpcServerWritestatus:
|
|
|
default:
|
|
|
continue
|
|
|
}
|
|
|
@@ -403,26 +403,29 @@ func (t *Tracer) AttachGoTlsUprobes(pid uint32, appInfo *AppInfo, codeType uint1
|
|
|
}
|
|
|
klog.Infoln("google.golang.org/grpc.(*Server).handleStream ok")
|
|
|
links = append(links, l)
|
|
|
- sStart := s.Value - textSection.Addr
|
|
|
- sEnd := sStart + s.Size
|
|
|
- if sEnd > textSectionLen {
|
|
|
- continue
|
|
|
- }
|
|
|
- sBytes := textSectionData[sStart:sEnd]
|
|
|
- returnOffsets := getReturnOffsets(ef.Machine, sBytes)
|
|
|
- if len(returnOffsets) == 0 {
|
|
|
- err = fmt.Errorf("failed to attach uprobe_server_handleStream2 no return offsets found")
|
|
|
- klog.Errorln(err)
|
|
|
- return nil, err
|
|
|
- }
|
|
|
- for _, offset := range returnOffsets {
|
|
|
- l, err := exe.Uprobe(s.Name, t.uprobes["uprobe_server_handleStream_Returns"], &link.UprobeOptions{Address: address, Offset: uint64(offset)})
|
|
|
- if err != nil {
|
|
|
- klog.WithError(err).Errorln(fmt.Errorf("failed to attach exit_runtime_newproc1 uprobe"))
|
|
|
- return nil, err
|
|
|
- }
|
|
|
- links = append(links, l)
|
|
|
- }
|
|
|
+ // sStart := s.Value - textSection.Addr
|
|
|
+ // sEnd := sStart + s.Size
|
|
|
+ // klog.Infoln("google.golang.org/grpc.(*Server).handleStream ok----111111")
|
|
|
+ // if sEnd > textSectionLen {
|
|
|
+ // continue
|
|
|
+ // }
|
|
|
+ // klog.Infoln("google.golang.org/grpc.(*Server).handleStream ok----2222")
|
|
|
+ // sBytes := textSectionData[sStart:sEnd]
|
|
|
+ // returnOffsets := getReturnOffsets(ef.Machine, sBytes)
|
|
|
+ // if len(returnOffsets) == 0 {
|
|
|
+ // err = fmt.Errorf("failed to attach uprobe_server_handleStream2 no return offsets found")
|
|
|
+ // klog.Errorln(err)
|
|
|
+ // return nil, err
|
|
|
+ // }
|
|
|
+ // for _, offset := range returnOffsets {
|
|
|
+ // l, err := exe.Uprobe(s.Name, t.uprobes["uprobe_server_handleStream_Returns"], &link.UprobeOptions{Address: address, Offset: uint64(offset)})
|
|
|
+ // if err != nil {
|
|
|
+ // klog.WithError(err).Errorln(fmt.Errorf("failed to attach exit_runtime_newproc1 uprobe"))
|
|
|
+ // return nil, err
|
|
|
+ // }
|
|
|
+ // klog.Infoln("google.golang.org/grpc.(*Server).handleStream ok----")
|
|
|
+ // links = append(links, l)
|
|
|
+ // }
|
|
|
case goServeHTTP:
|
|
|
l, err := exe.Uprobe(s.Name, t.uprobes["uprobe_HandlerFunc_ServeHTTP"], &link.UprobeOptions{Address: address})
|
|
|
if err != nil {
|