Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf_event_open01: Handle EOPNOTSUPP correctly
In case that particular event type is not supported by hardware the perf_event_open() fails with EOPNOTSUPP which should be translated to TCONF. Also this adds the event name to the tst_brkm(TFAIL, ...) branch so that we can actually see which event has failed. Fixes #81 Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
- Loading branch information
5615241
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The returned errno depends on you kernel version, hardware and requested event type. The perf_event_open01 tries various event types and hence is much more likely that your system is missing support for some. The perf_event_open02 tries only three most common event types and because of that it's less likely to hit the EOPNOTSUPP.
In short, the perf_event_open02 should break the test with TCONF as well for both ENOENT and EOPNOTSUPP. Feel free to send a patch.