Skip to content
Snippets Groups Projects
Commit 6096ad87 authored by Mike McTernan's avatar Mike McTernan Committed by Automerger Merge Worker
Browse files

trusty-log: dump Trusty log on kernel panic only if Trusty panicked. am: a5caf56e

Original change: https://partner-android-review.googlesource.com/c/kernel/private/gs-google/+/2884542



Change-Id: I9689c80ddcad3540c4ef441b3676822de4bbbebe
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 1a87c08e a5caf56e
No related branches found
No related tags found
No related merge requests found
......@@ -133,6 +133,15 @@ module_param_named(log_ratelimit_burst, trusty_log_rate_limit.burst, int, 0644);
module_param_named(log_ratelimit_interval, trusty_log_rate_limit.interval, int,
0644);
/*
* The kernel panic notifier will unconditionaly dump the trusty logs when
* called, if this is set. Otherwise the kernel panic notifier will only dump
* Trusty logs if Trusty has itself panicked.
*/
static bool trusty_log_force_on_panic = false;
module_param_named(log_force_on_panic, trusty_log_force_on_panic, bool, 0644);
/**
* struct trusty_log_sfile - trusty log misc device state
*
......@@ -565,9 +574,14 @@ static int trusty_log_panic_notify(struct notifier_block *nb,
* though this is racy.
*/
s = container_of(nb, struct trusty_log_state, panic_notifier);
dev_info(s->dev, "panic notifier - trusty version %s",
trusty_version_str_get(s->trusty_dev));
trusty_dump_logs(s);
if (trusty_log_force_on_panic ||
trusty_get_panic_status(s->trusty_dev)) {
dev_info(s->dev, "panic notifier - trusty version %s",
trusty_version_str_get(s->trusty_dev));
trusty_dump_logs(s);
}
return NOTIFY_OK;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment