ONE - On-device Neural Engine
Loading...
Searching...
No Matches
EventCollector Class Reference

#include <EventCollector.h>

Collaboration diagram for EventCollector:

Data Structures

struct  Event
 
class  EventVisitor
 
struct  OpSeqEvent
 
struct  SubgEvent
 

Public Types

enum class  Edge { BEGIN , END }
 

Public Member Functions

 EventCollector (EventRecorder *rec)
 
template<typename EventT >
void onEvent (const EventT &event)
 

Protected Attributes

EventRecorder_rec
 

Detailed Description

Definition at line 28 of file EventCollector.h.

Member Enumeration Documentation

◆ Edge

enum class EventCollector::Edge
strong
Enumerator
BEGIN 
END 

Definition at line 31 of file EventCollector.h.

Constructor & Destructor Documentation

◆ EventCollector()

EventCollector::EventCollector ( EventRecorder rec)
inline

Definition at line 103 of file EventCollector.h.

103 : _rec{rec}
104 {
105 // DO NOTHING
106 }
EventRecorder * _rec

Member Function Documentation

◆ onEvent()

template<typename EventT >
void EventCollector::onEvent ( const EventT &  event)

Definition at line 127 of file EventCollector.cc.

128{
129 auto ts = timestamp();
130
131 DurationEventBuilder builder(ts);
132
133 switch (event.edge)
134 {
135 case Edge::BEGIN:
136 {
137 auto duration_evt = builder.build(event, "B");
138 _rec->emit(std::move(duration_evt));
139 break;
140 }
141 case Edge::END:
142 {
143 auto duration_evt = builder.build(event, "E");
144 _rec->emit(std::move(duration_evt));
145 break;
146 }
147 }
148
149// TODO: Add resurece measurement(e.g. RSS)
150// when ready with low overhead in release build
151#ifdef DEBUG
152 emit_rusage(_rec, ts);
153#endif
154}
void emit(std::unique_ptr< DurationEvent > &&evt)

References _rec, BEGIN, EventRecorder::emit(), and END.

Referenced by onert::exec::TracingObserver::handleJobBegin(), onert::exec::TracingObserver::handleJobEnd(), onert::exec::TracingObserver::handleSubgraphBegin(), and onert::exec::TracingObserver::handleSubgraphEnd().

Field Documentation

◆ _rec

EventRecorder* EventCollector::_rec
protected

Definition at line 112 of file EventCollector.h.

Referenced by onEvent().


The documentation for this class was generated from the following files: