File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ func validateProbeArguments(probes []pfelf.USDTProbe, path string) error {
101101}
102102
103103func (d * data ) Attach (ebpf interpreter.EbpfHandler , pid libpf.PID , _ libpf.Address ,
104- _ remotememory.RemoteMemory ) (ii interpreter.Instance , err error ) {
104+ _ remotememory.RemoteMemory ) (interpreter.Instance , error ) {
105105 // Maps usdt probe name to ebpf program name.
106106 // Use the first character of the probe name as a cookie.
107107 // 'c' -> cuda_correlation
Original file line number Diff line number Diff line change @@ -166,8 +166,15 @@ func (lc *linkCloser) Unload() error {
166166func (impl * ebpfMapsImpl ) AttachUSDTProbes (pid libpf.PID , path , multiProgName string ,
167167 probes []pfelf.USDTProbe , cookies []uint64 , singleProgNames []string ,
168168 probeAll bool ) (interpreter.LinkCloser , error ) {
169- exe , err := link .OpenExecutable (path )
169+ containerPath := fmt .Sprintf ("/proc/%d/root/%s" , pid , path )
170+
171+ // TODO: This will crack open the exe with debug.elf and read symbols, we should
172+ // contribute a PR to cilium to allow it to delegate to pfelf instead. This will
173+ // also allow us to avoid the proc/pid/root stuff.
174+ exe , err := link .OpenExecutable (containerPath )
170175 if err != nil {
176+ // The upstack code will swallow file not found errors so drop a crumb.
177+ log .Warnf ("failed to open executable in AttachUSDTProbes %v" , err )
171178 return nil , err
172179 }
173180
You can’t perform that action at this time.
0 commit comments