Skip to content

Commit 3aee856

Browse files
arch: Log error if profile deserialization fails
Although CPU profile data deserialization is assumed to always succeed (and we panic if it doesn't), we still decide to also log this case in order to get more information to debug the problem. Signed-Off-by: Oliver Anderson <oliver.anderson@cyberus-technology.de> On-behalf-of: SAP oliver.anderson@sap.com
1 parent 40b3f30 commit 3aee856

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/src/x86_64/cpu_profile.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ impl CpuProfile {
3434
*/
3535
Some(
3636
serde_json::from_slice(include_bytes!("cpu_profiles/dev_profile.json"))
37+
.inspect_err(|e| {
38+
error!("BUG: could not deserialize CPU profile. Got error: {:?}", e)
39+
})
3740
.expect("should be able to deserialize pre-generated data"),
3841
)
3942
}

0 commit comments

Comments
 (0)