diff options
| author | Joey Jiao <quic_jiangenj@quicinc.com> | 2024-06-11 10:53:25 +0800 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2024-06-17 08:56:33 +0000 |
| commit | 1f11cfd7279ff3046e6e7f871eeb195c48ccbfa9 (patch) | |
| tree | 55aa542603741d637db9be636fa48210f6383c59 /pkg/vminfo/linux.go | |
| parent | c1349e08b8ce2abf7e86375364268d8f696d077c (diff) | |
all: always use KernelModule ptr to unify usage
Diffstat (limited to 'pkg/vminfo/linux.go')
| -rw-r--r-- | pkg/vminfo/linux.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/vminfo/linux.go b/pkg/vminfo/linux.go index 2735ad0ef..b038778a1 100644 --- a/pkg/vminfo/linux.go +++ b/pkg/vminfo/linux.go @@ -43,8 +43,8 @@ func (linux) machineInfos() []machineInfoFunc { } } -func (linux) parseModules(files filesystem) ([]cover.KernelModule, error) { - var modules []cover.KernelModule +func (linux) parseModules(files filesystem) ([]*cover.KernelModule, error) { + var modules []*cover.KernelModule re := regexp.MustCompile(`(\w+) ([0-9]+) .*(0[x|X][a-fA-F0-9]+)[^\n]*`) modulesText, _ := files.ReadFile("/proc/modules") for _, match := range re.FindAllSubmatch(modulesText, -1) { @@ -65,7 +65,7 @@ func (linux) parseModules(files filesystem) ([]cover.KernelModule, error) { return nil, fmt.Errorf("module %v size parsing error: %w", name, err) } offset := modAddr - textAddr - modules = append(modules, cover.KernelModule{ + modules = append(modules, &cover.KernelModule{ Name: name, Addr: textAddr, Size: modSize - offset, |
