Namespaces

Enumerations

enum HwShutdownReason
Name Value
kNotSet 0
kUndefined 1
kCold 2
kWarm 3
kBrownout 4
kWatchdog 5
kNotParseable 6

Defined at line 12 of file ../../src/developer/forensics/feedback/reboot_log/hw_shutdown_reason.h

enum ZirconShutdownReason
Name Value
kNotSet 0
kNoCrash 1
kKernelPanic 2
kOOM 3
kSwWatchdog 4
kUnknown 5
kRootJobTermination 6
kNotParseable 7

Defined at line 12 of file ../../src/developer/forensics/feedback/reboot_log/zircon_shutdown_reason.h

enum GracefulShutdownReason
Name Value
kNotSet 0
kUserRequest 1
kSystemUpdate 2
kRetrySystemUpdate 3
kHighTemperature 4
kSessionFailure 5
kSysmgrFailure 6
kCriticalComponentFailure 7
kFdr 8
kZbiSwap 9
kOutOfMemory 10
kNetstackMigration 11
kAndroidUnexpectedReason 12
kAndroidNoReason 13
kAndroidRescueParty 14
kAndroidCriticalProcessFailure 15
kDeveloperRequest 16
kUserRequestDeviceStuck 17
kBatteryDrained 18
kNotSupported 19
kNotParseable 20

Feedback's internal representation of why a device shutdown gracefully.

These values should not be used to understand why a device has shutdown outside of this

component.

Defined at line 19 of file ../../src/developer/forensics/feedback/reboot_log/graceful_shutdown_info.h

enum CrashReportUploadPolicy
Name Value
kDisabled 0
kEnabled 1
kReadFromPrivacySettings 2

Policy defining whether to upload pending and future crash reports to a remote crash server.

Defined at line 20 of file ../../src/developer/forensics/feedback/config.h

enum FinalShutdownReason
Name Value
kNotParseable 0
kCold 1
kBrownout 2
kHwWatchdog 3
kSpontaneousReboot 4
kKernelPanic 5
kOom 6
kSwWatchdog 7
kRootJobTermination 8
kGenericGraceful 9
kUnexpectedReasonGraceful 10
kUserRequest 11
kSystemUpdate 12
kRetrySystemUpdate 13
kHighTemperature 14
kSessionFailure 15
kSysmgrFailure 16
kCriticalComponentFailure 17
kFdr 18
kZbiSwap 19
kNetstackMigration 20
kAndroidUnexpectedReason 21
kAndroidNoReason 22
kAndroidRescueParty 23
kAndroidCriticalProcessFailure 24
kDeveloperRequest 25
kUserRequestDeviceStuck 26
kBatteryDrained 27

Defined at line 22 of file ../../src/developer/forensics/feedback/reboot_log/final_shutdown_info.h

enum SpontaneousRebootReason
Name Value
kSpontaneous 0
kBriefPowerLoss 1
kHardReset 2

Defined at line 33 of file ../../src/developer/forensics/feedback/config.h

enum GracefulShutdownAction
Name Value
kPoweroff 0
kReboot 1
kRebootToRecovery 2
kRebootToBootloader 3
kNotSupported 4
kNotParseable 5

Feedback's internal representation of how a device shutdown gracefully.

These values should not be used to understand how a device has shutdown outside of this

component.

Defined at line 51 of file ../../src/developer/forensics/feedback/reboot_log/graceful_shutdown_info.h

Records

Functions

  • int main ()

    Defined at line 34 of file ../../src/developer/forensics/feedback/main.cc

  • Annotations FromFidl (const std::vector<fuchsia::feedback::Annotation> & annotations)

    Deserializes |annotations| as Annotations.

    Defined at line 11 of file ../../src/developer/forensics/feedback/annotations/decode.cc

  • std::string LastRebootReasonAnnotation (const FinalShutdownInfo & final_shutdown_info, SpontaneousRebootReason spontaneous_reboot_reason)

    Utilities for converting a RebootLog into annotations for snapshots.

    Defined at line 26 of file ../../src/developer/forensics/feedback/reboot_log/annotations.cc

  • template <typename T>
    T Encode (const Annotations & annotations)

    Returns |annotations| serialize as a certain type.

  • ErrorOrString LastRebootUptimeAnnotation (const RebootLog & reboot_log)

    Defined at line 99 of file ../../src/developer/forensics/feedback/reboot_log/annotations.cc

  • ErrorOrString LastRebootRuntimeAnnotation (const RebootLog & reboot_log)

    Defined at line 110 of file ../../src/developer/forensics/feedback/reboot_log/annotations.cc

  • bool TestAndSetNotAFdr (const std::string & not_a_fdr_file)

    Return whether |not_a_fdr_path| existed in the file system and create it otherwise.

    Defined at line 53 of file ../../src/developer/forensics/feedback/namespace_init.cc

  • ErrorOrString LastRebootTotalSuspendedTimeAnnotation (const RebootLog & reboot_log)

    Defined at line 121 of file ../../src/developer/forensics/feedback/reboot_log/annotations.cc

  • ErrorOrString LastShutdownGracefulActionAnnotation (const FinalShutdownInfo & final_shutdown_info)

    Defined at line 133 of file ../../src/developer/forensics/feedback/reboot_log/annotations.cc

  • Annotations GetStartupAnnotations (const RebootLog & reboot_log, SpontaneousRebootReason spontaneous_reboot_reason, const std::string & compilation_mode_path)

    Gets annotations that are available immediately and synchronously when the component starts and

    never change while it is running.

    Defined at line 89 of file ../../src/developer/forensics/feedback/annotations/startup_annotations.cc

  • int DefaultCacheIdFn ()

    Default function for generating a random starting cache id by drawing from a uniform distribution

    between 0 and 7500. This is done in an attempt to prevent collisions between the current and

    previous boot logs and keep stringified IDs between 1 and 4 digits for easy human consumption.

    Defined at line 14 of file ../../src/developer/forensics/feedback/redactor_factory.cc

  • template <>
    fuchsia::feedback::Annotations Encode<fuchsia::feedback::Annotations> (const Annotations & annotations)

    Defined at line 14 of file ../../src/developer/forensics/feedback/annotations/encode.cc

  • void MoveFile (const std::string & from, const std::string & to)

    Moves the file to |to| from |from|.

    Defined at line 28 of file ../../src/developer/forensics/feedback/namespace_init.cc

  • std::unique_ptr<RedactorBase> RedactorFromConfig (inspect::Node * root_node, const BuildTypeConfig & config, ::fit::function<int ()> seed_cache_id)

    Returns an IdentityRedactor if the file at |enable_flag_file| doesn't exist, otherwise return a

    Redactor.

    Defined at line 25 of file ../../src/developer/forensics/feedback/redactor_factory.cc

  • std::optional<SystemTime> GetPreviousSystemTime (const std::string & path)

    Parses the previous system time from the given file containing JSON. Returns std::nullopt on

    error.

    Defined at line 24 of file ../../src/developer/forensics/feedback/system_time_tracker.cc

  • template <>
    std::string Encode<std::string> (const Annotations & annotations)

    Defined at line 36 of file ../../src/developer/forensics/feedback/annotations/encode.cc

  • void CreatePreviousLogsFile (cobalt::Logger * cobalt, StorageSize max_decompressed_size, const std::string & dir, const std::string & write_path)

    Feedback data

    Decompress and concatenate the logs from the previous boot in |dir| and store the at

    |write_path|.

    Defined at line 65 of file ../../src/developer/forensics/feedback/namespace_init.cc

  • void MoveAndRecordBootId (const std::string & new_boot_id, const std::string & previous_boot_id_path, const std::string & current_boot_id_path, const std::string & timeline_path)

    Move the boot id stored at |current_boot_id_path| to |previous_boot_id_path| and write a new

    boot id to |current_boot_id_path|.

    Appends the new boot id to the timeline stored at |timeline_path| and truncates the timeline

    to the last 10 boot ids.

    Defined at line 90 of file ../../src/developer/forensics/feedback/namespace_init.cc

  • void MoveAndRecordBuildVersion (const std::string & current_build_version, const std::string & previous_build_version_path, const std::string & current_build_version_path)

    Move the build version stored at |current_build_version_path| to |previous_build_version_path|

    and write the current build version to |current_build_version_path|.

    Defined at line 114 of file ../../src/developer/forensics/feedback/namespace_init.cc

  • fpromise::promise<LifecycleStopSignal, Error> WaitForLifecycleStop (async_dispatcher_t * dispatcher, fidl::InterfaceRequest<fuchsia::process::lifecycle::Lifecycle> request)

    Returns a promise which will complete successfully when the lifecycle signal is received.

    Note, the response will be sent when the `LifecycleStopSignal` object is destroyed, if it hasn't

    already been sent.

    Defined at line 73 of file ../../src/developer/forensics/feedback/stop_signals.cc

  • void PrintTo (const AttachmentValue & value, std::ostream * os)

    Defined at line 161 of file ../../src/developer/forensics/testing/gpretty_printers.h

  • fpromise::promise<GracefulShutdownInfoSignal, Error> WaitForShutdownInfo (async_dispatcher_t * dispatcher, fidl::InterfaceRequest<fuchsia::hardware::power::statecontrol::ShutdownWatcher> request)

    Returns a promise which will complete successfully when the shutdown signal is received.

    Note, the response will be sent when the `GracefulShutdownInfoSignal` object is destroyed, if it

    hasn't already been sent.

    Defined at line 163 of file ../../src/developer/forensics/feedback/stop_signals.cc

  • void PrintTo (const GracefulShutdownInfoSignal & signal, std::ostream * os)

    Defined at line 180 of file ../../src/developer/forensics/testing/gpretty_printers.h

  • void PrintTo (const GracefulShutdownAction action, std::ostream * os)

    Defined at line 189 of file ../../src/developer/forensics/testing/gpretty_printers.h

  • std::string ToString (GracefulShutdownAction action)

    Defined at line 223 of file ../../src/developer/forensics/feedback/reboot_log/graceful_shutdown_info.cc

  • std::string ToString (GracefulShutdownReason reason)

    Defined at line 244 of file ../../src/developer/forensics/feedback/reboot_log/graceful_shutdown_info.cc

  • std::optional<SnapshotConfig> GetSnapshotConfig (const std::string & path)

    Defined at line 283 of file ../../src/developer/forensics/feedback/config.cc

  • std::optional<SnapshotExclusionConfig> GetSnapshotExclusionConfig (const std::string & path)

    Defined at line 288 of file ../../src/developer/forensics/feedback/config.cc

  • GracefulShutdownAction ToGracefulShutdownAction (const fuchsia::hardware::power::statecontrol::ShutdownOptions & options)

    Extracts the ShutdownAction from |options| and returns the action as a GracefulShutdownAction.

    Check-fails that |options| has the action set.

    Defined at line 476 of file ../../src/developer/forensics/feedback/reboot_log/graceful_shutdown_info.cc

  • std::optional<FeedbackConfig> GetFeedbackConfig (const std::string & path)

    Defined at line 294 of file ../../src/developer/forensics/feedback/config.cc

  • std::vector<GracefulShutdownReason> ToGracefulShutdownReasons (const fuchsia::hardware::power::statecontrol::ShutdownOptions & options)

    Defined at line 496 of file ../../src/developer/forensics/feedback/reboot_log/graceful_shutdown_info.cc

  • void ExposeConfig (inspect::Node & inspect_root, const FeedbackConfig & feedback_config)

    Exposes the static configuration based on build type and product.

    Defined at line 299 of file ../../src/developer/forensics/feedback/config.cc

  • std::vector<GracefulShutdownReason> FromLegacyTxtFile (std::string_view content)

    Converts the file contents into a list of `GracefulShutdownReasons`.

    The expected format is:

    "Reason 1,Reason 2,Reason 3"

    If the given string is empty, the returned list will be empty.

    Defined at line 399 of file ../../src/developer/forensics/feedback/reboot_log/graceful_shutdown_info.cc

  • std::string ToString (CrashReportUploadPolicy upload_policy)

    Returns the string version of the enum.

    Defined at line 335 of file ../../src/developer/forensics/feedback/config.cc

  • std::string ToLegacyFileContentForTesting (const std::vector<GracefulShutdownReason> & reasons)

    Converts the list of `GracefulShutdownReasonss` into a single string.

    The format is:

    "Reason 1,Reason 2,Reason 3"

    Defined at line 297 of file ../../src/developer/forensics/feedback/reboot_log/graceful_shutdown_info.cc

  • std::vector<std::string> ToReasonStrings (const std::vector<GracefulShutdownReason> & reasons)

    The input is limited to GracefulShutdownReasons that map to

    |power::statecontrol::ShutdownReason|.

    Note that some variants that should not be persisted (e.g. `kNotParseable`) are translated to

    `kNotSupported`.

    Defined at line 305 of file ../../src/developer/forensics/feedback/reboot_log/graceful_shutdown_info.cc

  • GracefulShutdownInfo FromJson (const std::string & content)

    The input is limited to GracefulShutdownActions that map to |power::statecontrol::ShutdownAction|

    and GracefulShutdownReasons that map to |power::statecontrol::ShutdownReason|.

    The format is expected to be:

    {

    action: "action",

    reasons: [

    "Reason 1",

    "Reason 2"

    ]

    }

    Defined at line 415 of file ../../src/developer/forensics/feedback/reboot_log/graceful_shutdown_info.cc

  • std::string ToJson (GracefulShutdownAction action, const std::vector<GracefulShutdownReason> & reasons)

    The input is limited to GracefulShutdownActions that map to |power::statecontrol::ShutdownAction|

    and GracefulShutdownReasons that map to |power::statecontrol::ShutdownReason|.

    Defined at line 353 of file ../../src/developer/forensics/feedback/reboot_log/graceful_shutdown_info.cc

  • std::string ToRawStrings (const std::vector<GracefulShutdownReason> & reasons)

    Converts the list of `GracefulShutdownReasons` into a single comma-separated string, like

    "Reason 1,Reason 2,Reason 3".

    Defined at line 381 of file ../../src/developer/forensics/feedback/reboot_log/graceful_shutdown_info.cc

  • void WriteGracefulShutdownInfo (GracefulShutdownAction actionconst std::vector<GracefulShutdownReason> & reasonsconst std::string & path)

    Writes the graceful shutdown action and reasons to `path`.

    Defined at line 510 of file ../../src/developer/forensics/feedback/reboot_log/graceful_shutdown_info.cc