Skip to content

Commit

Permalink
Handle missing frames when reading BPF maps
Browse files Browse the repository at this point in the history
Signed-off-by: Francisco Javier Honduvilla Coto <javierhonduco@gmail.com>
  • Loading branch information
javierhonduco committed Feb 22, 2023
1 parent 019fb4b commit 0096cf8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/rbperf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,14 @@ impl<'a> Rbperf<'a> {
self.stats.map_reading_errors += 1;
continue;
};

// Handle not found, -ENOENT.
if let Ok(None) = frame_bytes {
debug!("Reading from id_to_stack did not found an entry");
self.stats.map_reading_errors += 1;
continue;
};

let frame = unsafe {
parse_frame(
&frame_bytes
Expand Down

0 comments on commit 0096cf8

Please sign in to comment.