diff options
author | Jyoti Bhayana <jbhayana@google.com> | 2020-06-10 16:12:57 -0700 |
---|---|---|
committer | Jyoti Bhayana <jbhayana@google.com> | 2020-06-11 09:05:21 -0700 |
commit | 9f0e7264b2c7cd7f20c7ce559e1692b93c67a430 (patch) | |
tree | 9bdde6355d276697a5c4501567f0dd8cdb8f04cc | |
parent | 756a972f99ed337c3a5b4735969596708861cf64 (diff) | |
download | extras-9f0e7264b2c7cd7f20c7ce559e1692b93c67a430.tar.gz |
Fixing bug in bootanalyze when the event time is 0
Bug:158702468
Test: Run bootanalyze and see there is no error when the
event time is 0
Change-Id: If3efa4c33a70cf6168a777f0f442fe1557b600b4
-rwxr-xr-x | boottime_tools/bootanalyze/bootanalyze.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/boottime_tools/bootanalyze/bootanalyze.py b/boottime_tools/bootanalyze/bootanalyze.py index 095f8995..ef5c5273 100755 --- a/boottime_tools/bootanalyze/bootanalyze.py +++ b/boottime_tools/bootanalyze/bootanalyze.py @@ -357,7 +357,7 @@ def iterate(args, search_events_pattern, timings_pattern, shutdown_events_patter v = v + time_correction_delta debug("correcting event to event[{0}, {1}]".format(k, v)) - if not logcat_event_time.get(KERNEL_TIME_KEY): + if logcat_event_time.get(KERNEL_TIME_KEY) is None: print "kernel time not captured in logcat, cannot get time diff" return None, None, None, None, None, None diffs = [] @@ -597,7 +597,7 @@ def collect_logcat_for_shutdown(capture_log_on_error, shutdown_events_pattern,\ if not event: continue time = extract_a_time(line, TIME_LOGCAT, float) - if not time: + if time is None: print "cannot get time from: " + line continue if shutdown_start_time == 0: @@ -740,7 +740,7 @@ def extract_time(events, pattern, date_transform_function): result = collections.OrderedDict() for event, data in events.iteritems(): time = extract_a_time(data, pattern, date_transform_function) - if time: + if time is not None: result[event] = time else: print "Failed to find time for event: ", event, data |