Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: tracing/tracing/extras/importer/linux_perf/ftrace_importer.html

Issue 1319013002: Android event log importer. (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: Removed console.log Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <!-- 2 <!--
3 Copyright (c) 2012 The Chromium Authors. All rights reserved. 3 Copyright (c) 2012 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be 4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file. 5 found in the LICENSE file.
6 --> 6 -->
7 7
8 <link rel="import" href="/tracing/ui/base/color_scheme.html"> 8 <link rel="import" href="/tracing/ui/base/color_scheme.html">
9 <link rel="import" href="/tracing/extras/importer/linux_perf/bus_parser.html"> 9 <link rel="import" href="/tracing/extras/importer/linux_perf/bus_parser.html">
10 <link rel="import" href="/tracing/extras/importer/linux_perf/clock_parser.html"> 10 <link rel="import" href="/tracing/extras/importer/linux_perf/clock_parser.html">
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 details: groups[6] 140 details: groups[6]
141 }; 141 };
142 }; 142 };
143 TestExports.lineParserWithLegacyFmt = lineParserWithLegacyFmt; 143 TestExports.lineParserWithLegacyFmt = lineParserWithLegacyFmt;
144 144
145 // Matches the trace_event_clock_sync record 145 // Matches the trace_event_clock_sync record
146 // 0: trace_event_clock_sync: parent_ts=19581477508 146 // 0: trace_event_clock_sync: parent_ts=19581477508
147 var traceEventClockSyncRE = /trace_event_clock_sync: parent_ts=(\d+\.?\d*)/; 147 var traceEventClockSyncRE = /trace_event_clock_sync: parent_ts=(\d+\.?\d*)/;
148 TestExports.traceEventClockSyncRE = traceEventClockSyncRE; 148 TestExports.traceEventClockSyncRE = traceEventClockSyncRE;
149 149
150 var realTimeClockSyncRE = /trace_event_clock_sync: realtime_ts=(\d+)/;
150 var genericClockSyncRE = /trace_event_clock_sync: name=(\w+)/; 151 var genericClockSyncRE = /trace_event_clock_sync: name=(\w+)/;
151 152
152 // Some kernel trace events are manually classified in slices and 153 // Some kernel trace events are manually classified in slices and
153 // hand-assigned a pseudo PID. 154 // hand-assigned a pseudo PID.
154 var pseudoKernelPID = 0; 155 var pseudoKernelPID = 0;
155 156
156 /** 157 /**
157 * Deduce the format of trace data. Linux kernels prior to 3.3 used one 158 * Deduce the format of trace data. Linux kernels prior to 3.3 used one
158 * format (by default); 3.4 and later used another. Additionally, newer 159 * format (by default); 3.4 and later used another. Additionally, newer
159 * kernels can optionally trace the TGID. 160 * kernels can optionally trace the TGID.
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 /** 744 /**
744 * Populates model clockSyncRecords with found clock sync markers. 745 * Populates model clockSyncRecords with found clock sync markers.
745 */ 746 */
746 importClockSyncRecords: function() { 747 importClockSyncRecords: function() {
747 this.forEachLine(function(text, eventBase, cpuNumber, pid, ts) { 748 this.forEachLine(function(text, eventBase, cpuNumber, pid, ts) {
748 var eventName = eventBase.eventName; 749 var eventName = eventBase.eventName;
749 if (eventName !== 'tracing_mark_write' && eventName !== '0') 750 if (eventName !== 'tracing_mark_write' && eventName !== '0')
750 return; 751 return;
751 if (traceEventClockSyncRE.exec(eventBase.details)) 752 if (traceEventClockSyncRE.exec(eventBase.details))
752 this.traceClockSyncEvent(eventName, cpuNumber, pid, ts, eventBase); 753 this.traceClockSyncEvent(eventName, cpuNumber, pid, ts, eventBase);
754 if (realTimeClockSyncRE.exec(eventBase.details)) {
755 // This entry maps realtime to clock_monotonic; store in the model
756 // so that importers parsing files with realtime timestamps can
757 // map this back to monotonic.
758 var match = realTimeClockSyncRE.exec(eventBase.details);
759 this.model_.realtime_to_monotonic_offset_ms = ts - match[1];
760 }
753 if (genericClockSyncRE.exec(eventBase.details)) 761 if (genericClockSyncRE.exec(eventBase.details))
754 this.traceClockSyncEvent(eventName, cpuNumber, pid, ts, eventBase); 762 this.traceClockSyncEvent(eventName, cpuNumber, pid, ts, eventBase);
755 }.bind(this)); 763 }.bind(this));
756 }, 764 },
757 addClockSyncRecord: function(csr) { 765 addClockSyncRecord: function(csr) {
758 this.newlyAddedClockSyncRecords_.push(csr); 766 this.newlyAddedClockSyncRecords_.push(csr);
759 this.model_.clockSyncRecords.push(csr); 767 this.model_.clockSyncRecords.push(csr);
760 }, 768 },
761 769
762 shiftNewlyAddedClockSyncRecords: function(timeShift) { 770 shiftNewlyAddedClockSyncRecords: function(timeShift) {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 }; 856 };
849 857
850 tr.importer.Importer.register(LinuxPerfImporter); 858 tr.importer.Importer.register(LinuxPerfImporter);
851 859
852 return { 860 return {
853 LinuxPerfImporter: LinuxPerfImporter, 861 LinuxPerfImporter: LinuxPerfImporter,
854 _LinuxPerfImporterTestExports: TestExports 862 _LinuxPerfImporterTestExports: TestExports
855 }; 863 };
856 }); 864 });
857 </script> 865 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/extras/importer/android/event_log_importer.html ('k') | tracing/tracing/extras/systrace_config.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698