Add page size info to tombstone

Now that Android devices can use 16k page size, it's important that we
know what configuration the device is in when see issues.

1) If the device is in 4k mode, we see nothing new.

2) If the device is in 16k mode, we see this line in the tombstones:

Page size: 16

3) If the device is in 4k mode, but was previous in 16k mode we see:

Has been in 16kb mode: yes

Test: atest debuggerd_test
Test: atest debuggerd_test with ro.misctrl.16kb_before="1"
Test: adb shell cat /data/tombstones/tombstone_00
Bug: 335247092
Change-Id: If7ca3b0954a01070ff413758296460ca1d023ca5
This commit is contained in:
Devin Moore 2024-05-03 00:02:24 +00:00
parent 2026332ed8
commit 4647b6b305
3 changed files with 14 additions and 1 deletions

View file

@ -714,6 +714,9 @@ void engrave_tombstone_proto(Tombstone* tombstone, unwindstack::AndroidUnwinder*
error.c_str());
}
result.set_page_size(getpagesize());
result.set_has_been_16kb_mode(android::base::GetBoolProperty("ro.misctrl.16kb_before", false));
auto cmd_line = result.mutable_command_line();
for (const auto& arg : target_thread.command_line) {
*cmd_line->Add() = arg;

View file

@ -586,6 +586,13 @@ bool tombstone_proto_to_text(const Tombstone& tombstone, CallbackType callback)
CBL("Timestamp: %s", tombstone.timestamp().c_str());
CBL("Process uptime: %ds", tombstone.process_uptime());
// only print this info if the page size is not 4k or has been in 16k mode
if (tombstone.page_size() != 4096) {
CBL("Page size: %d bytes", tombstone.page_size());
} else if (tombstone.has_been_16kb_mode()) {
CBL("Has been in 16kb mode: yes");
}
// Process header
const auto& threads = tombstone.threads();
auto main_thread_it = threads.find(tombstone.tid());

View file

@ -46,7 +46,10 @@ message Tombstone {
repeated LogBuffer log_buffers = 18;
repeated FD open_fds = 19;
reserved 22 to 999;
uint32 page_size = 22;
bool has_been_16kb_mode = 23;
reserved 24 to 999;
}
enum Architecture {