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

Method GetPath

pkg/fs/driver.go:58–70  ·  view source on GitHub ↗

GetPath returns the full path to the driver module file. This method first perform a lookup in the opened/created driver modules. If the module is not found, then we enumerate all drivers and try to find the matching driver module path.

(driver string)

Source from the content-addressed store, hash-verified

56// is not found, then we enumerate all drivers and try to find the matching
57// driver module path.
58func (d *DevPathResolver) GetPath(driver string) string {
59 path, ok := d.paths[strings.ToLower(driver)]
60 if ok {
61 return path
62 }
63 drivers := sys.EnumDevices()
64 for _, drv := range drivers {
65 if strings.EqualFold(strings.ToLower(filepath.Base(drv.Filename)), driver) {
66 return drv.Filename
67 }
68 }
69 return ""
70}

Callers 1

processEventMethod · 0.80

Calls 1

EnumDevicesFunction · 0.92

Tested by

no test coverage detected