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

Method update_common_list

user/module/stack.go:215–235  ·  view source on GitHub ↗
(items []uint32, offset uint32)

Source from the content-addressed store, hash-verified

213}
214
215func (this *MStack) update_common_list(items []uint32, offset uint32) {
216 map_name := "common_list"
217 bpf_map, err := this.FindMap(map_name)
218 if err != nil {
219 panic(fmt.Sprintf("find [%s] failed, err:%v", map_name, err))
220 }
221 for _, v := range items {
222 v += offset
223 err := bpf_map.Update(unsafe.Pointer(&v), unsafe.Pointer(&v), ebpf.UpdateAny)
224 if err != nil {
225 panic(fmt.Sprintf("update [%s] failed, err:%v", map_name, err))
226 }
227 }
228 if this.mconf.Debug {
229 p, ok := util.START_OFFSETS[offset]
230 if !ok {
231 panic(fmt.Sprintf("offset%d invalid", offset))
232 }
233 this.logger.Printf("update %s success, count:%d offset:%s", map_name, len(items), p)
234 }
235}
236
237func (this *MStack) list2string(items []uint32) string {
238 var results []string

Callers 1

update_common_filterMethod · 0.95

Calls 1

FindMapMethod · 0.95

Tested by

no test coverage detected