This repository has been archived by the owner on Nov 9, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf_event_open is occaisionally returning EBUSY, which according to the manual means: ``` EBUSY (since Linux 4.1) Returned if another event already has exclusive access to the PMU. ``` This raises the question of whether we can (as we assume) trace different threads concurrently. Digging in the `perf-intel-pt(1)` Linux manual page, we find: ``` In per-thread mode an exact list of threads is traced. There is no inheritance. Each thread has its own event buffer. ``` This leads me to believe that we can indeed collect traces concurrently, and the EBUSY error arises only when two threads try to concurrently *acquire* a perf file descriptor. (https://man7.org/linux/man-pages/man1/perf-intel-pt.1.html) This change therefore just ups the number of attempts to get a perf file descriptor before giving up. Also added a test to check that having two threads trace at the same time is OK. Presumably we already implicitely test this with Rust's test harness, but it doesn't hurt to make an explicit test.
- Loading branch information