Loading init/Android.bp +1 −2 Original line number Diff line number Diff line Loading @@ -178,7 +178,6 @@ libinit_cc_defaults { "update_metadata-protos", ], shared_libs: [ "libbacktrace", "libbase", "libbootloader_message", "libcrypto", Loading @@ -195,6 +194,7 @@ libinit_cc_defaults { "libprocessgroup", "libprocessgroup_setup", "libselinux", "libunwindstack", "libutils", "libziparchive", ], Loading Loading @@ -352,7 +352,6 @@ cc_binary { "libgsi", "liblzma", "libunwindstack_no_dex", "libbacktrace_no_dex", "libmodprobe", "libext2_uuid", "libprotobuf-cpp-lite", Loading init/init.cpp +9 −7 Original line number Diff line number Diff line Loading @@ -48,7 +48,6 @@ #include <android-base/properties.h> #include <android-base/stringprintf.h> #include <android-base/strings.h> #include <backtrace/Backtrace.h> #include <fs_avb/fs_avb.h> #include <fs_mgr_vendor_overlay.h> #include <keyutils.h> Loading @@ -58,6 +57,7 @@ #include <processgroup/processgroup.h> #include <processgroup/setup.h> #include <selinux/android.h> #include <unwindstack/AndroidUnwinder.h> #include "action_parser.h" #include "builtins.h" Loading Loading @@ -253,12 +253,14 @@ static class ShutdownState { } shutdown_state; static void UnwindMainThreadStack() { std::unique_ptr<Backtrace> backtrace(Backtrace::Create(BACKTRACE_CURRENT_PROCESS, 1)); if (!backtrace->Unwind(0)) { LOG(ERROR) << __FUNCTION__ << "sys.powerctl: Failed to unwind callstack."; } for (size_t i = 0; i < backtrace->NumFrames(); i++) { LOG(ERROR) << "sys.powerctl: " << backtrace->FormatFrameData(i); unwindstack::AndroidLocalUnwinder unwinder; unwindstack::AndroidUnwinderData data; if (!unwinder.Unwind(data)) { LOG(ERROR) << __FUNCTION__ << "sys.powerctl: Failed to unwind callstack: " << data.GetErrorString(); } for (const auto& frame : data.frames) { LOG(ERROR) << "sys.powerctl: " << unwinder.FormatFrame(frame); } } Loading init/reboot_utils.cpp +7 −7 Original line number Diff line number Diff line Loading @@ -26,8 +26,8 @@ #include <android-base/logging.h> #include <android-base/properties.h> #include <android-base/strings.h> #include <backtrace/Backtrace.h> #include <cutils/android_reboot.h> #include <unwindstack/AndroidUnwinder.h> #include "capabilities.h" #include "reboot_utils.h" Loading Loading @@ -157,13 +157,13 @@ void __attribute__((noreturn)) InitFatalReboot(int signal_number) { // In the parent, let's try to get a backtrace then shutdown. LOG(ERROR) << __FUNCTION__ << ": signal " << signal_number; std::unique_ptr<Backtrace> backtrace( Backtrace::Create(BACKTRACE_CURRENT_PROCESS, BACKTRACE_CURRENT_THREAD)); if (!backtrace->Unwind(0)) { LOG(ERROR) << __FUNCTION__ << ": Failed to unwind callstack."; unwindstack::AndroidLocalUnwinder unwinder; unwindstack::AndroidUnwinderData data; if (!unwinder.Unwind(data)) { LOG(ERROR) << __FUNCTION__ << ": Failed to unwind callstack: " << data.GetErrorString(); } for (size_t i = 0; i < backtrace->NumFrames(); i++) { LOG(ERROR) << backtrace->FormatFrameData(i); for (const auto& frame : data.frames) { LOG(ERROR) << unwinder.FormatFrame(frame); } if (init_fatal_panic) { LOG(ERROR) << __FUNCTION__ << ": Trigger crash"; Loading Loading
init/Android.bp +1 −2 Original line number Diff line number Diff line Loading @@ -178,7 +178,6 @@ libinit_cc_defaults { "update_metadata-protos", ], shared_libs: [ "libbacktrace", "libbase", "libbootloader_message", "libcrypto", Loading @@ -195,6 +194,7 @@ libinit_cc_defaults { "libprocessgroup", "libprocessgroup_setup", "libselinux", "libunwindstack", "libutils", "libziparchive", ], Loading Loading @@ -352,7 +352,6 @@ cc_binary { "libgsi", "liblzma", "libunwindstack_no_dex", "libbacktrace_no_dex", "libmodprobe", "libext2_uuid", "libprotobuf-cpp-lite", Loading
init/init.cpp +9 −7 Original line number Diff line number Diff line Loading @@ -48,7 +48,6 @@ #include <android-base/properties.h> #include <android-base/stringprintf.h> #include <android-base/strings.h> #include <backtrace/Backtrace.h> #include <fs_avb/fs_avb.h> #include <fs_mgr_vendor_overlay.h> #include <keyutils.h> Loading @@ -58,6 +57,7 @@ #include <processgroup/processgroup.h> #include <processgroup/setup.h> #include <selinux/android.h> #include <unwindstack/AndroidUnwinder.h> #include "action_parser.h" #include "builtins.h" Loading Loading @@ -253,12 +253,14 @@ static class ShutdownState { } shutdown_state; static void UnwindMainThreadStack() { std::unique_ptr<Backtrace> backtrace(Backtrace::Create(BACKTRACE_CURRENT_PROCESS, 1)); if (!backtrace->Unwind(0)) { LOG(ERROR) << __FUNCTION__ << "sys.powerctl: Failed to unwind callstack."; } for (size_t i = 0; i < backtrace->NumFrames(); i++) { LOG(ERROR) << "sys.powerctl: " << backtrace->FormatFrameData(i); unwindstack::AndroidLocalUnwinder unwinder; unwindstack::AndroidUnwinderData data; if (!unwinder.Unwind(data)) { LOG(ERROR) << __FUNCTION__ << "sys.powerctl: Failed to unwind callstack: " << data.GetErrorString(); } for (const auto& frame : data.frames) { LOG(ERROR) << "sys.powerctl: " << unwinder.FormatFrame(frame); } } Loading
init/reboot_utils.cpp +7 −7 Original line number Diff line number Diff line Loading @@ -26,8 +26,8 @@ #include <android-base/logging.h> #include <android-base/properties.h> #include <android-base/strings.h> #include <backtrace/Backtrace.h> #include <cutils/android_reboot.h> #include <unwindstack/AndroidUnwinder.h> #include "capabilities.h" #include "reboot_utils.h" Loading Loading @@ -157,13 +157,13 @@ void __attribute__((noreturn)) InitFatalReboot(int signal_number) { // In the parent, let's try to get a backtrace then shutdown. LOG(ERROR) << __FUNCTION__ << ": signal " << signal_number; std::unique_ptr<Backtrace> backtrace( Backtrace::Create(BACKTRACE_CURRENT_PROCESS, BACKTRACE_CURRENT_THREAD)); if (!backtrace->Unwind(0)) { LOG(ERROR) << __FUNCTION__ << ": Failed to unwind callstack."; unwindstack::AndroidLocalUnwinder unwinder; unwindstack::AndroidUnwinderData data; if (!unwinder.Unwind(data)) { LOG(ERROR) << __FUNCTION__ << ": Failed to unwind callstack: " << data.GetErrorString(); } for (size_t i = 0; i < backtrace->NumFrames(); i++) { LOG(ERROR) << backtrace->FormatFrameData(i); for (const auto& frame : data.frames) { LOG(ERROR) << unwinder.FormatFrame(frame); } if (init_fatal_panic) { LOG(ERROR) << __FUNCTION__ << ": Trigger crash"; Loading