Skip to content

Can the /proc path be made configurable for the Process source? #1629

Description

@Juandavi1

Hi, thanks for blazesym.

I'm using it to symbolize processes from a profiler that runs as a sidecar container. To see processes in sibling containers it needs the host's /proc, so we bind-mount the host /proc over the container's own /proc. That works great.

The snag is that the same container also has other code reading its own /proc/self (via gopsutil), and that code uses the container-namespace PID. Once /proc is the host's, it looks up the wrong PID (or one that isn't there) and crashes on startup.

If blazesym could read /proc from somewhere else, say /host/proc, we'd be fine: mount the host /proc there and leave the container's /proc alone. Right now it looks hardcoded:

  • src/maps.rs:389 -> format!("/proc/{pid}/maps")
  • src/maps.rs:213 -> format!("/proc/{pid}/map_files/...")

Two questions:

  1. Is there already a way to point blazesym at a different /proc root that I missed?
  2. If not, would you take a PR for it? I'm thinking an optional proc-root on the Process source, defaulting to /proc.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions