javierhonduco / lightswitch

CPU profiler for Linux written in Rust
MIT License
7 stars 3 forks source link

Fix object path absolute paths #75

Closed javierhonduco closed 2 months ago

javierhonduco commented 2 months ago

To support processes running in mount namespaces that aren't the root one we can access the files in their mount via procfs's root directory.

Not only this was broken in terms of the paths being joined, but also the way Path::join works is that the joined path starts with a slash (so it's recognised as absolute) it will replace the whole path (!).

This was reported upstream in https://github.com/rust-lang/rust/issues/16507.

Test Plan

Ran lightswitch for a little bit, and containerised workloads worked fine.