Skip to content
Open
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
9 changes: 8 additions & 1 deletion src/elf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,14 @@ let all_file_selections t symbol =
;;

let selection_stop_info t pid selection =
let filename = Filename_unix.realpath t.filename in
(* Keep procfs executable symlinks openable across mount namespaces, but compare
against the target path exposed in [/proc/$pid/maps]. *)
let filename =
if String.is_prefix t.filename ~prefix:"/proc/"
&& String.is_suffix t.filename ~suffix:"/exe"
then Core_unix.readlink t.filename
else Filename_unix.realpath t.filename
in
let compute_addr addr =
if t.statically_mappable
then addr
Expand Down
2 changes: 1 addition & 1 deletion src/trace.ml
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ module Make_commands (Backend : Backend_intf.S) = struct
trigger can be passed currently. *)
let executable =
List.hd_exn pids
|> fun pid -> Core_unix.readlink [%string "/proc/%{pid#Pid}/exe"]
|> fun pid -> [%string "/proc/%{pid#Pid}/exe"]
in
record_opt_fn ~executable ~f:(fun opts ->
let { Record_opts.executable; when_to_snapshot; collection_mode; _ } =
Expand Down