GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ebpfmanager/manager_ringbuffer.go at master · gojue/ebpfmanager

Expand file tree

/

manager_ringbuffer.go

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
43 lines (36 loc) · 1.16 KB
/

manager_ringbuffer.go

Copy path

File metadata and controls

43 lines (36 loc) · 1.16 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package manager
import "github.com/cilium/ebpf"
// NewRingBuffer - Creates a new ring buffer and start listening for events.
// Use a MapRoute to make this map available to the programs of the manager.
func (m *Manager) NewRingBuffer(spec *ebpf.MapSpec, options MapOptions, ringBufferOptions RingbufMapOptions) (*ebpf.Map, error) {
m.stateLock.Lock()
defer m.stateLock.Unlock()
switch m.state {
case reset, elfLoaded, stopping:
return nil, ErrManagerNotInitialized
case initialized, paused, running:
}
// check if the name of the new map is available
_, exists, _ := m.getMap(spec.Name)
if exists {
return nil, ErrMapNameInUse
}
// Create new map and ring buffer reader
ringBuffer, err := loadNewRingBuffer(spec, options, ringBufferOptions)
if err != nil {
return nil, err
}
// Setup ring buffer reader
if err := ringBuffer.init(m); err != nil {
return nil, err
}
// Start perf buffer reader
if err := ringBuffer.Start(); err != nil {
// clean up
_ = ringBuffer.Stop(CleanInternal)
return nil, err
}
// Add map to the list of perf ring managed by the manager
m.RingBuffers = append(m.RingBuffers, ringBuffer)
return ringBuffer.array, nil
}
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.