Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b4b1b75a authored by Bart Van Assche's avatar Bart Van Assche
Browse files

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: default avatarBart Van Assche <bvanassche@google.com>
parent 1fdbf8d0
Loading
Loading
Loading
Loading
+0 −26
Original line number Diff line number Diff line
@@ -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();
+0 −2
Original line number Diff line number Diff line
@@ -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);
+0 −3
Original line number Diff line number Diff line
@@ -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};