NewEventSource creates the new ETW event source.
( psnap ps.Snapshotter, hsnap handle.Snapshotter, config *config.Config, compiler *config.RulesCompileResult, )
| 94 | |
| 95 | // NewEventSource creates the new ETW event source. |
| 96 | func NewEventSource( |
| 97 | psnap ps.Snapshotter, |
| 98 | hsnap handle.Snapshotter, |
| 99 | config *config.Config, |
| 100 | compiler *config.RulesCompileResult, |
| 101 | ) source.EventSource { |
| 102 | evs := &EventSource{ |
| 103 | r: compiler, |
| 104 | traces: make([]*Trace, 0), |
| 105 | consumers: make([]*Consumer, 0), |
| 106 | processors: processors.NewChain(psnap, hsnap, config), |
| 107 | errs: make(chan error, 1000), |
| 108 | evts: make(chan *event.Event, 500), |
| 109 | sequencer: event.NewSequencer(), |
| 110 | config: config, |
| 111 | stop: make(chan struct{}), |
| 112 | psnap: psnap, |
| 113 | hsnap: hsnap, |
| 114 | listeners: make([]event.Listener, 0), |
| 115 | } |
| 116 | return evs |
| 117 | } |
| 118 | |
| 119 | // Open configures and starts traces and event consumers. |
| 120 | func (e *EventSource) Open(config *config.Config) error { |