Standardize watchdog messages
Try to stick to a common layout for watchdog messages:
- Skip leading "In " prefix.
- Identify "<type>::<method>".
- Ensure that all watchpoints around KeyMint invocations mention either
"IKeyMintDevice" or "IKeyMintOperation" (to make it clearer when
Keystore is blocked on the underlying KeyMint implementation).
Bug: 265778655
Test: watch logcat, add deliberate sleeps
Change-Id: I803a0a7a60b445848afea00b5f48cf7fd1f17fe5
diff --git a/keystore2/src/utils.rs b/keystore2/src/utils.rs
index 22c0522..0a545f7 100644
--- a/keystore2/src/utils.rs
+++ b/keystore2/src/utils.rs
@@ -146,8 +146,7 @@
binder::get_interface("permission")?;
let binder_result = {
- let _wp =
- watchdog::watch("In check_device_attestation_permissions: calling checkPermission.");
+ let _wp = watchdog::watch("check_android_permission: calling checkPermission");
permission_controller.checkPermission(
permission,
ThreadState::get_calling_pid(),
@@ -264,7 +263,9 @@
log::debug!("import parameters={import_params:?}");
let creation_result = {
- let _wp = watchdog::watch("In utils::import_keyblob_and_perform_op: calling importKey.");
+ let _wp = watchdog::watch(
+ "utils::import_keyblob_and_perform_op: calling IKeyMintDevice::importKey",
+ );
map_km_error(km_dev.importKey(&import_params, format, &key_material, None))
}
.context(ks_err!("Upgrade failed."))?;
@@ -304,7 +305,9 @@
NewBlobHandler: FnOnce(&[u8]) -> Result<()>,
{
let upgraded_blob = {
- let _wp = watchdog::watch("In utils::upgrade_keyblob_and_perform_op: calling upgradeKey.");
+ let _wp = watchdog::watch(
+ "utils::upgrade_keyblob_and_perform_op: calling IKeyMintDevice::upgradeKey.",
+ );
map_km_error(km_dev.upgradeKey(key_blob, upgrade_params))
}
.context(ks_err!("Upgrade failed."))?;