MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / Push

Method Push

pkg/event/stackwalk.go:87–109  ·  view source on GitHub ↗

Push pushes a new event to the queue.

(e *Event)

Source from the content-addressed store, hash-verified

85
86// Push pushes a new event to the queue.
87func (s *StackwalkDecorator) Push(e *Event) {
88 s.mux.Lock()
89 defer s.mux.Unlock()
90
91 // the process is created on behalf of brokered
92 // process and the callstack return addresses
93 // need to be obtained from the surrogate process
94 if e.IsSurrogateProcess() {
95 s.procs[e.Params.MustGetPid()] = e
96 }
97
98 // append the event to the bucket indexed by stack id
99 id := e.StackID()
100 q, ok := s.buckets[id]
101 if !ok {
102 s.buckets[id] = []*Event{e}
103 } else {
104 s.buckets[id] = append(q, e)
105 }
106
107 stackwalkBuckets.Set(int64(len(s.buckets)))
108 stackwalkEnqueued.Add(int64(len(s.buckets[id])))
109}
110
111// Pop receives the stack walk event and pops the oldest
112// originating event with the same pid,tid tuple formerly

Calls 7

LockMethod · 0.80
UnlockMethod · 0.80
IsSurrogateProcessMethod · 0.80
MustGetPidMethod · 0.80
StackIDMethod · 0.80
SetMethod · 0.65
AddMethod · 0.65

Tested by 3

TestStackwalkDecoratorFunction · 0.76