blob: f0e3ce6d89fa715aef4657c1174730d4f51bb217 [file] [log] [blame]
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.feedback;
using zx;
/// Get information about why a device last shutdown. The term reboot is used instead of shutdown
/// since many developers phrase their questions about shutdowns in terms of reboots and most
/// components are interested in knowing why the system just rebooted.
@discoverable
closed protocol LastRebootInfoProvider {
strict Get() -> (struct {
last_reboot LastReboot;
});
};
/// Information about why a device last rebooted.
type LastReboot = table {
/// Whether the last reboot was graceful, i.e. the device didn't reboot in response to an error
/// and rebooted in a controlled manner.
///
/// This field allows clients to know whether the last reboot was graceful without having to
/// parse the optional |reason| field. This is useful when |reason| is not set, i.e. because
/// the system doesn't know more than the fact that the reboot was graceful, or when the API
/// evolves to support new RebootReason values and the clients hasn't been updated yet.
///
/// This field is always has a value if |reason| is provided. However, |reason| might not
/// always have a value this field is provided.
1: graceful bool;
/// Why a device last rebooted.
2: reason RebootReason;
/// The uptime of the device before it rebooted.
3: uptime zx.Duration;
};
/// Reasons why a device last rebooted.
@available(replaced=9)
type RebootReason = strict enum : uint16 {
// ///////////////////////////////////////////////////////////////////////////////////////////
// Ungraceful reboot reasons
// |graceful| has a value of false in LastReboot above.
/// The device booted from a cold state.
///
/// This is most likely the result of an extended period of time without power or a device
/// booting with Fuchsia for the first time.
COLD = 2;
/// The device rebooted due to a brief loss of power.
///
/// On some hardware this could be the result of a user disconnecting, then reconnecting their
/// device's power supply in rapid succession.
BRIEF_POWER_LOSS = 3;
/// The device rebooted because its voltage dipped below an allowable level without going to 0.
BROWNOUT = 4;
KERNEL_PANIC = 5;
SYSTEM_OUT_OF_MEMORY = 6;
HARDWARE_WATCHDOG_TIMEOUT = 7;
SOFTWARE_WATCHDOG_TIMEOUT = 8;
/// The device rebooted because the userspace root job was terminated, most likely because one
/// of its critical processes crashed.
ROOT_JOB_TERMINATION = 19;
// ///////////////////////////////////////////////////////////////////////////////////////////
// Graceful reboot reasons
// |graceful| has a value of true in LastReboot above.
/// The device rebooted because a user of the device initiated the reboot. A user can be a
/// human or a program that interacts with the device on behalf of a human, such as SL4F or RCS.
USER_REQUEST = 9;
/// The device rebooted because of an OTA.
SYSTEM_UPDATE = 10;
/// The device rebooted because applying the OTA failed and we want to retry.
RETRY_SYSTEM_UPDATE = 17;
/// The device rebooted because it was determined to be too hot.
HIGH_TEMPERATURE = 11;
/// The device rebooted because of an issue with a session or because the session manager was
/// unable to recover from an error.
SESSION_FAILURE = 12;
/// The device rebooted because the system manager (sysmgr) was unable to recover from an
/// error.
SYSMGR_FAILURE = 15;
/// The device rebooted following a data reset to factory defaults.
/// See [`fuchsia.recovery.FactoryReset`].
FACTORY_DATA_RESET = 14;
/// The device rebooted because a critical component managed by sysmgr has failed.
CRITICAL_COMPONENT_FAILURE = 16;
/// The device rebooted to apply the swap of Zircon boot images.
ZBI_SWAP = 18;
};
/// Reasons why a device last rebooted.
@available(added=9)
type RebootReason = flexible enum : uint16 {
/// The client will get this value if the server is sending a new enum value that the client
/// was not compiled with.
@unknown
UNKNOWN = 0;
// ///////////////////////////////////////////////////////////////////////////////////////////
// Ungraceful reboot reasons
// |graceful| has a value of false in LastReboot above.
/// The device booted from a cold state.
///
/// This is most likely the result of an extended period of time without power or a device
/// booting with Fuchsia for the first time.
COLD = 2;
/// The device rebooted due to a brief loss of power.
///
/// On some hardware this could be the result of a user disconnecting, then reconnecting their
/// device's power supply in rapid succession.
BRIEF_POWER_LOSS = 3;
/// The device rebooted because its voltage dipped below an allowable level without going to 0.
BROWNOUT = 4;
KERNEL_PANIC = 5;
SYSTEM_OUT_OF_MEMORY = 6;
HARDWARE_WATCHDOG_TIMEOUT = 7;
SOFTWARE_WATCHDOG_TIMEOUT = 8;
/// The device rebooted because the userspace root job was terminated, most likely because one
/// of its critical processes crashed.
ROOT_JOB_TERMINATION = 19;
// ///////////////////////////////////////////////////////////////////////////////////////////
// Graceful reboot reasons
// |graceful| has a value of true in LastReboot above.
/// The device rebooted because a user of the device initiated the reboot. A user can be a
/// human or a program that interacts with the device on behalf of a human, such as SL4F or RCS.
USER_REQUEST = 9;
/// The device rebooted because of an OTA.
SYSTEM_UPDATE = 10;
/// The device rebooted because applying the OTA failed and we want to retry.
RETRY_SYSTEM_UPDATE = 17;
/// The device rebooted because it was determined to be too hot.
HIGH_TEMPERATURE = 11;
/// The device rebooted because of an issue with a session or because the session manager was
/// unable to recover from an error.
SESSION_FAILURE = 12;
/// The device rebooted because the system manager (sysmgr) was unable to recover from an
/// error.
SYSMGR_FAILURE = 15;
/// The device rebooted following a data reset to factory defaults.
/// See [`fuchsia.recovery.FactoryReset`].
FACTORY_DATA_RESET = 14;
/// The device rebooted because a critical component managed by sysmgr has failed.
CRITICAL_COMPONENT_FAILURE = 16;
/// The device rebooted to apply the swap of Zircon boot images.
ZBI_SWAP = 18;
};