Skip to content
Discussion options

You must be logged in to vote

You need Address, not Offset. Despite the wording on the Uprobe doc ("Setting the Offset field in the options supersedes the symbol's offset"), Offset is always relative. It gets added to either the resolved symbol address or to Address, and cannot bypass symbol lookup on its own.

The decision happens in (ex *Executable).address() in link/uprobe.go:

func (ex *Executable) address(symbol string, address, offset uint64) (uint64, error) {
    if address > 0 {
        return address + offset, nil
    }
    err := ex.lazyLoadSymbols()
    ...
    sym, ok := ex.cachedSymbols[symbol]
    if !ok {
        return 0, fmt.Errorf("symbol %s: %w", symbol, ErrNoSymbol)
    }
    ...
}

With Address > 0 t…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by dtc02040
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants