Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
discovery: Support systems without systemd
Before this commit, we only supported discovering cgroups via systemd by reading /proc/$PID/cgroup: ``` [...] 1:name=systemd:/kubepods/burstable/pod1fa4240d-10d4-494f-88d2-80a639e26ac5/de86e0bfc1f648084db99ead71c756df43ec7e936342144c61d58961859a564b [...] ``` On systems running openrc for instance, that line doesn't exist. Instead we have: ``` 1:name=openrc:/docker ``` With this, parca-agent would discover the __cgroup_path__ for the job to be `/sys/fs/cgroup/perf_event`, leading to parca-agent profiling everything for every pod. This commit adds logic to support discovering the cgroup via perf_event. If the system is running systemd, it'll always fall back to using that line as it is the second from the last. Fixes #268
- Loading branch information