Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions nativeunwind/elfunwindinfo/stackdeltaprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"os"
"sync/atomic"

"go.opentelemetry.io/ebpf-profiler/host"
"go.opentelemetry.io/ebpf-profiler/libpf/pfelf"
"go.opentelemetry.io/ebpf-profiler/nativeunwind"
sdtypes "go.opentelemetry.io/ebpf-profiler/nativeunwind/stackdeltatypes"
Expand All @@ -32,8 +31,8 @@ func NewStackDeltaProvider() nativeunwind.StackDeltaProvider {
}

// GetIntervalStructuresForFile builds the stack delta information for a single executable.
func (provider *ELFStackDeltaProvider) GetIntervalStructuresForFile(_ host.FileID,
elfRef *pfelf.Reference, interval *sdtypes.IntervalData) error {
func (provider *ELFStackDeltaProvider) GetIntervalStructuresForFile(elfRef *pfelf.Reference,
interval *sdtypes.IntervalData) error {
err := ExtractELF(elfRef, interval)
if err != nil {
if !errors.Is(err, os.ErrNotExist) {
Expand Down
4 changes: 1 addition & 3 deletions nativeunwind/stackdeltaprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package nativeunwind // import "go.opentelemetry.io/ebpf-profiler/nativeunwind"

import (
"go.opentelemetry.io/ebpf-profiler/host"
"go.opentelemetry.io/ebpf-profiler/libpf/pfelf"
sdtypes "go.opentelemetry.io/ebpf-profiler/nativeunwind/stackdeltatypes"
)
Expand All @@ -22,8 +21,7 @@ type Statistics struct {
type StackDeltaProvider interface {
// GetIntervalStructuresForFile inspects a single executable and extracts data that is needed
// to rebuild the stack for traces of this executable.
GetIntervalStructuresForFile(fileID host.FileID, elfRef *pfelf.Reference,
interval *sdtypes.IntervalData) error
GetIntervalStructuresForFile(elfRef *pfelf.Reference, interval *sdtypes.IntervalData) error

// GetAndResetStatistics returns the internal statistics for this provider and resets all
// values to 0.
Expand Down
2 changes: 1 addition & 1 deletion processmanager/execinfomanager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (mgr *ExecutableInfoManager) AddOrIncRef(fileID host.FileID,
// so we release the lock before doing this.
mgr.state.WUnlock(&state)

if err = mgr.sdp.GetIntervalStructuresForFile(fileID, elfRef, &intervalData); err != nil {
if err = mgr.sdp.GetIntervalStructuresForFile(elfRef, &intervalData); err != nil {
if !errors.Is(err, os.ErrNotExist) {
mgr.deferredFileIDs.Add(fileID, libpf.Void{})
}
Expand Down
4 changes: 2 additions & 2 deletions processmanager/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ func newTestProcess(pid libpf.PID) process.Process {
type dummyStackDeltaProvider struct{}

// GetIntervalStructuresForFile fills in the expected data structure with semi random data.
func (d *dummyStackDeltaProvider) GetIntervalStructuresForFile(_ host.FileID,
_ *pfelf.Reference, result *sdtypes.IntervalData) error {
func (d *dummyStackDeltaProvider) GetIntervalStructuresForFile(_ *pfelf.Reference,
result *sdtypes.IntervalData) error {
r := rand.New(rand.NewPCG(42, 42)) //nolint:gosec
addr := 0x10
for i := 0; i < r.IntN(42); i++ {
Expand Down