-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
examples/rust: Fix improper error handling
The error handling in the profile example is insufficient. Specifically, we never check for the success of perf_event_open. If it fails, we end up passing an FD of -1 to libbpf's bpf_program__attach_perf_event_opts, which in turns barks at us. Make sure to properly check for errors. Also address clippy issues and improper formatting along the way. Signed-off-by: Daniel Müller <[email protected]>
- Loading branch information
Showing
1 changed file
with
23 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters