Merge "Use new AndroidUnwinder object." am: dbe14f2f73
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2095788 Change-Id: Ib7e1125d08abef2fabc887dab9b5c77f5df61d47 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
32cfdb4be7
3 changed files with 16 additions and 15 deletions
|
|
@ -178,7 +178,6 @@ libinit_cc_defaults {
|
|||
"update_metadata-protos",
|
||||
],
|
||||
shared_libs: [
|
||||
"libbacktrace",
|
||||
"libbase",
|
||||
"libbootloader_message",
|
||||
"libcrypto",
|
||||
|
|
@ -195,6 +194,7 @@ libinit_cc_defaults {
|
|||
"libprocessgroup",
|
||||
"libprocessgroup_setup",
|
||||
"libselinux",
|
||||
"libunwindstack",
|
||||
"libutils",
|
||||
"libziparchive",
|
||||
],
|
||||
|
|
@ -352,7 +352,6 @@ cc_binary {
|
|||
"libgsi",
|
||||
"liblzma",
|
||||
"libunwindstack_no_dex",
|
||||
"libbacktrace_no_dex",
|
||||
"libmodprobe",
|
||||
"libext2_uuid",
|
||||
"libprotobuf-cpp-lite",
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
@ -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"
|
||||
|
|
@ -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.";
|
||||
unwindstack::AndroidLocalUnwinder unwinder;
|
||||
unwindstack::AndroidUnwinderData data;
|
||||
if (!unwinder.Unwind(data)) {
|
||||
LOG(ERROR) << __FUNCTION__
|
||||
<< "sys.powerctl: Failed to unwind callstack: " << data.GetErrorString();
|
||||
}
|
||||
for (size_t i = 0; i < backtrace->NumFrames(); i++) {
|
||||
LOG(ERROR) << "sys.powerctl: " << backtrace->FormatFrameData(i);
|
||||
for (const auto& frame : data.frames) {
|
||||
LOG(ERROR) << "sys.powerctl: " << unwinder.FormatFrame(frame);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
@ -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…
Add table
Reference in a new issue