Namespaces

Enumerations

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
kNotSupported 18
kNotParseable 19

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 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 50 of file ../../src/developer/forensics/feedback/reboot_log/graceful_shutdown_info.h

enum ZirconRebootReason
Name Value
kNotSet 0
kCold 1
kNoCrash 2
kKernelPanic 3
kOOM 4
kHwWatchdog 5
kSwWatchdog 6
kBrownout 7
kUnknown 8
kRootJobTermination 9
kNotParseable 10

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

Records

Functions

  • int main ()

    Defined at line 31 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.

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

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

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

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

  • ErrorOrString LastRebootUptimeAnnotation (const RebootLog & reboot_log)

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

  • ErrorOrString LastRebootRuntimeAnnotation (const RebootLog & reboot_log)

    Defined at line 108 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 43 of file ../../src/developer/forensics/feedback/namespace_init.cc

  • ErrorOrString LastRebootTotalSuspendedTimeAnnotation (const RebootLog & reboot_log)

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

  • ErrorOrString LastShutdownGracefulActionAnnotation (const FinalShutdownInfo & final_shutdown_info)

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

  • Annotations GetStartupAnnotations (const RebootLog & reboot_log, SpontaneousRebootReason spontaneous_reboot_reason)

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

    never change while it is running.

    Defined at line 97 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

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

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

    Defined at line 18 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

  • 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 55 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)

    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|.

    Defined at line 80 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 86 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 218 of file ../../src/developer/forensics/feedback/reboot_log/graceful_shutdown_info.cc

  • std::string ToString (GracefulShutdownReason reason)

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

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

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

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

    Defined at line 278 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 468 of file ../../src/developer/forensics/feedback/reboot_log/graceful_shutdown_info.cc

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

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

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

    Defined at line 488 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 289 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 391 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 323 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 290 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 298 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 407 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 345 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 373 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 502 of file ../../src/developer/forensics/feedback/reboot_log/graceful_shutdown_info.cc