blob: 6f25d963dd2182c36160b027e061599ff32853e4 [file] [log] [blame]
James Hawkinsabd73e62016-01-19 15:10:38 -08001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17// The bootstat command provides options to persist boot events with the current
18// timestamp, dump the persisted events, and log all events to EventLog to be
19// uploaded to Android log storage via Tron.
20
James Hawkinsa4a1a4a2016-02-09 15:32:38 -080021#include <getopt.h>
James Hawkinsabd73e62016-01-19 15:10:38 -080022#include <unistd.h>
Mark Salyzynff2dcd92016-09-28 15:54:45 -070023
James Hawkinse78ea772017-03-24 11:43:02 -070024#include <chrono>
James Hawkins0660b302016-03-08 16:18:15 -080025#include <cmath>
James Hawkinsabd73e62016-01-19 15:10:38 -080026#include <cstddef>
27#include <cstdio>
James Hawkins500d7152016-02-16 15:05:54 -080028#include <ctime>
James Hawkinsa4a1a4a2016-02-09 15:32:38 -080029#include <map>
James Hawkinsabd73e62016-01-19 15:10:38 -080030#include <memory>
31#include <string>
James Hawkinsbe46fd12017-02-02 16:21:25 -080032#include <vector>
Mark Salyzynff2dcd92016-09-28 15:54:45 -070033
James Hawkinse78ea772017-03-24 11:43:02 -070034#include <android-base/chrono_utils.h>
James Hawkinseabe08b2016-01-19 16:54:35 -080035#include <android-base/logging.h>
James Hawkins4dded612016-07-28 11:50:23 -070036#include <android-base/parseint.h>
James Hawkinsbe46fd12017-02-02 16:21:25 -080037#include <android-base/strings.h>
James Hawkinse78ea772017-03-24 11:43:02 -070038#include <android/log.h>
James Hawkinsa4a1a4a2016-02-09 15:32:38 -080039#include <cutils/properties.h>
James Hawkins9aec9262017-01-31 11:42:24 -080040#include <metricslogger/metrics_logger.h>
Mark Salyzynff2dcd92016-09-28 15:54:45 -070041
James Hawkinsabd73e62016-01-19 15:10:38 -080042#include "boot_event_record_store.h"
James Hawkinsabd73e62016-01-19 15:10:38 -080043
44namespace {
45
James Hawkinsabd73e62016-01-19 15:10:38 -080046// Scans the boot event record store for record files and logs each boot event
47// via EventLog.
48void LogBootEvents() {
49 BootEventRecordStore boot_event_store;
50
51 auto events = boot_event_store.GetAllBootEvents();
52 for (auto i = events.cbegin(); i != events.cend(); ++i) {
James Hawkins9aec9262017-01-31 11:42:24 -080053 android::metricslogger::LogHistogram(i->first, i->second);
James Hawkinsabd73e62016-01-19 15:10:38 -080054 }
55}
56
James Hawkinsc6275582016-03-22 10:47:44 -070057// Records the named boot |event| to the record store. If |value| is non-empty
58// and is a proper string representation of an integer value, the converted
59// integer value is associated with the boot event.
60void RecordBootEventFromCommandLine(
61 const std::string& event, const std::string& value_str) {
62 BootEventRecordStore boot_event_store;
63 if (!value_str.empty()) {
64 int32_t value = 0;
Elliott Hughesda46b392016-10-11 17:09:00 -070065 if (android::base::ParseInt(value_str, &value)) {
James Hawkins4dded612016-07-28 11:50:23 -070066 boot_event_store.AddBootEventWithValue(event, value);
67 }
James Hawkinsc6275582016-03-22 10:47:44 -070068 } else {
69 boot_event_store.AddBootEvent(event);
70 }
71}
72
James Hawkinsabd73e62016-01-19 15:10:38 -080073void PrintBootEvents() {
74 printf("Boot events:\n");
75 printf("------------\n");
76
77 BootEventRecordStore boot_event_store;
78 auto events = boot_event_store.GetAllBootEvents();
79 for (auto i = events.cbegin(); i != events.cend(); ++i) {
80 printf("%s\t%d\n", i->first.c_str(), i->second);
81 }
82}
83
84void ShowHelp(const char *cmd) {
85 fprintf(stderr, "Usage: %s [options]\n", cmd);
86 fprintf(stderr,
87 "options include:\n"
James Hawkinsa4a1a4a2016-02-09 15:32:38 -080088 " -h, --help Show this help\n"
89 " -l, --log Log all metrics to logstorage\n"
90 " -p, --print Dump the boot event records to the console\n"
91 " -r, --record Record the timestamp of a named boot event\n"
James Hawkinsc6275582016-03-22 10:47:44 -070092 " --value Optional value to associate with the boot event\n"
James Hawkins53684ea2016-02-23 16:18:19 -080093 " --record_boot_reason Record the reason why the device booted\n"
94 " --record_time_since_factory_reset Record the time since the device was reset\n");
James Hawkinsabd73e62016-01-19 15:10:38 -080095}
96
97// Constructs a readable, printable string from the givencommand line
98// arguments.
99std::string GetCommandLine(int argc, char **argv) {
100 std::string cmd;
101 for (int i = 0; i < argc; ++i) {
102 cmd += argv[i];
103 cmd += " ";
104 }
105
106 return cmd;
107}
108
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800109// Convenience wrapper over the property API that returns an
110// std::string.
111std::string GetProperty(const char* key) {
112 std::vector<char> temp(PROPERTY_VALUE_MAX);
113 const int len = property_get(key, &temp[0], nullptr);
114 if (len < 0) {
115 return "";
116 }
117 return std::string(&temp[0], len);
118}
119
James Hawkins6f74c0b2016-02-12 15:49:16 -0800120constexpr int32_t kUnknownBootReason = 1;
121
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800122// A mapping from boot reason string, as read from the ro.boot.bootreason
123// system property, to a unique integer ID. Viewers of log data dashboards for
124// the boot_reason metric may refer to this mapping to discern the histogram
125// values.
James Hawkins6f74c0b2016-02-12 15:49:16 -0800126const std::map<std::string, int32_t> kBootReasonMap = {
127 {"unknown", kUnknownBootReason},
128 {"normal", 2},
129 {"recovery", 3},
130 {"reboot", 4},
131 {"PowerKey", 5},
132 {"hard_reset", 6},
133 {"kernel_panic", 7},
134 {"rpm_err", 8},
135 {"hw_reset", 9},
136 {"tz_err", 10},
137 {"adsp_err", 11},
138 {"modem_err", 12},
139 {"mba_err", 13},
140 {"Watchdog", 14},
141 {"Panic", 15},
142 {"power_key", 16},
143 {"power_on", 17},
144 {"Reboot", 18},
145 {"rtc", 19},
146 {"edl", 20},
James Hawkins45ead352016-03-08 16:42:07 -0800147 {"oem_pon1", 21},
148 {"oem_powerkey", 22},
149 {"oem_unknown_reset", 23},
150 {"srto: HWWDT reset SC", 24},
151 {"srto: HWWDT reset platform", 25},
152 {"srto: bootloader", 26},
153 {"srto: kernel panic", 27},
154 {"srto: kernel watchdog reset", 28},
155 {"srto: normal", 29},
156 {"srto: reboot", 30},
157 {"srto: reboot-bootloader", 31},
158 {"srto: security watchdog reset", 32},
159 {"srto: wakesrc", 33},
160 {"srto: watchdog", 34},
161 {"srto:1-1", 35},
162 {"srto:omap_hsmm", 36},
163 {"srto:phy0", 37},
164 {"srto:rtc0", 38},
165 {"srto:touchpad", 39},
166 {"watchdog", 40},
167 {"watchdogr", 41},
168 {"wdog_bark", 42},
169 {"wdog_bite", 43},
170 {"wdog_reset", 44},
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800171};
172
173// Converts a string value representing the reason the system booted to an
174// integer representation. This is necessary for logging the boot_reason metric
175// via Tron, which does not accept non-integer buckets in histograms.
176int32_t BootReasonStrToEnum(const std::string& boot_reason) {
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800177 auto mapping = kBootReasonMap.find(boot_reason);
178 if (mapping != kBootReasonMap.end()) {
179 return mapping->second;
180 }
181
182 LOG(INFO) << "Unknown boot reason: " << boot_reason;
183 return kUnknownBootReason;
184}
185
James Hawkinsb9cf7712016-04-08 15:32:19 -0700186// Returns the appropriate metric key prefix for the boot_complete metric such
187// that boot metrics after a system update are labeled as ota_boot_complete;
188// otherwise, they are labeled as boot_complete. This method encapsulates the
189// bookkeeping required to track when a system update has occurred by storing
190// the UTC timestamp of the system build date and comparing against the current
191// system build date.
192std::string CalculateBootCompletePrefix() {
193 static const std::string kBuildDateKey = "build_date";
194 std::string boot_complete_prefix = "boot_complete";
195
196 std::string build_date_str = GetProperty("ro.build.date.utc");
James Hawkins4dded612016-07-28 11:50:23 -0700197 int32_t build_date;
Elliott Hughesda46b392016-10-11 17:09:00 -0700198 if (!android::base::ParseInt(build_date_str, &build_date)) {
James Hawkins4dded612016-07-28 11:50:23 -0700199 return std::string();
200 }
James Hawkinsb9cf7712016-04-08 15:32:19 -0700201
202 BootEventRecordStore boot_event_store;
203 BootEventRecordStore::BootEventRecord record;
204 if (!boot_event_store.GetBootEvent(kBuildDateKey, &record) ||
205 build_date != record.second) {
206 boot_complete_prefix = "ota_" + boot_complete_prefix;
207 boot_event_store.AddBootEventWithValue(kBuildDateKey, build_date);
208 }
209
210 return boot_complete_prefix;
211}
212
James Hawkinsef0a0902017-01-06 14:38:23 -0800213// Records the value of a given ro.boottime.init property in milliseconds.
214void RecordInitBootTimeProp(
215 BootEventRecordStore* boot_event_store, const char* property) {
216 std::string value = GetProperty(property);
217
James Hawkins27c05222017-01-26 11:55:44 -0800218 int32_t time_in_ms;
219 if (android::base::ParseInt(value, &time_in_ms)) {
James Hawkinsef0a0902017-01-06 14:38:23 -0800220 boot_event_store->AddBootEventWithValue(property, time_in_ms);
221 }
222}
223
James Hawkinsbe46fd12017-02-02 16:21:25 -0800224// Parses and records the set of bootloader stages and associated boot times
225// from the ro.boot.boottime system property.
226void RecordBootloaderTimings(BootEventRecordStore* boot_event_store) {
227 // |ro.boot.boottime| is of the form 'stage1:time1,...,stageN:timeN'.
228 std::string value = GetProperty("ro.boot.boottime");
James Hawkins6b5c5aa2017-02-16 11:53:03 -0800229 if (value.empty()) {
230 // ro.boot.boottime is not reported on all devices.
231 return;
232 }
James Hawkinsbe46fd12017-02-02 16:21:25 -0800233
James Hawkins6b5c5aa2017-02-16 11:53:03 -0800234 int32_t total_time = 0;
James Hawkinsbe46fd12017-02-02 16:21:25 -0800235 auto stages = android::base::Split(value, ",");
236 for (auto const &stageTiming : stages) {
237 // |stageTiming| is of the form 'stage:time'.
238 auto stageTimingValues = android::base::Split(stageTiming, ":");
239 DCHECK_EQ(2, stageTimingValues.size());
240
241 std::string stageName = stageTimingValues[0];
242 int32_t time_ms;
243 if (android::base::ParseInt(stageTimingValues[1], &time_ms)) {
James Hawkins6b5c5aa2017-02-16 11:53:03 -0800244 total_time += time_ms;
James Hawkinsbe46fd12017-02-02 16:21:25 -0800245 boot_event_store->AddBootEventWithValue(
246 "boottime.bootloader." + stageName, time_ms);
247 }
248 }
James Hawkins6b5c5aa2017-02-16 11:53:03 -0800249
250 boot_event_store->AddBootEventWithValue("boottime.bootloader.total", total_time);
James Hawkinsbe46fd12017-02-02 16:21:25 -0800251}
252
James Hawkinsc08e9962016-03-11 14:59:50 -0800253// Records several metrics related to the time it takes to boot the device,
254// including disambiguating boot time on encrypted or non-encrypted devices.
255void RecordBootComplete() {
256 BootEventRecordStore boot_event_store;
James Hawkinsb9cf7712016-04-08 15:32:19 -0700257 BootEventRecordStore::BootEventRecord record;
James Hawkins2d8b3e62016-04-14 14:13:20 -0700258
James Hawkinse78ea772017-03-24 11:43:02 -0700259 auto uptime = std::chrono::duration_cast<std::chrono::seconds>(
260 android::base::boot_clock::now().time_since_epoch());
James Hawkins2d8b3e62016-04-14 14:13:20 -0700261 time_t current_time_utc = time(nullptr);
262
263 if (boot_event_store.GetBootEvent("last_boot_time_utc", &record)) {
264 time_t last_boot_time_utc = record.second;
265 time_t time_since_last_boot = difftime(current_time_utc,
266 last_boot_time_utc);
267 boot_event_store.AddBootEventWithValue("time_since_last_boot",
268 time_since_last_boot);
269 }
270
271 boot_event_store.AddBootEventWithValue("last_boot_time_utc", current_time_utc);
James Hawkinsc08e9962016-03-11 14:59:50 -0800272
James Hawkinsb9cf7712016-04-08 15:32:19 -0700273 // The boot_complete metric has two variants: boot_complete and
274 // ota_boot_complete. The latter signifies that the device is booting after
275 // a system update.
276 std::string boot_complete_prefix = CalculateBootCompletePrefix();
James Hawkins4dded612016-07-28 11:50:23 -0700277 if (boot_complete_prefix.empty()) {
278 // The system is hosed because the build date property could not be read.
279 return;
280 }
James Hawkinsc08e9962016-03-11 14:59:50 -0800281
282 // post_decrypt_time_elapsed is only logged on encrypted devices.
283 if (boot_event_store.GetBootEvent("post_decrypt_time_elapsed", &record)) {
284 // Log the amount of time elapsed until the device is decrypted, which
285 // includes the variable amount of time the user takes to enter the
286 // decryption password.
James Hawkinse78ea772017-03-24 11:43:02 -0700287 boot_event_store.AddBootEventWithValue("boot_decryption_complete", uptime.count());
James Hawkinsc08e9962016-03-11 14:59:50 -0800288
289 // Subtract the decryption time to normalize the boot cycle timing.
James Hawkinse78ea772017-03-24 11:43:02 -0700290 std::chrono::seconds boot_complete = std::chrono::seconds(uptime.count() - record.second);
James Hawkinsb9cf7712016-04-08 15:32:19 -0700291 boot_event_store.AddBootEventWithValue(boot_complete_prefix + "_post_decrypt",
James Hawkinse78ea772017-03-24 11:43:02 -0700292 boot_complete.count());
James Hawkinsc08e9962016-03-11 14:59:50 -0800293
294 } else {
James Hawkinse78ea772017-03-24 11:43:02 -0700295 boot_event_store.AddBootEventWithValue(boot_complete_prefix + "_no_encryption",
296 uptime.count());
James Hawkinsc08e9962016-03-11 14:59:50 -0800297 }
298
299 // Record the total time from device startup to boot complete, regardless of
300 // encryption state.
James Hawkinse78ea772017-03-24 11:43:02 -0700301 boot_event_store.AddBootEventWithValue(boot_complete_prefix, uptime.count());
James Hawkinsef0a0902017-01-06 14:38:23 -0800302
303 RecordInitBootTimeProp(&boot_event_store, "ro.boottime.init");
304 RecordInitBootTimeProp(&boot_event_store, "ro.boottime.init.selinux");
305 RecordInitBootTimeProp(&boot_event_store, "ro.boottime.init.cold_boot_wait");
James Hawkinsbe46fd12017-02-02 16:21:25 -0800306
307 RecordBootloaderTimings(&boot_event_store);
James Hawkinsc08e9962016-03-11 14:59:50 -0800308}
309
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800310// Records the boot_reason metric by querying the ro.boot.bootreason system
311// property.
312void RecordBootReason() {
313 int32_t boot_reason = BootReasonStrToEnum(GetProperty("ro.boot.bootreason"));
314 BootEventRecordStore boot_event_store;
315 boot_event_store.AddBootEventWithValue("boot_reason", boot_reason);
316}
317
James Hawkins500d7152016-02-16 15:05:54 -0800318// Records two metrics related to the user resetting a device: the time at
319// which the device is reset, and the time since the user last reset the
320// device. The former is only set once per-factory reset.
321void RecordFactoryReset() {
322 BootEventRecordStore boot_event_store;
323 BootEventRecordStore::BootEventRecord record;
324
325 time_t current_time_utc = time(nullptr);
326
James Hawkins0660b302016-03-08 16:18:15 -0800327 if (current_time_utc < 0) {
328 // UMA does not display negative values in buckets, so convert to positive.
James Hawkins9aec9262017-01-31 11:42:24 -0800329 android::metricslogger::LogHistogram(
James Hawkinsfff95ba2016-03-29 16:13:49 -0700330 "factory_reset_current_time_failure", std::abs(current_time_utc));
331
James Hawkins9aec9262017-01-31 11:42:24 -0800332 // Logging via BootEventRecordStore to see if using android::metricslogger::LogHistogram
James Hawkinsfff95ba2016-03-29 16:13:49 -0700333 // is losing records somehow.
334 boot_event_store.AddBootEventWithValue(
335 "factory_reset_current_time_failure", std::abs(current_time_utc));
James Hawkins0660b302016-03-08 16:18:15 -0800336 return;
337 } else {
James Hawkins9aec9262017-01-31 11:42:24 -0800338 android::metricslogger::LogHistogram("factory_reset_current_time", current_time_utc);
James Hawkinsfff95ba2016-03-29 16:13:49 -0700339
James Hawkins9aec9262017-01-31 11:42:24 -0800340 // Logging via BootEventRecordStore to see if using android::metricslogger::LogHistogram
James Hawkinsfff95ba2016-03-29 16:13:49 -0700341 // is losing records somehow.
342 boot_event_store.AddBootEventWithValue(
343 "factory_reset_current_time", current_time_utc);
James Hawkins0660b302016-03-08 16:18:15 -0800344 }
345
James Hawkins500d7152016-02-16 15:05:54 -0800346 // The factory_reset boot event does not exist after the device is reset, so
347 // use this signal to mark the time of the factory reset.
348 if (!boot_event_store.GetBootEvent("factory_reset", &record)) {
349 boot_event_store.AddBootEventWithValue("factory_reset", current_time_utc);
James Hawkins3bf9b142016-03-03 14:50:24 -0800350
351 // Don't log the time_since_factory_reset until some time has elapsed.
352 // The data is not meaningful yet and skews the histogram buckets.
James Hawkins500d7152016-02-16 15:05:54 -0800353 return;
354 }
355
356 // Calculate and record the difference in time between now and the
357 // factory_reset time.
358 time_t factory_reset_utc = record.second;
James Hawkins9aec9262017-01-31 11:42:24 -0800359 android::metricslogger::LogHistogram("factory_reset_record_value", factory_reset_utc);
James Hawkinsfff95ba2016-03-29 16:13:49 -0700360
James Hawkins9aec9262017-01-31 11:42:24 -0800361 // Logging via BootEventRecordStore to see if using android::metricslogger::LogHistogram
James Hawkinsfff95ba2016-03-29 16:13:49 -0700362 // is losing records somehow.
363 boot_event_store.AddBootEventWithValue(
364 "factory_reset_record_value", factory_reset_utc);
365
James Hawkins500d7152016-02-16 15:05:54 -0800366 time_t time_since_factory_reset = difftime(current_time_utc,
367 factory_reset_utc);
368 boot_event_store.AddBootEventWithValue("time_since_factory_reset",
369 time_since_factory_reset);
370}
371
James Hawkinsabd73e62016-01-19 15:10:38 -0800372} // namespace
373
374int main(int argc, char **argv) {
375 android::base::InitLogging(argv);
376
377 const std::string cmd_line = GetCommandLine(argc, argv);
378 LOG(INFO) << "Service started: " << cmd_line;
379
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800380 int option_index = 0;
James Hawkinsc6275582016-03-22 10:47:44 -0700381 static const char value_str[] = "value";
James Hawkinsc08e9962016-03-11 14:59:50 -0800382 static const char boot_complete_str[] = "record_boot_complete";
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800383 static const char boot_reason_str[] = "record_boot_reason";
James Hawkins53684ea2016-02-23 16:18:19 -0800384 static const char factory_reset_str[] = "record_time_since_factory_reset";
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800385 static const struct option long_options[] = {
386 { "help", no_argument, NULL, 'h' },
387 { "log", no_argument, NULL, 'l' },
388 { "print", no_argument, NULL, 'p' },
389 { "record", required_argument, NULL, 'r' },
James Hawkinsc6275582016-03-22 10:47:44 -0700390 { value_str, required_argument, NULL, 0 },
James Hawkinsc08e9962016-03-11 14:59:50 -0800391 { boot_complete_str, no_argument, NULL, 0 },
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800392 { boot_reason_str, no_argument, NULL, 0 },
James Hawkins500d7152016-02-16 15:05:54 -0800393 { factory_reset_str, no_argument, NULL, 0 },
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800394 { NULL, 0, NULL, 0 }
395 };
396
James Hawkinsc6275582016-03-22 10:47:44 -0700397 std::string boot_event;
398 std::string value;
James Hawkinsabd73e62016-01-19 15:10:38 -0800399 int opt = 0;
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800400 while ((opt = getopt_long(argc, argv, "hlpr:", long_options, &option_index)) != -1) {
James Hawkinsabd73e62016-01-19 15:10:38 -0800401 switch (opt) {
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800402 // This case handles long options which have no single-character mapping.
403 case 0: {
404 const std::string option_name = long_options[option_index].name;
James Hawkinsc6275582016-03-22 10:47:44 -0700405 if (option_name == value_str) {
406 // |optarg| is an external variable set by getopt representing
407 // the option argument.
408 value = optarg;
409 } else if (option_name == boot_complete_str) {
James Hawkinsc08e9962016-03-11 14:59:50 -0800410 RecordBootComplete();
411 } else if (option_name == boot_reason_str) {
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800412 RecordBootReason();
James Hawkins500d7152016-02-16 15:05:54 -0800413 } else if (option_name == factory_reset_str) {
414 RecordFactoryReset();
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800415 } else {
416 LOG(ERROR) << "Invalid option: " << option_name;
417 }
418 break;
419 }
420
James Hawkinsabd73e62016-01-19 15:10:38 -0800421 case 'h': {
422 ShowHelp(argv[0]);
423 break;
424 }
425
426 case 'l': {
427 LogBootEvents();
428 break;
429 }
430
431 case 'p': {
432 PrintBootEvents();
433 break;
434 }
435
436 case 'r': {
437 // |optarg| is an external variable set by getopt representing
438 // the option argument.
James Hawkinsc6275582016-03-22 10:47:44 -0700439 boot_event = optarg;
James Hawkinsabd73e62016-01-19 15:10:38 -0800440 break;
441 }
442
443 default: {
444 DCHECK_EQ(opt, '?');
445
446 // |optopt| is an external variable set by getopt representing
447 // the value of the invalid option.
448 LOG(ERROR) << "Invalid option: " << optopt;
449 ShowHelp(argv[0]);
450 return EXIT_FAILURE;
451 }
452 }
453 }
454
James Hawkinsc6275582016-03-22 10:47:44 -0700455 if (!boot_event.empty()) {
456 RecordBootEventFromCommandLine(boot_event, value);
457 }
458
James Hawkinsabd73e62016-01-19 15:10:38 -0800459 return 0;
460}