diff options
author | Cheng-Yi Chiang <cychiang@chromium.org> | 2016-01-06 19:16:55 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-01-08 05:04:45 -0800 |
commit | 3a99777f1c8302b5f3819b5ef177699e6d829a9e (patch) | |
tree | 87c82d8a3ab472ec15497a9bfba70649406ee648 /scripts | |
parent | 6f68120eb5af25770abc0d9cf7a578e2806a37ec (diff) | |
download | adhd-3a99777f1c8302b5f3819b5ef177699e6d829a9e.tar.gz |
script: audio_thread_log_viewer: Support audio_diagnostics result
Use === aplay -l === line in audio_diagnostics log to extract the event logs.
BUG=None
TEST=run viewer_c3.py on a log file generated from audio_diagnostics.
Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
Change-Id: I64d724befee47c8be73bc1c5aca6154a85ca30a0
Reviewed-on: https://chromium-review.googlesource.com/320670
Reviewed-by: Chinyue Chen <chinyue@chromium.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/audio_thread_log_viewer/viewer_c3.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/audio_thread_log_viewer/viewer_c3.py b/scripts/audio_thread_log_viewer/viewer_c3.py index 02102898..e000f390 100755 --- a/scripts/audio_thread_log_viewer/viewer_c3.py +++ b/scripts/audio_thread_log_viewer/viewer_c3.py @@ -430,8 +430,16 @@ class AudioThreadLogParser(object): self.content = f.read().splitlines() # Event logs starting at two lines after 'Audio Thread Event Log'. - index = self.content.index('Audio Thread Event Log:') - event_logs = self.content[(index + 2):] + index_start = self.content.index('Audio Thread Event Log:') + 2 + # If input is from audio_diagnostic result, use aplay -l line to find + # the end of audio thread event logs. + try: + index_end = self.content.index('=== aplay -l ===') + except ValueError: + logging.debug( + 'Can not find aplay line. This is not from diagnostic') + index_end = len(self.content) + event_logs = self.content[index_start:index_end] logging.info('Parsed %s log events', len(event_logs)) return event_logs |