blob: a4cc5f22eafd050a58fc0583221fc19c97061229 [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 Hawkins0660b302016-03-08 16:18:15 -080024#include <cmath>
James Hawkinsabd73e62016-01-19 15:10:38 -080025#include <cstddef>
26#include <cstdio>
James Hawkins500d7152016-02-16 15:05:54 -080027#include <ctime>
James Hawkinsa4a1a4a2016-02-09 15:32:38 -080028#include <map>
James Hawkinsabd73e62016-01-19 15:10:38 -080029#include <memory>
30#include <string>
James Hawkinsbe46fd12017-02-02 16:21:25 -080031#include <vector>
Mark Salyzynff2dcd92016-09-28 15:54:45 -070032
33#include <android/log.h>
James Hawkinseabe08b2016-01-19 16:54:35 -080034#include <android-base/logging.h>
James Hawkins4dded612016-07-28 11:50:23 -070035#include <android-base/parseint.h>
James Hawkinsbe46fd12017-02-02 16:21:25 -080036#include <android-base/strings.h>
James Hawkinsa4a1a4a2016-02-09 15:32:38 -080037#include <cutils/properties.h>
James Hawkins9aec9262017-01-31 11:42:24 -080038#include <metricslogger/metrics_logger.h>
Mark Salyzynff2dcd92016-09-28 15:54:45 -070039
James Hawkinsabd73e62016-01-19 15:10:38 -080040#include "boot_event_record_store.h"
James Hawkinsc8ac0672017-02-14 19:20:20 +000041#include "uptime_parser.h"
James Hawkinsabd73e62016-01-19 15:10:38 -080042
43namespace {
44
James Hawkinsabd73e62016-01-19 15:10:38 -080045// Scans the boot event record store for record files and logs each boot event
46// via EventLog.
47void LogBootEvents() {
48 BootEventRecordStore boot_event_store;
49
50 auto events = boot_event_store.GetAllBootEvents();
51 for (auto i = events.cbegin(); i != events.cend(); ++i) {
James Hawkins9aec9262017-01-31 11:42:24 -080052 android::metricslogger::LogHistogram(i->first, i->second);
James Hawkinsabd73e62016-01-19 15:10:38 -080053 }
54}
55
James Hawkinsc6275582016-03-22 10:47:44 -070056// Records the named boot |event| to the record store. If |value| is non-empty
57// and is a proper string representation of an integer value, the converted
58// integer value is associated with the boot event.
59void RecordBootEventFromCommandLine(
60 const std::string& event, const std::string& value_str) {
61 BootEventRecordStore boot_event_store;
62 if (!value_str.empty()) {
63 int32_t value = 0;
Elliott Hughesda46b392016-10-11 17:09:00 -070064 if (android::base::ParseInt(value_str, &value)) {
James Hawkins4dded612016-07-28 11:50:23 -070065 boot_event_store.AddBootEventWithValue(event, value);
66 }
James Hawkinsc6275582016-03-22 10:47:44 -070067 } else {
68 boot_event_store.AddBootEvent(event);
69 }
70}
71
James Hawkinsabd73e62016-01-19 15:10:38 -080072void PrintBootEvents() {
73 printf("Boot events:\n");
74 printf("------------\n");
75
76 BootEventRecordStore boot_event_store;
77 auto events = boot_event_store.GetAllBootEvents();
78 for (auto i = events.cbegin(); i != events.cend(); ++i) {
79 printf("%s\t%d\n", i->first.c_str(), i->second);
80 }
81}
82
83void ShowHelp(const char *cmd) {
84 fprintf(stderr, "Usage: %s [options]\n", cmd);
85 fprintf(stderr,
86 "options include:\n"
James Hawkinsa4a1a4a2016-02-09 15:32:38 -080087 " -h, --help Show this help\n"
88 " -l, --log Log all metrics to logstorage\n"
89 " -p, --print Dump the boot event records to the console\n"
90 " -r, --record Record the timestamp of a named boot event\n"
James Hawkinsc6275582016-03-22 10:47:44 -070091 " --value Optional value to associate with the boot event\n"
James Hawkins53684ea2016-02-23 16:18:19 -080092 " --record_boot_reason Record the reason why the device booted\n"
93 " --record_time_since_factory_reset Record the time since the device was reset\n");
James Hawkinsabd73e62016-01-19 15:10:38 -080094}
95
96// Constructs a readable, printable string from the givencommand line
97// arguments.
98std::string GetCommandLine(int argc, char **argv) {
99 std::string cmd;
100 for (int i = 0; i < argc; ++i) {
101 cmd += argv[i];
102 cmd += " ";
103 }
104
105 return cmd;
106}
107
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800108// Convenience wrapper over the property API that returns an
109// std::string.
110std::string GetProperty(const char* key) {
111 std::vector<char> temp(PROPERTY_VALUE_MAX);
112 const int len = property_get(key, &temp[0], nullptr);
113 if (len < 0) {
114 return "";
115 }
116 return std::string(&temp[0], len);
117}
118
James Hawkins6f74c0b2016-02-12 15:49:16 -0800119constexpr int32_t kUnknownBootReason = 1;
120
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800121// A mapping from boot reason string, as read from the ro.boot.bootreason
122// system property, to a unique integer ID. Viewers of log data dashboards for
123// the boot_reason metric may refer to this mapping to discern the histogram
124// values.
James Hawkins6f74c0b2016-02-12 15:49:16 -0800125const std::map<std::string, int32_t> kBootReasonMap = {
126 {"unknown", kUnknownBootReason},
127 {"normal", 2},
128 {"recovery", 3},
129 {"reboot", 4},
130 {"PowerKey", 5},
131 {"hard_reset", 6},
132 {"kernel_panic", 7},
133 {"rpm_err", 8},
134 {"hw_reset", 9},
135 {"tz_err", 10},
136 {"adsp_err", 11},
137 {"modem_err", 12},
138 {"mba_err", 13},
139 {"Watchdog", 14},
140 {"Panic", 15},
141 {"power_key", 16},
142 {"power_on", 17},
143 {"Reboot", 18},
144 {"rtc", 19},
145 {"edl", 20},
James Hawkins45ead352016-03-08 16:42:07 -0800146 {"oem_pon1", 21},
147 {"oem_powerkey", 22},
148 {"oem_unknown_reset", 23},
149 {"srto: HWWDT reset SC", 24},
150 {"srto: HWWDT reset platform", 25},
151 {"srto: bootloader", 26},
152 {"srto: kernel panic", 27},
153 {"srto: kernel watchdog reset", 28},
154 {"srto: normal", 29},
155 {"srto: reboot", 30},
156 {"srto: reboot-bootloader", 31},
157 {"srto: security watchdog reset", 32},
158 {"srto: wakesrc", 33},
159 {"srto: watchdog", 34},
160 {"srto:1-1", 35},
161 {"srto:omap_hsmm", 36},
162 {"srto:phy0", 37},
163 {"srto:rtc0", 38},
164 {"srto:touchpad", 39},
165 {"watchdog", 40},
166 {"watchdogr", 41},
167 {"wdog_bark", 42},
168 {"wdog_bite", 43},
169 {"wdog_reset", 44},
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800170};
171
172// Converts a string value representing the reason the system booted to an
173// integer representation. This is necessary for logging the boot_reason metric
174// via Tron, which does not accept non-integer buckets in histograms.
175int32_t BootReasonStrToEnum(const std::string& boot_reason) {
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800176 auto mapping = kBootReasonMap.find(boot_reason);
177 if (mapping != kBootReasonMap.end()) {
178 return mapping->second;
179 }
180
181 LOG(INFO) << "Unknown boot reason: " << boot_reason;
182 return kUnknownBootReason;
183}
184
James Hawkinsb9cf7712016-04-08 15:32:19 -0700185// Returns the appropriate metric key prefix for the boot_complete metric such
186// that boot metrics after a system update are labeled as ota_boot_complete;
187// otherwise, they are labeled as boot_complete. This method encapsulates the
188// bookkeeping required to track when a system update has occurred by storing
189// the UTC timestamp of the system build date and comparing against the current
190// system build date.
191std::string CalculateBootCompletePrefix() {
192 static const std::string kBuildDateKey = "build_date";
193 std::string boot_complete_prefix = "boot_complete";
194
195 std::string build_date_str = GetProperty("ro.build.date.utc");
James Hawkins4dded612016-07-28 11:50:23 -0700196 int32_t build_date;
Elliott Hughesda46b392016-10-11 17:09:00 -0700197 if (!android::base::ParseInt(build_date_str, &build_date)) {
James Hawkins4dded612016-07-28 11:50:23 -0700198 return std::string();
199 }
James Hawkinsb9cf7712016-04-08 15:32:19 -0700200
201 BootEventRecordStore boot_event_store;
202 BootEventRecordStore::BootEventRecord record;
203 if (!boot_event_store.GetBootEvent(kBuildDateKey, &record) ||
204 build_date != record.second) {
205 boot_complete_prefix = "ota_" + boot_complete_prefix;
206 boot_event_store.AddBootEventWithValue(kBuildDateKey, build_date);
207 }
208
209 return boot_complete_prefix;
210}
211
James Hawkinsef0a0902017-01-06 14:38:23 -0800212// Records the value of a given ro.boottime.init property in milliseconds.
213void RecordInitBootTimeProp(
214 BootEventRecordStore* boot_event_store, const char* property) {
215 std::string value = GetProperty(property);
216
James Hawkins27c05222017-01-26 11:55:44 -0800217 int32_t time_in_ms;
218 if (android::base::ParseInt(value, &time_in_ms)) {
James Hawkinsef0a0902017-01-06 14:38:23 -0800219 boot_event_store->AddBootEventWithValue(property, time_in_ms);
220 }
221}
222
James Hawkinsbe46fd12017-02-02 16:21:25 -0800223// Parses and records the set of bootloader stages and associated boot times
224// from the ro.boot.boottime system property.
225void RecordBootloaderTimings(BootEventRecordStore* boot_event_store) {
226 // |ro.boot.boottime| is of the form 'stage1:time1,...,stageN:timeN'.
227 std::string value = GetProperty("ro.boot.boottime");
James Hawkins6b5c5aa2017-02-16 11:53:03 -0800228 if (value.empty()) {
229 // ro.boot.boottime is not reported on all devices.
230 return;
231 }
James Hawkinsbe46fd12017-02-02 16:21:25 -0800232
James Hawkins6b5c5aa2017-02-16 11:53:03 -0800233 int32_t total_time = 0;
James Hawkinsbe46fd12017-02-02 16:21:25 -0800234 auto stages = android::base::Split(value, ",");
235 for (auto const &stageTiming : stages) {
236 // |stageTiming| is of the form 'stage:time'.
237 auto stageTimingValues = android::base::Split(stageTiming, ":");
238 DCHECK_EQ(2, stageTimingValues.size());
239
240 std::string stageName = stageTimingValues[0];
241 int32_t time_ms;
242 if (android::base::ParseInt(stageTimingValues[1], &time_ms)) {
James Hawkins6b5c5aa2017-02-16 11:53:03 -0800243 total_time += time_ms;
James Hawkinsbe46fd12017-02-02 16:21:25 -0800244 boot_event_store->AddBootEventWithValue(
245 "boottime.bootloader." + stageName, time_ms);
246 }
247 }
James Hawkins6b5c5aa2017-02-16 11:53:03 -0800248
249 boot_event_store->AddBootEventWithValue("boottime.bootloader.total", total_time);
James Hawkinsbe46fd12017-02-02 16:21:25 -0800250}
251
James Hawkinsc08e9962016-03-11 14:59:50 -0800252// Records several metrics related to the time it takes to boot the device,
253// including disambiguating boot time on encrypted or non-encrypted devices.
254void RecordBootComplete() {
255 BootEventRecordStore boot_event_store;
James Hawkinsb9cf7712016-04-08 15:32:19 -0700256 BootEventRecordStore::BootEventRecord record;
James Hawkins2d8b3e62016-04-14 14:13:20 -0700257
James Hawkinsc8ac0672017-02-14 19:20:20 +0000258 time_t uptime = bootstat::ParseUptime();
James Hawkins2d8b3e62016-04-14 14:13:20 -0700259 time_t current_time_utc = time(nullptr);
260
261 if (boot_event_store.GetBootEvent("last_boot_time_utc", &record)) {
262 time_t last_boot_time_utc = record.second;
263 time_t time_since_last_boot = difftime(current_time_utc,
264 last_boot_time_utc);
265 boot_event_store.AddBootEventWithValue("time_since_last_boot",
266 time_since_last_boot);
267 }
268
269 boot_event_store.AddBootEventWithValue("last_boot_time_utc", current_time_utc);
James Hawkinsc08e9962016-03-11 14:59:50 -0800270
James Hawkinsb9cf7712016-04-08 15:32:19 -0700271 // The boot_complete metric has two variants: boot_complete and
272 // ota_boot_complete. The latter signifies that the device is booting after
273 // a system update.
274 std::string boot_complete_prefix = CalculateBootCompletePrefix();
James Hawkins4dded612016-07-28 11:50:23 -0700275 if (boot_complete_prefix.empty()) {
276 // The system is hosed because the build date property could not be read.
277 return;
278 }
James Hawkinsc08e9962016-03-11 14:59:50 -0800279
280 // post_decrypt_time_elapsed is only logged on encrypted devices.
281 if (boot_event_store.GetBootEvent("post_decrypt_time_elapsed", &record)) {
282 // Log the amount of time elapsed until the device is decrypted, which
283 // includes the variable amount of time the user takes to enter the
284 // decryption password.
James Hawkinsc8ac0672017-02-14 19:20:20 +0000285 boot_event_store.AddBootEventWithValue("boot_decryption_complete", uptime);
James Hawkinsc08e9962016-03-11 14:59:50 -0800286
287 // Subtract the decryption time to normalize the boot cycle timing.
James Hawkinsc8ac0672017-02-14 19:20:20 +0000288 time_t boot_complete = uptime - record.second;
James Hawkinsb9cf7712016-04-08 15:32:19 -0700289 boot_event_store.AddBootEventWithValue(boot_complete_prefix + "_post_decrypt",
James Hawkinsc8ac0672017-02-14 19:20:20 +0000290 boot_complete);
James Hawkinsc08e9962016-03-11 14:59:50 -0800291
292
293 } else {
James Hawkinsb9cf7712016-04-08 15:32:19 -0700294 boot_event_store.AddBootEventWithValue(boot_complete_prefix + "_no_encryption",
James Hawkinsc8ac0672017-02-14 19:20:20 +0000295 uptime);
James Hawkinsc08e9962016-03-11 14:59:50 -0800296 }
297
298 // Record the total time from device startup to boot complete, regardless of
299 // encryption state.
James Hawkinsc8ac0672017-02-14 19:20:20 +0000300 boot_event_store.AddBootEventWithValue(boot_complete_prefix, uptime);
James Hawkinsef0a0902017-01-06 14:38:23 -0800301
302 RecordInitBootTimeProp(&boot_event_store, "ro.boottime.init");
303 RecordInitBootTimeProp(&boot_event_store, "ro.boottime.init.selinux");
304 RecordInitBootTimeProp(&boot_event_store, "ro.boottime.init.cold_boot_wait");
James Hawkinsbe46fd12017-02-02 16:21:25 -0800305
306 RecordBootloaderTimings(&boot_event_store);
James Hawkinsc08e9962016-03-11 14:59:50 -0800307}
308
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800309// Records the boot_reason metric by querying the ro.boot.bootreason system
310// property.
311void RecordBootReason() {
312 int32_t boot_reason = BootReasonStrToEnum(GetProperty("ro.boot.bootreason"));
313 BootEventRecordStore boot_event_store;
314 boot_event_store.AddBootEventWithValue("boot_reason", boot_reason);
315}
316
James Hawkins500d7152016-02-16 15:05:54 -0800317// Records two metrics related to the user resetting a device: the time at
318// which the device is reset, and the time since the user last reset the
319// device. The former is only set once per-factory reset.
320void RecordFactoryReset() {
321 BootEventRecordStore boot_event_store;
322 BootEventRecordStore::BootEventRecord record;
323
324 time_t current_time_utc = time(nullptr);
325
James Hawkins0660b302016-03-08 16:18:15 -0800326 if (current_time_utc < 0) {
327 // UMA does not display negative values in buckets, so convert to positive.
James Hawkins9aec9262017-01-31 11:42:24 -0800328 android::metricslogger::LogHistogram(
James Hawkinsfff95ba2016-03-29 16:13:49 -0700329 "factory_reset_current_time_failure", std::abs(current_time_utc));
330
James Hawkins9aec9262017-01-31 11:42:24 -0800331 // Logging via BootEventRecordStore to see if using android::metricslogger::LogHistogram
James Hawkinsfff95ba2016-03-29 16:13:49 -0700332 // is losing records somehow.
333 boot_event_store.AddBootEventWithValue(
334 "factory_reset_current_time_failure", std::abs(current_time_utc));
James Hawkins0660b302016-03-08 16:18:15 -0800335 return;
336 } else {
James Hawkins9aec9262017-01-31 11:42:24 -0800337 android::metricslogger::LogHistogram("factory_reset_current_time", current_time_utc);
James Hawkinsfff95ba2016-03-29 16:13:49 -0700338
James Hawkins9aec9262017-01-31 11:42:24 -0800339 // Logging via BootEventRecordStore to see if using android::metricslogger::LogHistogram
James Hawkinsfff95ba2016-03-29 16:13:49 -0700340 // is losing records somehow.
341 boot_event_store.AddBootEventWithValue(
342 "factory_reset_current_time", current_time_utc);
James Hawkins0660b302016-03-08 16:18:15 -0800343 }
344
James Hawkins500d7152016-02-16 15:05:54 -0800345 // The factory_reset boot event does not exist after the device is reset, so
346 // use this signal to mark the time of the factory reset.
347 if (!boot_event_store.GetBootEvent("factory_reset", &record)) {
348 boot_event_store.AddBootEventWithValue("factory_reset", current_time_utc);
James Hawkins3bf9b142016-03-03 14:50:24 -0800349
350 // Don't log the time_since_factory_reset until some time has elapsed.
351 // The data is not meaningful yet and skews the histogram buckets.
James Hawkins500d7152016-02-16 15:05:54 -0800352 return;
353 }
354
355 // Calculate and record the difference in time between now and the
356 // factory_reset time.
357 time_t factory_reset_utc = record.second;
James Hawkins9aec9262017-01-31 11:42:24 -0800358 android::metricslogger::LogHistogram("factory_reset_record_value", factory_reset_utc);
James Hawkinsfff95ba2016-03-29 16:13:49 -0700359
James Hawkins9aec9262017-01-31 11:42:24 -0800360 // Logging via BootEventRecordStore to see if using android::metricslogger::LogHistogram
James Hawkinsfff95ba2016-03-29 16:13:49 -0700361 // is losing records somehow.
362 boot_event_store.AddBootEventWithValue(
363 "factory_reset_record_value", factory_reset_utc);
364
James Hawkins500d7152016-02-16 15:05:54 -0800365 time_t time_since_factory_reset = difftime(current_time_utc,
366 factory_reset_utc);
367 boot_event_store.AddBootEventWithValue("time_since_factory_reset",
368 time_since_factory_reset);
369}
370
James Hawkinsabd73e62016-01-19 15:10:38 -0800371} // namespace
372
373int main(int argc, char **argv) {
374 android::base::InitLogging(argv);
375
376 const std::string cmd_line = GetCommandLine(argc, argv);
377 LOG(INFO) << "Service started: " << cmd_line;
378
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800379 int option_index = 0;
James Hawkinsc6275582016-03-22 10:47:44 -0700380 static const char value_str[] = "value";
James Hawkinsc08e9962016-03-11 14:59:50 -0800381 static const char boot_complete_str[] = "record_boot_complete";
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800382 static const char boot_reason_str[] = "record_boot_reason";
James Hawkins53684ea2016-02-23 16:18:19 -0800383 static const char factory_reset_str[] = "record_time_since_factory_reset";
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800384 static const struct option long_options[] = {
385 { "help", no_argument, NULL, 'h' },
386 { "log", no_argument, NULL, 'l' },
387 { "print", no_argument, NULL, 'p' },
388 { "record", required_argument, NULL, 'r' },
James Hawkinsc6275582016-03-22 10:47:44 -0700389 { value_str, required_argument, NULL, 0 },
James Hawkinsc08e9962016-03-11 14:59:50 -0800390 { boot_complete_str, no_argument, NULL, 0 },
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800391 { boot_reason_str, no_argument, NULL, 0 },
James Hawkins500d7152016-02-16 15:05:54 -0800392 { factory_reset_str, no_argument, NULL, 0 },
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800393 { NULL, 0, NULL, 0 }
394 };
395
James Hawkinsc6275582016-03-22 10:47:44 -0700396 std::string boot_event;
397 std::string value;
James Hawkinsabd73e62016-01-19 15:10:38 -0800398 int opt = 0;
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800399 while ((opt = getopt_long(argc, argv, "hlpr:", long_options, &option_index)) != -1) {
James Hawkinsabd73e62016-01-19 15:10:38 -0800400 switch (opt) {
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800401 // This case handles long options which have no single-character mapping.
402 case 0: {
403 const std::string option_name = long_options[option_index].name;
James Hawkinsc6275582016-03-22 10:47:44 -0700404 if (option_name == value_str) {
405 // |optarg| is an external variable set by getopt representing
406 // the option argument.
407 value = optarg;
408 } else if (option_name == boot_complete_str) {
James Hawkinsc08e9962016-03-11 14:59:50 -0800409 RecordBootComplete();
410 } else if (option_name == boot_reason_str) {
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800411 RecordBootReason();
James Hawkins500d7152016-02-16 15:05:54 -0800412 } else if (option_name == factory_reset_str) {
413 RecordFactoryReset();
James Hawkinsa4a1a4a2016-02-09 15:32:38 -0800414 } else {
415 LOG(ERROR) << "Invalid option: " << option_name;
416 }
417 break;
418 }
419
James Hawkinsabd73e62016-01-19 15:10:38 -0800420 case 'h': {
421 ShowHelp(argv[0]);
422 break;
423 }
424
425 case 'l': {
426 LogBootEvents();
427 break;
428 }
429
430 case 'p': {
431 PrintBootEvents();
432 break;
433 }
434
435 case 'r': {
436 // |optarg| is an external variable set by getopt representing
437 // the option argument.
James Hawkinsc6275582016-03-22 10:47:44 -0700438 boot_event = optarg;
James Hawkinsabd73e62016-01-19 15:10:38 -0800439 break;
440 }
441
442 default: {
443 DCHECK_EQ(opt, '?');
444
445 // |optopt| is an external variable set by getopt representing
446 // the value of the invalid option.
447 LOG(ERROR) << "Invalid option: " << optopt;
448 ShowHelp(argv[0]);
449 return EXIT_FAILURE;
450 }
451 }
452 }
453
James Hawkinsc6275582016-03-22 10:47:44 -0700454 if (!boot_event.empty()) {
455 RecordBootEventFromCommandLine(boot_event, value);
456 }
457
James Hawkinsabd73e62016-01-19 15:10:38 -0800458 return 0;
459}