MCPcopy
hub / github.com/cilium/ebpf / OpenExecutable

Function OpenExecutable

link/uprobe.go:108–121  ·  view source on GitHub ↗

To open a new Executable, use: OpenExecutable("/bin/bash") The returned value can then be used to open Uprobe(s).

(path string)

Source from the content-addressed store, hash-verified

106//
107// The returned value can then be used to open Uprobe(s).
108func OpenExecutable(path string) (*Executable, error) {
109 if path == "" {
110 return nil, fmt.Errorf("path cannot be empty")
111 }
112
113 if _, err := os.Stat(path); err != nil {
114 return nil, fmt.Errorf("stat executable: %w", err)
115 }
116
117 return &Executable{
118 path: path,
119 cachedSymbols: make(map[string]symbol),
120 }, nil
121}
122
123func (ex *Executable) load(f *internal.SafeELFFile) error {
124 syms, err := f.Symbols()

Callers 9

mainFunction · 0.92
uprobe_test.goFile · 0.85
TestExecutableFunction · 0.85
TestUprobeInfoFunction · 0.85
TestUprobeProgramCallFunction · 0.85
TestUprobeMultiInfoFunction · 0.85

Calls

no outgoing calls

Tested by 7

TestExecutableFunction · 0.68
TestUprobeInfoFunction · 0.68
TestUprobeProgramCallFunction · 0.68
TestUprobeMultiInfoFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…