init: Remove the DebugRebootLogging() function

The DebugRebootLogging() function was introduced to help with
root-causing b/150863651. Remove this function since this logging
functionality is no longer needed. Also remove the functions and methods
that are only used by DebugRebootLogging().

Change-Id: Ia150604c6cd70f42b13d655ba43b95445a55b6e2
Signed-off-by: Bart Van Assche <bvanassche@google.com>
This commit is contained in:
Bart Van Assche 2023-03-03 13:21:19 -08:00
parent 1fdbf8d0f8
commit b4b1b75a35
3 changed files with 0 additions and 31 deletions

View file

@ -255,7 +255,6 @@ static class ShutdownState {
return {};
}
bool do_shutdown() const { return do_shutdown_; }
void set_do_shutdown(bool value) { do_shutdown_ = value; }
private:
@ -264,31 +263,6 @@ static class ShutdownState {
bool do_shutdown_ = false;
} shutdown_state;
static void UnwindMainThreadStack() {
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);
}
}
void DebugRebootLogging() {
LOG(INFO) << "sys.powerctl: do_shutdown: " << shutdown_state.do_shutdown()
<< " IsShuttingDown: " << IsShuttingDown();
if (shutdown_state.do_shutdown()) {
LOG(ERROR) << "sys.powerctl set while a previous shutdown command has not been handled";
UnwindMainThreadStack();
}
if (IsShuttingDown()) {
LOG(ERROR) << "sys.powerctl set while init is already shutting down";
UnwindMainThreadStack();
}
}
void DumpState() {
ServiceList::GetInstance().DumpState();
ActionManager::GetInstance().DumpState();

View file

@ -42,8 +42,6 @@ void SendLoadPersistentPropertiesMessage();
void PropertyChanged(const std::string& name, const std::string& value);
bool QueueControlMessage(const std::string& message, const std::string& name, pid_t pid, int fd);
void DebugRebootLogging();
int SecondStageMain(int argc, char** argv);
int StopServicesFromApex(const std::string& apex_name);

View file

@ -550,9 +550,6 @@ std::optional<uint32_t> HandlePropertySet(const std::string& name, const std::st
}
LOG(INFO) << "Received sys.powerctl='" << value << "' from pid: " << cr.pid
<< process_log_string;
if (!value.empty()) {
DebugRebootLogging();
}
if (value == "reboot,userspace" && !is_userspace_reboot_supported().value_or(false)) {
*error = "Userspace reboot is not supported by this device";
return {PROP_ERROR_INVALID_VALUE};