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

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

Issue 2162963002: [polymer] Merge of master into polymer10-migration (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Merge polymer10-migration int polymer10-merge Created 4 years, 5 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/base/color_scheme.html"> 8 <link rel="import" href="/tracing/base/color_scheme.html">
9 <link rel="import" href="/tracing/base/iteration_helpers.html"> 9 <link rel="import" href="/tracing/base/iteration_helpers.html">
10 <link rel="import" href="/tracing/extras/importer/linux_perf/android_parser.html "> 10 <link rel="import" href="/tracing/extras/importer/linux_perf/android_parser.html ">
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 }; 145 };
146 }; 146 };
147 TestExports.lineParserWithLegacyFmt = lineParserWithLegacyFmt; 147 TestExports.lineParserWithLegacyFmt = lineParserWithLegacyFmt;
148 148
149 // Matches the trace_event_clock_sync marker: 149 // Matches the trace_event_clock_sync marker:
150 // 0: trace_event_clock_sync: parent_ts=19581477508 150 // 0: trace_event_clock_sync: parent_ts=19581477508
151 var traceEventClockSyncRE = /trace_event_clock_sync: parent_ts=(\d+\.?\d*)/; 151 var traceEventClockSyncRE = /trace_event_clock_sync: parent_ts=(\d+\.?\d*)/;
152 TestExports.traceEventClockSyncRE = traceEventClockSyncRE; 152 TestExports.traceEventClockSyncRE = traceEventClockSyncRE;
153 153
154 var realTimeClockSyncRE = /trace_event_clock_sync: realtime_ts=(\d+)/; 154 var realTimeClockSyncRE = /trace_event_clock_sync: realtime_ts=(\d+)/;
155 var genericClockSyncRE = /trace_event_clock_sync: name=(\w+)/; 155 var genericClockSyncRE = /trace_event_clock_sync: name=([\w\-]+)/;
156 156
157 // Some kernel trace events are manually classified in slices and 157 // Some kernel trace events are manually classified in slices and
158 // hand-assigned a pseudo PID. 158 // hand-assigned a pseudo PID.
159 var pseudoKernelPID = 0; 159 var pseudoKernelPID = 0;
160 160
161 /** 161 /**
162 * Deduce the format of trace data. Linux kernels prior to 3.3 used one 162 * Deduce the format of trace data. Linux kernels prior to 3.3 used one
163 * format (by default); 3.4 and later used another. Additionally, newer 163 * format (by default); 3.4 and later used another. Additionally, newer
164 * kernels can optionally trace the TGID. 164 * kernels can optionally trace the TGID.
165 * 165 *
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 }, 722 },
723 723
724 /** 724 /**
725 * Processes a trace_event_clock_sync event. 725 * Processes a trace_event_clock_sync event.
726 */ 726 */
727 traceClockSyncEvent_: function(eventName, cpuNumber, pid, ts, eventBase) { 727 traceClockSyncEvent_: function(eventName, cpuNumber, pid, ts, eventBase) {
728 // Check to see if we have a normal clock sync marker that contains a 728 // Check to see if we have a normal clock sync marker that contains a
729 // sync ID and the current time according to the "ftrace global" clock. 729 // sync ID and the current time according to the "ftrace global" clock.
730 var event = /name=(\w+?)\s(.+)/.exec(eventBase.details); 730 var event = /name=(\w+?)\s(.+)/.exec(eventBase.details);
731 if (event) { 731 if (event) {
732 // TODO(alexandermont): This section of code seems to be broken. It
733 // creates an "args" variable, but doesn't seem to do anything with it.
732 var name = event[1]; 734 var name = event[1];
733 var pieces = event[2].split(' '); 735 var pieces = event[2].split(' ');
734 var args = { 736 var args = {
735 perfTs: ts 737 perfTs: ts
736 }; 738 };
737 for (var i = 0; i < pieces.length; i++) { 739 for (var i = 0; i < pieces.length; i++) {
738 var parts = pieces[i].split('='); 740 var parts = pieces[i].split('=');
739 if (parts.length != 2) 741 if (parts.length != 2)
740 throw new Error('omgbbq'); 742 throw new Error('omgbbq');
741 args[parts[0]] = parts[1]; 743 args[parts[0]] = parts[1];
742 } 744 }
743 745
744 this.model_.clockSyncManager.addClockSyncMarker( 746 this.model_.clockSyncManager.addClockSyncMarker(
745 tr.model.ClockDomainId.LINUX_FTRACE_GLOBAL, name, ts); 747 tr.model.ClockDomainId.LINUX_FTRACE_GLOBAL, name, ts);
746 return true; 748 return true;
747 } 749 }
748 750
751 // Check to see if we have a "new style" clock sync marker that contains
752 // only a sync ID.
753 var event = /name=([\w\-]+)/.exec(eventBase.details);
754 if (event) {
755 this.model_.clockSyncManager.addClockSyncMarker(
756 tr.model.ClockDomainId.LINUX_FTRACE_GLOBAL, event[1], ts);
757 return true;
758 }
759
749 // Check to see if we have a special clock sync marker that contains both 760 // Check to see if we have a special clock sync marker that contains both
750 // the current "ftrace global" time and the current CLOCK_MONOTONIC time. 761 // the current "ftrace global" time and the current CLOCK_MONOTONIC time.
751 event = /parent_ts=(\d+\.?\d*)/.exec(eventBase.details); 762 event = /parent_ts=(\d+\.?\d*)/.exec(eventBase.details);
752 if (!event) 763 if (!event)
753 return false; 764 return false;
754 765
755 var monotonicTs = event[1] * 1000; 766 var monotonicTs = event[1] * 1000;
756 // A monotonic timestamp of zero is used as a sentinel value to indicate 767 // A monotonic timestamp of zero is used as a sentinel value to indicate
757 // that CLOCK_MONOTONIC and the ftrace global clock are identical. 768 // that CLOCK_MONOTONIC and the ftrace global clock are identical.
758 if (monotonicTs === 0) 769 if (monotonicTs === 0)
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 }; 922 };
912 923
913 tr.importer.Importer.register(FTraceImporter); 924 tr.importer.Importer.register(FTraceImporter);
914 925
915 return { 926 return {
916 FTraceImporter: FTraceImporter, 927 FTraceImporter: FTraceImporter,
917 _FTraceImporterTestExports: TestExports 928 _FTraceImporterTestExports: TestExports
918 }; 929 };
919 }); 930 });
920 </script> 931 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/extras/importer/battor_importer_test.html ('k') | tracing/tracing/extras/tquery/tquery.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698