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

Method update_stack_config

user/module/stack.go:359–379  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

357}
358
359func (this *MStack) update_stack_config() {
360 if !this.mconf.StackUprobeConf.IsEnable() {
361 return
362 }
363 map_name := "uprobe_point_args"
364 bpf_map, err := this.FindMap(map_name)
365 if err != nil {
366 panic(fmt.Sprintf("find [%s] failed, err:%v", map_name, err))
367 }
368 for _, uprobe_point := range this.mconf.StackUprobeConf.Points {
369 var filter_key uint32 = uprobe_point.Index
370 filter_value := uprobe_point.GetConfig()
371 err := bpf_map.Update(unsafe.Pointer(&filter_key), unsafe.Pointer(&filter_value), ebpf.UpdateAny)
372 if err != nil {
373 panic(fmt.Sprintf("update [%s] failed, filter_key:%d, err:%v", map_name, filter_key, err))
374 }
375 }
376 if this.mconf.Debug {
377 this.logger.Printf("update %s success", map_name)
378 }
379}
380
381func (this *MStack) updateFilter() (err error) {
382 this.update_base_config()

Callers 1

updateFilterMethod · 0.95

Calls 3

FindMapMethod · 0.95
GetConfigMethod · 0.80
IsEnableMethod · 0.45

Tested by

no test coverage detected