Skip to content

Commit

Permalink
Change the place where we add the RelativeOffset
Browse files Browse the repository at this point in the history
  • Loading branch information
mertyildiran committed May 25, 2022
1 parent ddbe83e commit 8a7955a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions link/uprobe.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,11 @@ func (ex *Executable) uprobe(symbol string, prog *ebpf.Program, opts *UprobeOpti

offset := opts.Offset
if offset == 0 {
offset = opts.RelativeOffset
off, err := ex.offset(symbol)
if err != nil {
return nil, err
}
offset += off
offset = off
}

pid := opts.PID
Expand All @@ -284,7 +283,7 @@ func (ex *Executable) uprobe(symbol string, prog *ebpf.Program, opts *UprobeOpti
args := probeArgs{
symbol: symbol,
path: ex.path,
offset: offset,
offset: offset + opts.RelativeOffset,
pid: pid,
refCtrOffset: opts.RefCtrOffset,
ret: ret,
Expand Down

0 comments on commit 8a7955a

Please sign in to comment.