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

Method PrePare

user/module/imodule.go:280–292  ·  view source on GitHub ↗
(em *ebpf.Map, rec perf.Record)

Source from the content-addressed store, hash-verified

278}
279
280func (this *Module) PrePare(em *ebpf.Map, rec perf.Record) (event event.IEventStruct, err error) {
281 // 首先根据map得到最开始设置好的用于解析的结构体引用(这样描述可能不对)
282 es, found := this.child.DecodeFun(em)
283 if !found {
284 err = fmt.Errorf("%s\tcan't found decode function :%s, address:%p", this.child.Name(), em.String(), em)
285 return nil, err
286 }
287 te := es.Clone()
288 te.SetLogger(this.logger)
289 te.SetConf(this.child.GetConf())
290 te.SetRecord(rec)
291 return te, nil
292}
293
294func (this *Module) Close() error {
295 this.logger.Printf("TotalLost => %d\n", this.TotalLost)

Callers

nothing calls this directly

Calls 8

DecodeFunMethod · 0.65
NameMethod · 0.65
StringMethod · 0.65
CloneMethod · 0.65
SetLoggerMethod · 0.65
SetConfMethod · 0.65
GetConfMethod · 0.65
SetRecordMethod · 0.65

Tested by

no test coverage detected