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

Method Parse_FileConfig

user/config/config_module.go:510–552  ·  view source on GitHub ↗
(config *SyscallFileConfig)

Source from the content-addressed store, hash-verified

508}
509
510func (this *SyscallConfig) Parse_FileConfig(config *SyscallFileConfig) (err error) {
511 for _, point_config := range config.Points {
512 var a_point_args []*PointArg
513 var b_point_args []*PointArg
514 for arg_index, param := range point_config.Params {
515 if param.Name == "ret" {
516 // 需要告知用户 syscall 中参数名 ret 仅用于返回值
517 point_arg := param.GetPointArg(REG_ARM64_MAX, EBPF_SYS_EXIT)
518 b_point_args = append(b_point_args, point_arg)
519 break
520 }
521
522 var point_type uint32
523 switch param.More {
524 case "", "enter":
525 point_type = EBPF_SYS_ENTER
526 case "exit":
527 point_type = EBPF_SYS_EXIT
528 case "all":
529 point_type = EBPF_SYS_ALL
530 default:
531 panic(fmt.Sprintf("unknown point_type:%s", param.More))
532 }
533 point_arg := param.GetPointArg(uint32(arg_index), point_type)
534
535 point_arg.SetDumpHex(this.DumpHex)
536 point_arg.SetColor(this.Color)
537
538 a_p := point_arg.Clone()
539 a_p.SetGroupType(EBPF_SYS_ENTER)
540 a_point_args = append(a_point_args, a_p)
541
542 b_p := point_arg.Clone()
543 b_p.SetGroupType(EBPF_SYS_EXIT)
544 b_point_args = append(b_point_args, b_p)
545
546 }
547 point := &SyscallPoint{point_config.Nr, point_config.Name, a_point_args, b_point_args}
548 this.PointArgs = append(this.PointArgs, point)
549 }
550
551 return nil
552}
553
554func (this *SyscallConfig) Parse_SyscallNames(text string) []string {
555 var syscall_items []string

Callers 1

LoadConfigMethod · 0.45

Calls 5

GetPointArgMethod · 0.80
SetGroupTypeMethod · 0.80
SetDumpHexMethod · 0.65
SetColorMethod · 0.65
CloneMethod · 0.65

Tested by

no test coverage detected