MCPcopy Create free account
hub / github.com/SeeFlowerX/stackplz / UpdateSyscallPoint

Method UpdateSyscallPoint

user/config/config_module.go:477–508  ·  view source on GitHub ↗
(uprobe_point *UprobeArgs)

Source from the content-addressed store, hash-verified

475}
476
477func (this *SyscallConfig) UpdateSyscallPoint(uprobe_point *UprobeArgs) bool {
478 if !uprobe_point.BindSyscall {
479 return false
480 }
481 point := this.GetSyscallPointByName(uprobe_point.Name)
482 var a_point_args []*PointArg
483 var b_point_args []*PointArg
484 for _, point_arg := range uprobe_point.PointArgs {
485 // 相比内置的定义 这里不需要指定寄存器索引
486 a_p := point_arg.Clone()
487 a_p.SetGroupType(EBPF_SYS_ENTER)
488 if uprobe_point.ExitRead {
489 a_p.SetPointType(EBPF_SYS_ALL)
490 } else {
491 a_p.SetPointType(EBPF_SYS_ENTER)
492 }
493 a_point_args = append(a_point_args, a_p)
494 b_p := point_arg.Clone()
495 b_p.SetGroupType(EBPF_SYS_EXIT)
496 if uprobe_point.ExitRead {
497 b_p.SetPointType(EBPF_SYS_ALL)
498 } else {
499 b_p.SetPointType(EBPF_SYS_ENTER)
500 }
501 b_point_args = append(b_point_args, b_p)
502 }
503 // 后面取出 op list 的时候需要特殊处理
504 b_point_args = append(b_point_args, B("ret", INT))
505 point.EnterPointArgs = a_point_args
506 point.ExitPointArgs = b_point_args
507 return true
508}
509
510func (this *SyscallConfig) Parse_FileConfig(config *SyscallFileConfig) (err error) {
511 for _, point_config := range config.Points {

Callers 1

GetSyscallMethod · 0.80

Calls 5

GetSyscallPointByNameMethod · 0.95
BFunction · 0.85
SetGroupTypeMethod · 0.80
SetPointTypeMethod · 0.80
CloneMethod · 0.65

Tested by

no test coverage detected