• Home
  • Raw
  • Download

Lines Matching +full:early +full:- +full:boot

8  *      http://www.apache.org/licenses/LICENSE-2.0
17 // The bootstat command provides options to persist boot events with the current
40 #include <android-base/chrono_utils.h>
41 #include <android-base/file.h>
42 #include <android-base/logging.h>
43 #include <android-base/parseint.h>
44 #include <android-base/properties.h>
45 #include <android-base/strings.h>
139 // Scans the boot event record store for record files and logs each boot event
149 if (info->second.atom == android::util::BOOT_TIME_EVENT_ERROR_CODE_REPORTED) { in LogBootEvents()
150 android::util::stats_write(static_cast<int32_t>(info->second.atom), in LogBootEvents()
151 static_cast<int32_t>(info->second.event), in LogBootEvents()
154 android::util::stats_write(static_cast<int32_t>(info->second.atom), in LogBootEvents()
155 static_cast<int32_t>(info->second.event), in LogBootEvents()
168 // Records the named boot |event| to the record store. If |value| is non-empty
170 // integer value is associated with the boot event.
184 printf("Boot events:\n"); in PrintBootEvents()
185 printf("------------\n"); in PrintBootEvents()
190 printf("%s\t%d\n", i->first.c_str(), i->second); in PrintBootEvents()
198 " -h, --help Show this help\n" in ShowHelp()
199 " -l, --log Log all metrics to logstorage\n" in ShowHelp()
200 " -p, --print Dump the boot event records to the console\n" in ShowHelp()
201 " -r, --record Record the timestamp of a named boot event\n" in ShowHelp()
202 " --value Optional value to associate with the boot event\n" in ShowHelp()
203 " --record_boot_complete Record metrics related to the time for the device boot\n" in ShowHelp()
204 " --record_boot_reason Record the reason why the device booted\n" in ShowHelp()
205 " --record_time_since_factory_reset Record the time since the device was reset\n" in ShowHelp()
206 " --boot_reason_enum=<reason> Report the match to the kBootReasonMap table\n"); in ShowHelp()
224 // A mapping from boot reason string, as read from the ro.boot.bootreason
261 {"srto: reboot-bootloader", 31},
265 {"srto:1-1", 35},
292 {"thermal-shutdown", 60},
367 {"power-on", 135},
404 {"reboot,dm-verity_device_corrupted", 172},
405 {"reboot,dm-verity_enforcing", 173},
415 {"reboot,unknown[0-9]*", 183},
417 {"reboot,boringssl-self-check-failed", 185},
443 {"watchdog,apc,bl,debug,early", 211},
444 {"watchdog,apc,bl,early", 212},
445 {"watchdog,apc,early", 213},
450 {"reboot,early,bl", 218},
464 {"reboot,early,abl", 232},
465 {"reboot,early,bl2", 233},
477 // via Tron, which does not accept non-integer buckets in histograms.
481 return mapping->second; in BootReasonStrToEnum()
494 if (exact[exact.size() - 1] != '$') exact = exact + "$"; in BootReasonStrToEnum()
498 LOG(INFO) << "Unknown boot reason: " << boot_reason; in BootReasonStrToEnum()
504 // clang-format off
509 "recovery", // Should not happen from ro.boot.bootreason
510 "bootloader", // Should not happen from ro.boot.bootreason
516 "shutdown", // Can not happen from ro.boot.bootreason
517 "reboot", // Default catch-all for anything unknown
518 // clang-format on
575 if (android::base::ReadFileToString("/sys/fs/pstore/console-ramoops-0", &console)) { in readPstoreConsole()
578 return android::base::ReadFileToString("/sys/fs/pstore/console-ramoops", &console); in readPstoreConsole()
612 size_t num = numError(*--le, *--re); in numError()
617 if (count > ((n * 8 + kBitErrorRate - (n > 2)) / kBitErrorRate)) { in numError()
638 pos -= needle.length(); in rfind()
643 --pos; in rfind()
652 const size_t last_pos = console.length() - needle.length(); in find()
669 const size_t last_pos = reason.length() - needle.length(); in correctForBitError()
744 // Except for * and J, single bit errors for \n, all others are non-
840 // to communicate more accurate boot subreasons via last console messages. in addKernelPanicSubReason()
858 std::string panic("Kernel panic - not syncing: "); in addKernelPanicSubReason()
865 {"Oh boy, that early out of memory", "oom"}, // omg in addKernelPanicSubReason()
875 {"stack-protector", "stack"}, in addKernelPanicSubReason()
880 {"subsys-restart: Resetting the SoC - modem crashed.", "modem"}, in addKernelPanicSubReason()
881 {"subsys-restart: Resetting the SoC - adsp crashed.", "adsp"}, in addKernelPanicSubReason()
882 {"subsys-restart: Resetting the SoC - dsps crashed.", "dsps"}, in addKernelPanicSubReason()
883 {"subsys-restart: Resetting the SoC - wcnss crashed.", "wcnss"}, in addKernelPanicSubReason()
903 const char system_reboot_reason_property[] = "sys.boot.reason";
906 const char last_last_reboot_reason_property[] = "sys.boot.reason.last";
909 const char bootloader_reboot_reason_property[] = "ro.boot.bootreason";
915 LOG(INFO) << "Canonical boot reason: " << system_boot_reason; in BootReasonAddToHistory()
917 // skip system_boot_reason(factory_reset, ota) shift since device boot up from shipmode in BootReasonAddToHistory()
923 LOG(INFO) << "skip boot reason (" << system_boot_reason in BootReasonAddToHistory()
924 << ") shift since device boot up from shipmode."; in BootReasonAddToHistory()
932 system_boot_reason.substr(0, PROPERTY_VALUE_MAX - 1)); in BootReasonAddToHistory()
943 // trim the list to (history_reboot_reason_size - 1) in BootReasonAddToHistory()
946 if (it->empty() || (last == *it) || (marked_system_boot_reason == *it) || (--max <= 0)) { in BootReasonAddToHistory()
966 // Scrub, Sanitize, Standardize and Enhance the boot reason string supplied.
971 // skip BootReasonStrToReason() if device boot up from shipmode in BootReasonStrToReason()
974 LOG(INFO) << "skip boot reason enhancement if device boot up from shipmode"; in BootReasonStrToReason()
978 // If sys.boot.reason == ro.boot.bootreason, let's re-evaluate in BootReasonStrToReason()
983 // Is the current system boot reason sys.boot.reason valid? in BootReasonStrToReason()
987 // Is the bootloader boot reason ro.boot.bootreason known? in BootReasonStrToReason()
988 std::vector<std::string> words(android::base::Split(reason, ",_-")); in BootReasonStrToReason()
1116 // Anything in last is better than 'super-blunt' reboot or shutdown. in BootReasonStrToReason()
1125 // possibly offer hardware-specific clues from the PMIC. in BootReasonStrToReason()
1143 LOG(INFO) << "Canonical boot reason: " << ret; in BootReasonStrToReason()
1148 // that boot metrics after a system update are labeled as ota_boot_complete;
1184 boot_event_store->AddBootEventWithValue(property, time_in_ms); in RecordInitBootTimeProp()
1188 // A map from bootloader timing stage to the time that stage took during boot.
1192 // took to boot.
1196 // |ro.boot.boottime| is of the form 'stage1:time1,...,stageN:timeN', in GetBootLoaderTimings()
1198 auto value = android::base::GetProperty("ro.boot.boottime", ""); in GetBootLoaderTimings()
1200 // ro.boot.boottime is not reported on all devices. in GetBootLoaderTimings()
1221 // Returns the total bootloader boot time from the ro.boot.boottime system property.
1231 // Parses and records the set of bootloader stages and associated boot times
1232 // from the ro.boot.boottime system property.
1238 boot_event_store->AddBootEventWithValue("boottime.bootloader." + timing.first, timing.second); in RecordBootloaderTimings()
1241 boot_event_store->AddBootEventWithValue("boottime.bootloader.total", total_time); in RecordBootloaderTimings()
1244 // Returns the closest estimation to the absolute device boot time, i.e.,
1260 // Records the closest estimation to the absolute device boot time in seconds.
1265 boot_event_store->AddBootEventWithValue("absolute_boot_time", absolute_total_sec.count()); in RecordAbsoluteBootTime()
1268 // Logs the total boot time and reason to statsd.
1311 // Gets the boot time offset. This is useful when Android is running in a
1315 android::base::GetIntProperty<int64_t>("ro.boot.boottime_offset", 0); in GetBootTimeOffset()
1322 return android::base::boot_clock::now().time_since_epoch() - GetBootTimeOffset(); in GetUptime()
1325 // Records several metrics related to the time it takes to boot the device.
1353 // over from a time when encryption meant "full-disk encryption". But Android in RecordBootComplete()
1354 // now always uses file-based encryption instead of full-disk encryption. At in RecordBootComplete()
1359 // Record the total time from device startup to boot complete. Note: we are in RecordBootComplete()
1384 // Records the boot_reason metric by querying the ro.boot.bootreason system
1391 // Log an empty boot reason value as '<EMPTY>' to ensure the value is intentional in RecordBootReason()
1420 // device. The former is only set once per-factory reset.
1453 // The factory_reset boot event does not exist after the device is reset, so in RecordFactoryReset()
1480 // List the associated boot reason(s), if arg is nullptr then all.
1482 int value = -1; in PrintBootReasonEnum()
1509 // clang-format off in main()
1521 // clang-format on in main()
1527 while ((opt = getopt_long(argc, argv, "hlpr:", long_options, &option_index)) != -1) { in main()
1529 // This case handles long options which have no single-character mapping. in main()