Print backtrace of microdroid_manager to kmsg
To track any possible bugs on microdroid_manager. Bug: 258760809 Test: intentionally crash microdroid_manager and see console Change-Id: I2359e59270a1c6c5efab2a6cb1e0727bb3c5743e
This commit is contained in:
parent
2acbb01203
commit
7ff121c0a5
|
@ -1,6 +1,9 @@
|
|||
service microdroid_manager /system/bin/microdroid_manager
|
||||
disabled
|
||||
# print android log to kmsg
|
||||
file /dev/kmsg w
|
||||
# redirect stdout/stderr to kmsg_debug
|
||||
stdio_to_kmsg
|
||||
setenv RUST_LOG info
|
||||
# TODO(jooyung) remove this when microdroid_manager becomes a daemon
|
||||
oneshot
|
||||
|
|
|
@ -47,6 +47,7 @@ use rustutils::system_properties;
|
|||
use rustutils::system_properties::PropertyWatcher;
|
||||
use std::borrow::Cow::{Borrowed, Owned};
|
||||
use std::convert::TryInto;
|
||||
use std::env;
|
||||
use std::fs::{self, create_dir, File, OpenOptions};
|
||||
use std::io::Write;
|
||||
use std::os::unix::io::{FromRawFd, IntoRawFd};
|
||||
|
@ -152,6 +153,11 @@ fn get_vms_rpc_binder() -> Result<Strong<dyn IVirtualMachineService>> {
|
|||
}
|
||||
|
||||
fn main() -> Result<()> {
|
||||
// If debuggable, print full backtrace to console log with stdio_to_kmsg
|
||||
if system_properties::read_bool(APP_DEBUGGABLE_PROP, true)? {
|
||||
env::set_var("RUST_BACKTRACE", "full");
|
||||
}
|
||||
|
||||
scopeguard::defer! {
|
||||
info!("Shutting down...");
|
||||
if let Err(e) = system_properties::write("sys.powerctl", "shutdown") {
|
||||
|
|
Loading…
Reference in New Issue