| // 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] |
| protocol LastRebootInfoProvider { |
| Get() -> (LastReboot last_reboot); |
| }; |
| |
| /// Information about why a device last rebooted. |
| table LastReboot { |
| /// 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: bool graceful; |
| |
| /// Why a device last rebooted. |
| 2: RebootReason reason; |
| |
| /// The uptime of the device before it rebooted. |
| 3: zx.duration uptime; |
| }; |
| |
| /// Reasons why a device last rebooted. |
| enum RebootReason : uint16 { |
| /// 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; |
| }; |