github.com/cilium/ebpf@v0.15.1-0.20240517100537-8079b37aa138/internal/tracefs/uprobe.go (about)

     1  package tracefs
     2  
     3  import "fmt"
     4  
     5  // UprobeToken creates the PATH:OFFSET(REF_CTR_OFFSET) token for the tracefs api.
     6  func UprobeToken(args ProbeArgs) string {
     7  	po := fmt.Sprintf("%s:%#x", args.Path, args.Offset)
     8  
     9  	if args.RefCtrOffset != 0 {
    10  		// This is not documented in Documentation/trace/uprobetracer.txt.
    11  		// elixir.bootlin.com/linux/v5.15-rc7/source/kernel/trace/trace.c#L5564
    12  		po += fmt.Sprintf("(%#x)", args.RefCtrOffset)
    13  	}
    14  
    15  	return po
    16  }