Lines Matching refs:tracing
1 window.FLATTENED={};window.FLATTENED_RAW_SCRIPTS={};window.FLATTENED.base=!0;window.FLATTENED["tracing.color_scheme"]=!0;window.FLATTENED["tracing.importer.linux_perf.parser"]=!0;window.FLATTENED["base.guid"]=!0;window.FLATTENED["tracing.trace_model.counter_series"]=!0;window.FLATTENED["tracing.importer.linux_perf.android_parser"]=!0;window.FLATTENED["tracing.importer.linux_perf.bus_parser"]=!0;window.FLATTENED["tracing.importer.linux_perf.clock_parser"]=!0;
2 window.FLATTENED["tracing.importer.linux_perf.cpufreq_parser"]=!0;window.FLATTENED["tracing.importer.linux_perf.disk_parser"]=!0;window.FLATTENED["tracing.importer.linux_perf.drm_parser"]=!0;window.FLATTENED["tracing.importer.linux_perf.exynos_parser"]=!0;window.FLATTENED["tracing.importer.linux_perf.gesture_parser"]=!0;window.FLATTENED["tracing.importer.linux_perf.i915_parser"]=!0;window.FLATTENED["tracing.importer.linux_perf.kfunc_parser"]=!0;
3 window.FLATTENED["tracing.importer.linux_perf.mali_parser"]=!0;window.FLATTENED["tracing.importer.linux_perf.power_parser"]=!0;window.FLATTENED["tracing.importer.linux_perf.sched_parser"]=!0;window.FLATTENED["tracing.importer.linux_perf.sync_parser"]=!0;window.FLATTENED["tracing.importer.linux_perf.workqueue_parser"]=!0;window.FLATTENED["base.event_target"]=!0;window.FLATTENED["base.events"]=!0;window.FLATTENED["base.range"]=!0;window.FLATTENED["tracing.filter"]=!0;
4 window.FLATTENED["tracing.trace_model.counter"]=!0;window.FLATTENED["tracing.trace_model.trace_model_event"]=!0;window.FLATTENED["tracing.trace_model.slice"]=!0;window.FLATTENED["tracing.trace_model.cpu"]=!0;window.FLATTENED["base.sorted_array_utils"]=!0;window.FLATTENED["base.iteration_helpers"]=!0;window.FLATTENED["base.utils"]=!0;window.FLATTENED["tracing.trace_model.object_snapshot"]=!0;window.FLATTENED["tracing.trace_model.object_instance"]=!0;
5 window.FLATTENED["tracing.trace_model.time_to_object_instance_map"]=!0;window.FLATTENED["tracing.trace_model.object_collection"]=!0;window.FLATTENED["tracing.trace_model.async_slice"]=!0;window.FLATTENED["tracing.trace_model.async_slice_group"]=!0;window.FLATTENED["tracing.trace_model.sample"]=!0;window.FLATTENED["tracing.trace_model.slice_group"]=!0;window.FLATTENED["tracing.trace_model.thread"]=!0;window.FLATTENED["base.settings"]=!0;window.FLATTENED["tracing.trace_model_settings"]=!0;
6 window.FLATTENED["tracing.trace_model.process_base"]=!0;window.FLATTENED["tracing.trace_model.kernel"]=!0;window.FLATTENED["tracing.trace_model.process"]=!0;window.FLATTENED["tracing.trace_model"]=!0;window.FLATTENED["tracing.importer.linux_perf_importer"]=!0;window.FLATTENED_RAW_SCRIPTS["../third_party/gl-matrix/src/gl-matrix/common.js"]=!0;window.FLATTENED_RAW_SCRIPTS["../third_party/gl-matrix/src/gl-matrix/mat2d.js"]=!0;
7 window.FLATTENED_RAW_SCRIPTS["../third_party/gl-matrix/src/gl-matrix/mat4.js"]=!0;window.FLATTENED_RAW_SCRIPTS["../third_party/gl-matrix/src/gl-matrix/vec2.js"]=!0;window.FLATTENED_RAW_SCRIPTS["../third_party/gl-matrix/src/gl-matrix/vec3.js"]=!0;window.FLATTENED_RAW_SCRIPTS["../third_party/gl-matrix/src/gl-matrix/vec4.js"]=!0;window.FLATTENED["base.gl_matrix"]=!0;window.FLATTENED["base.quad"]=!0;window.FLATTENED["tracing.trace_model.instant_event"]=!0;
8 window.FLATTENED["tracing.importer.trace_event_importer"]=!0;window.FLATTENED["tracing.importer.v8.splaytree"]=!0;window.FLATTENED["tracing.importer.v8.codemap"]=!0;window.FLATTENED["tracing.importer.v8.log_reader"]=!0;window.FLATTENED["tracing.importer.v8_log_importer"]=!0;window.FLATTENED["tracing.importer"]=!0;window.FLATTENED["tracing.analysis.util"]=!0;window.FLATTENED["tracing.selection"]=!0;window.FLATTENED.ui=!0;window.FLATTENED["tracing.analysis.analysis_link"]=!0;
9 window.FLATTENED["tracing.analysis.generic_object_view"]=!0;window.FLATTENED["tracing.analysis.analysis_results"]=!0;window.FLATTENED["tracing.analysis.analyze_counters"]=!0;window.FLATTENED["tracing.analysis.analyze_slices"]=!0;window.FLATTENED["tracing.analysis.analyze_selection"]=!0;window.FLATTENED["tracing.analysis.object_instance_view"]=!0;window.FLATTENED["tracing.analysis.object_snapshot_view"]=!0;window.FLATTENED["tracing.analysis.default_object_view"]=!0;
10 window.FLATTENED["tracing.analysis.slice_view"]=!0;window.FLATTENED["tracing.analysis.analysis_view"]=!0;window.FLATTENED["base.properties"]=!0;window.FLATTENED["ui.overlay"]=!0;window.FLATTENED["tracing.category_filter_dialog"]=!0;window.FLATTENED["tracing.mouse_mode_constants"]=!0;window.FLATTENED["tracing.timeline_viewport"]=!0;window.FLATTENED["base.raf"]=!0;window.FLATTENED["ui.container_that_decorates_its_children"]=!0;window.FLATTENED["tracing.tracks.track"]=!0;
11 window.FLATTENED["tracing.tracks.drawing_container"]=!0;window.FLATTENED["tracing.constants"]=!0;window.FLATTENED["tracing.tracks.heading_track"]=!0;window.FLATTENED["tracing.tracks.ruler_track"]=!0;window.FLATTENED["base.measuring_stick"]=!0;window.FLATTENED["tracing.tracks.container_track"]=!0;window.FLATTENED["tracing.fast_rect_renderer"]=!0;window.FLATTENED["tracing.tracks.slice_track"]=!0;window.FLATTENED["tracing.tracks.cpu_track"]=!0;
12 window.FLATTENED["tracing.tracks.object_instance_track"]=!0;window.FLATTENED["tcmalloc.heap_instance_track"]=!0;window.FLATTENED["tracing.tracks.counter_track"]=!0;window.FLATTENED["tracing.tracks.spacing_track"]=!0;window.FLATTENED["tracing.tracks.slice_group_track"]=!0;window.FLATTENED["tracing.tracks.async_slice_group_track"]=!0;window.FLATTENED["tracing.tracks.thread_track"]=!0;window.FLATTENED["ui.dom_helpers"]=!0;window.FLATTENED["tracing.tracks.process_track_base"]=!0;
13 window.FLATTENED["tracing.tracks.kernel_track"]=!0;window.FLATTENED["tracing.tracks.process_track"]=!0;window.FLATTENED["tracing.tracks.trace_model_track"]=!0;window.FLATTENED["ui.mouse_mode_selector"]=!0;window.FLATTENED["tracing.timeline_track_view"]=!0;window.FLATTENED["tracing.find_control"]=!0;window.FLATTENED["ui.drag_handle"]=!0;window.FLATTENED["tracing.timeline_view"]=!0;window.FLATTENED["tracing.standalone_timeline_view"]=!0;
24 base.exportTo("tracing",function(){function d(a){for(var c=0,e=0;e<a.length;++e)c=(c+37*c+11*a.charCodeAt(e))%4294967295;return c}var b=[{r:138,g:113,b:152},{r:175,g:112,b:133},{r:127,g:135,b:225},{r:93,g:81,b:137},{r:116,g:143,b:119},{r:178,g:214,b:122},{r:87,g:109,b:147},{r:119,g:155,b:95},{r:114,g:180,b:160},{r:132,g:85,b:103},{r:157,g:210,b:150},{r:148,g:94,b:86},{r:164,g:108,b:138},{r:139,g:191,b:150},{r:110,g:99,b:145},{r:80,g:129,b:109},{r:125,g:140,b:149},{r:93,g:124,b:132},{r:140,g:85,b:140},
27 base.exportTo("tracing.importer.linux_perf",function(){function d(a){this.importer=a;this.model=a.model}var b=[];d.registerSubtype=function(a){b.push(a)};d.getSubtypeConstructors=function(){return b};d.prototype={__proto__:Object.prototype};return{Parser:d}});"use strict";base.exportTo("base",function(){var d=1;return{GUID:{allocate:function(){return d++}}}});"use strict";base.require("base.guid");
28 base.exportTo("tracing.trace_model",function(){function d(a,c){this.guid_=base.GUID.allocate();this.timestamp_=a;this.value_=c}function b(a,c){this.guid_=base.GUID.allocate();this.name_=a;this.color_=c;this.timestamps_=[];this.samples_=[]}d.prototype={__proto__:Object.prototype,get value(){return this.value_},set timestamp(a){this.timestamp_=a},toJSON:function(){for(var a={},c=Object.keys(this),e=0;e<c.length;e++){var b=c[e];"function"!=typeof this[b]&&(a[b]="parent"==b?this[b].guid:this[b])}return a}};
31 "use strict";base.require("tracing.importer.linux_perf.parser");base.require("tracing.trace_model.counter_series");
32 base.exportTo("tracing.importer.linux_perf",function(){function d(c){a.call(this,c);c.registerEventHandler("tracing_mark_write:android",d.prototype.traceMarkWriteAndroidEvent.bind(this));c.registerEventHandler("0:android",d.prototype.traceMarkWriteAndroidEvent.bind(this));this.model_=c.model_;this.ppids_={}}function b(a){var e={};if(a){a=a.split(";");for(var b=0;b<a.length;++b){var g=a[b].split("=");g[0]&&(e[g.shift()]=g.join("="))}}return e}var a=tracing.importer.linux_perf.Parser;d.prototype={__proto__:a.prototype,
33 openAsyncSlice:function(a,e,b,g,h){e=new tracing.trace_model.AsyncSlice(e,b,tracing.getStringColorId(b),h);e.id=g;e.startThread=a;this.openAsyncSlices||(this.openAsyncSlices={});this.openAsyncSlices[b+":"+g]=e},closeAsyncSlice:function(a,e,b,g){this.openAsyncSlices&&(e=e+":"+b,b=this.openAsyncSlices[e])&&(b.endThread=a,b.duration=g-b.start,b.startThread.asyncSliceGroup.push(b),b.subSlices=[new tracing.trace_model.Slice(b.category,b.title,b.colorId,b.start,b.args,b.duration)],delete this.openAsyncSlices[e])},
35 f=m.sliceGroup.endSlice(g);h=b(a[3]);for(d in h)void 0!==f.args[d]&&this.model_.importErrors.push("Both the B and E events of "+f.title+"provided values for argument "+d+". The value of the E event will be used."),f.args[d]=h[d];break;case "C":e=parseInt(a[1]);var l=a[2],n=parseInt(a[3]),d=a[4];f=this.model_.getOrCreateProcess(e).getOrCreateCounter(d,l);0===f.numSeries&&f.addSeries(new tracing.trace_model.CounterSeries(n,tracing.getStringColorId(f.name+".value")));f.series.forEach(function(a){a.addSample(g,
36 n)});break;case "S":e=parseInt(a[1]);l=a[2];a=parseInt(a[3]);m=this.model_.getOrCreateProcess(e).getOrCreateThread(f);m.name=h.threadName;this.ppids_[f]=e;this.openAsyncSlice(m,null,l,a,g);break;case "F":e=this.ppids_[f];if(void 0===e)break;m=this.model_.getOrCreateProcess(e).getOrCreateThread(f);l=a[2];a=parseInt(a[3]);this.closeAsyncSlice(m,l,a,g);break;default:return!1}return!0}};a.registerSubtype(d);return{AndroidParser:d}});"use strict";base.require("tracing.importer.linux_perf.parser");base.require("tracing.trace_model.counter_series");
37 base.exportTo("tracing.importer.linux_perf",function(){function d(a){b.call(this,a);a.registerEventHandler("memory_bus_usage",d.prototype.traceMarkWriteBusEvent.bind(this));this.model_=a.model_;this.ppids_={}}var b=tracing.importer.linux_perf.Parser;d.prototype={__proto__:b.prototype,traceMarkWriteBusEvent:function(a,c,e,b,g,h){e=/bus=(\S+) rw_bytes=(\d+) r_bytes=(\d+) w_bytes=(\d+) cycles=(\d+) ns=(\d+)/.exec(g.details);a=e[1];parseInt(e[2]);c=parseInt(e[3]);parseInt(e[4]);parseInt(e[5]);e=parseInt(e[6]);
38 var d=1E9*c/e,d=d/1048576;c=this.model_.getOrCreateProcess(0).getOrCreateCounter(null,"bus "+a+" read");0===c.numSeries&&c.addSeries(new tracing.trace_model.CounterSeries("value",tracing.getStringColorId(c.name+".value")));c.series.forEach(function(a){a.addSample(b,d)});c=this.model_.getOrCreateProcess(0).getOrCreateCounter(null,"bus "+a+" write");0===c.numSeries&&c.addSeries(new tracing.trace_model.CounterSeries("value",tracing.getStringColorId(c.name+".value")));c.series.forEach(function(a){a.addSample(b,
39 d)});return!0}};b.registerSubtype(d);return{BusParser:d}});"use strict";base.require("tracing.importer.linux_perf.parser");base.require("tracing.trace_model.counter_series");
40 base.exportTo("tracing.importer.linux_perf",function(){function d(a){b.call(this,a);a.registerEventHandler("clock_set_rate",d.prototype.traceMarkWriteClockEvent.bind(this));this.model_=a.model_;this.ppids_={}}var b=tracing.importer.linux_perf.Parser;d.prototype={__proto__:b.prototype,traceMarkWriteClockEvent:function(a,c,e,b,g,h){a=/(\S+) state=(\d+) cpu_id=(\d+)/.exec(g.details);c=a[1];var d=parseInt(a[2]);a=this.model_.getOrCreateProcess(0).getOrCreateCounter(null,c);0===a.numSeries&&a.addSeries(new tracing.trace_model.CounterSeries("value",
41 tracing.getStringColorId(a.name+".value")));a.series.forEach(function(a){a.addSample(b,d)});return!0}};b.registerSubtype(d);return{ClockParser:d}});"use strict";base.require("tracing.importer.linux_perf.parser");
42 base.exportTo("tracing.importer.linux_perf",function(){function d(c){a.call(this,c);c.registerEventHandler("cpufreq_interactive_up",d.prototype.cpufreqUpDownEvent.bind(this));c.registerEventHandler("cpufreq_interactive_down",d.prototype.cpufreqUpDownEvent.bind(this));c.registerEventHandler("cpufreq_interactive_already",d.prototype.cpufreqTargetEvent.bind(this));c.registerEventHandler("cpufreq_interactive_notyet",d.prototype.cpufreqTargetEvent.bind(this));c.registerEventHandler("cpufreq_interactive_setspeed",
43 d.prototype.cpufreqTargetEvent.bind(this));c.registerEventHandler("cpufreq_interactive_target",d.prototype.cpufreqTargetEvent.bind(this));c.registerEventHandler("cpufreq_interactive_boost",d.prototype.cpufreqBoostUnboostEvent.bind(this));c.registerEventHandler("cpufreq_interactive_unboost",d.prototype.cpufreqBoostUnboostEvent.bind(this))}function b(a){var e={};a=a.split(/\s+/);for(var b=a.length,g=0;g<b;g++){var h=a[g].split("=");e[h[0]]=parseInt(h[1])}return e}var a=tracing.importer.linux_perf.Parser;
44 d.prototype={__proto__:a.prototype,cpufreqSlice:function(a,e,b,g){b=this.importer.getOrCreatePseudoThread("cpufreq");b.openSlice=e;a=new tracing.trace_model.Slice("",b.openSlice,tracing.getStringColorId(b.openSlice),a,g,0);b.thread.sliceGroup.pushSlice(a)},cpufreqBoostSlice:function(a,e,b){var g=this.importer.getOrCreatePseudoThread("cpufreq_boost");g.openSlice=e;a=new tracing.trace_model.Slice("",g.openSlice,tracing.getStringColorId(g.openSlice),a,b,0);g.thread.sliceGroup.pushSlice(a)},cpufreqUpDownEvent:function(a,
45 e,f,g,h){e=b(h.details);this.cpufreqSlice(g,a,e.cpu,e);return!0},cpufreqTargetEvent:function(a,e,f,g,h){e=b(h.details);this.cpufreqSlice(g,a,e.cpu,e);return!0},cpufreqBoostUnboostEvent:function(a,e,b,g,h){this.cpufreqBoostSlice(g,a,{type:h.details});return!0}};a.registerSubtype(d);return{CpufreqParser:d}});"use strict";base.require("tracing.importer.linux_perf.parser");
46 base.exportTo("tracing.importer.linux_perf",function(){function d(a){b.call(this,a);a.registerEventHandler("ext4_sync_file_enter",d.prototype.ext4SyncFileEnterEvent.bind(this));a.registerEventHandler("ext4_sync_file_exit",d.prototype.ext4SyncFileExitEvent.bind(this));a.registerEventHandler("block_rq_issue",d.prototype.blockRqIssueEvent.bind(this));a.registerEventHandler("block_rq_complete",d.prototype.blockRqCompleteEvent.bind(this))}var b=tracing.importer.linux_perf.Parser;d.prototype={__proto__:b.prototype,
47 openAsyncSlice:function(a,c,e,b,g,h){e=this.importer.getOrCreateKernelThread(c+":"+e,b);a=new tracing.trace_model.AsyncSlice(c,h,tracing.getStringColorId(h),a);a.startThread=e.thread;e.openAsyncSlices||(e.openAsyncSlices={});e.openAsyncSlices[g]=a},closeAsyncSlice:function(a,c,e,b,g,h){e=this.importer.getOrCreateKernelThread(c+":"+e,b);e.openAsyncSlices&&(b=e.openAsyncSlices[g])&&(b.duration=a-b.start,b.args=h,b.endThread=e.thread,b.subSlices=[new tracing.trace_model.Slice(c,b.title,b.colorId,b.start,
50 this.openAsyncSlice(b,"block",g.threadName,g.pid,c+"-"+e+"-"+h,a);return!0},blockRqCompleteEvent:function(a,c,e,b,g){var h=/(\d+,\d+) (F)?([DWRN])(F)?(A)?(S)?(M)? \(.*\) (\d+) \+ (\d+) \[(.*)\]/.exec(g.details);if(!h)return!1;a=h[1];c=parseInt(h[8]);e=parseInt(h[9]);h=parseInt(h[10]);this.closeAsyncSlice(b,"block",g.threadName,g.pid,a+"-"+c+"-"+e,{device:a,sector:c,numSectors:e,error:h});return!0}};b.registerSubtype(d);return{DiskParser:d}});"use strict";base.require("tracing.importer.linux_perf.parser");
51 base.exportTo("tracing.importer.linux_perf",function(){function d(a){b.call(this,a);a.registerEventHandler("drm_vblank_event",d.prototype.vblankEvent.bind(this))}var b=tracing.importer.linux_perf.Parser;d.prototype={__proto__:b.prototype,drmVblankSlice:function(a,c,e){var b=this.importer.getOrCreatePseudoThread("drm_vblank");b.openSlice=c;a=new tracing.trace_model.Slice("",b.openSlice,tracing.getStringColorId(b.openSlice),a,e,0);b.thread.sliceGroup.pushSlice(a)},vblankEvent:function(a,c,e,b,g){c=
52 /crtc=(\d+), seq=(\d+)/.exec(g.details);if(!c)return!1;a=parseInt(c[1]);c=parseInt(c[2]);this.drmVblankSlice(b,"vblank:"+a,{crtc:a,seq:c});return!0}};b.registerSubtype(d);return{DrmParser:d}});"use strict";base.require("tracing.importer.linux_perf.parser");
53 base.exportTo("tracing.importer.linux_perf",function(){function d(a){b.call(this,a);a.registerEventHandler("exynos_flip_request",d.prototype.flipEvent.bind(this));a.registerEventHandler("exynos_flip_complete",d.prototype.flipEvent.bind(this));a.registerEventHandler("exynos_busfreq_target_int",d.prototype.busfreqTargetIntEvent.bind(this));a.registerEventHandler("exynos_busfreq_target_mif",d.prototype.busfreqTargetMifEvent.bind(this))}var b=tracing.importer.linux_perf.Parser;d.prototype={__proto__:b.prototype,
54 exynosFlipOpenSlice:function(a,c){var e=this.importer.getOrCreatePseudoThread("exynos_flip");e.openSliceTS=a;e.openSlice="flip:"+c},exynosFlipCloseSlice:function(a,c){var e=this.importer.getOrCreatePseudoThread("exynos_flip");if(e.openSlice){var b=new tracing.trace_model.Slice("",e.openSlice,tracing.getStringColorId(e.openSlice),e.openSliceTS,c,a-e.openSliceTS);e.thread.sliceGroup.pushSlice(b)}e.openSlice=void 0},flipEvent:function(a,c,e,b,g){c=/pipe=(\d+)/.exec(g.details);if(!c)return!1;c=parseInt(c[1]);
55 "exynos_flip_request"==a?this.exynosFlipOpenSlice(b,c):this.exynosFlipCloseSlice(b,{pipe:c});return!0},exynosBusfreqSample:function(a,c,e){a=this.importer.getOrCreateCpuState(0).cpu.getOrCreateCounter("",a);0===a.numSeries&&a.addSeries(new tracing.trace_model.CounterSeries("frequency",tracing.getStringColorId(a.name+".frequency")));a.series.forEach(function(a){a.addSample(c,e)})},busfreqTargetIntEvent:function(a,c,e,b,g){a=/frequency=(\d+)/.exec(g.details);if(!a)return!1;this.exynosBusfreqSample("INT Frequency",
56 b,parseInt(a[1]));return!0},busfreqTargetMifEvent:function(a,c,e,b,g){a=/frequency=(\d+)/.exec(g.details);if(!a)return!1;this.exynosBusfreqSample("MIF Frequency",b,parseInt(a[1]));return!0}};b.registerSubtype(d);return{ExynosParser:d}});"use strict";base.require("tracing.importer.linux_perf.parser");
57 base.exportTo("tracing.importer.linux_perf",function(){function d(a){b.call(this,a);a.registerEventHandler("tracing_mark_write:log",d.prototype.logEvent.bind(this));a.registerEventHandler("tracing_mark_write:SyncInterpret",d.prototype.syncEvent.bind(this));a.registerEventHandler("tracing_mark_write:HandleTimer",d.prototype.timerEvent.bind(this))}var b=tracing.importer.linux_perf.Parser;d.prototype={__proto__:b.prototype,gestureOpenSlice:function(a,c,e){this.importer.getOrCreatePseudoThread("gesture").thread.sliceGroup.beginSlice("touchpad_gesture",
60 "use strict";base.require("tracing
61 base.exportTo("tracing.importer.linux_perf",function(){function d(a){b.call(this,a);a.registerEventHandler("i915_gem_object_create",d.prototype.gemObjectCreateEvent.bind(this));a.registerEventHandler("i915_gem_object_bind",d.prototype.gemObjectBindEvent.bind(this));a.registerEventHandler("i915_gem_object_unbind",d.prototype.gemObjectBindEvent.bind(this));a.registerEventHandler("i915_gem_object_change_domain",d.prototype.gemObjectChangeDomainEvent.bind(this));a.registerEventHandler("i915_gem_object_pread",
65 tracing.importer.linux_perf.Parser;d.prototype={__proto__:b.prototype,i915FlipOpenSlice:function(a,c,e){var b=this.importer.getOrCreatePseudoThread("i915_flip");b.openSliceTS=a;b.openSlice="flip:"+c+"/"+e},i915FlipCloseSlice:function(a,c){var e=this.importer.getOrCreatePseudoThread("i915_flip");if(e.openSlice){var b=new tracing.trace_model.Slice("",e.openSlice,tracing.getStringColorId(e.openSlice),e.openSliceTS,c,a-e.openSliceTS);e.thread.sliceGroup.pushSlice(b)}e.openSlice=void 0},i915GemObjectSlice:function(a,
66 c,e,b){var g=this.importer.getOrCreatePseudoThread("i915_gem");g.openSlice=c+":"+e;a=new tracing.trace_model.Slice("",g.openSlice,tracing.getStringColorId(g.openSlice),a,b,0);g.thread.sliceGroup.pushSlice(a)},i915GemRingSlice:function(a,c,e,b,g){var h=this.importer.getOrCreatePseudoThread("i915_gem_ring");h.openSlice=c+":"+e+"."+b;a=new tracing.trace_model.Slice("",h.openSlice,tracing.getStringColorId(h.openSlice),a,g,0);h.thread.sliceGroup.pushSlice(a)},i915RegSlice:function(a,c,e,b){var g=this.importer.getOrCreatePseudoThread("i915_reg");
67 g.openSlice=c+":"+e;a=new tracing.trace_model.Slice("",g.openSlice,tracing.getStringColorId(g.openSlice),a,b,0);g.thread.sliceGroup.pushSlice(a)},gemObjectCreateEvent:function(a,c,e,b,g){e=/obj=(\w+), size=(\d+)/.exec(g.details);if(!e)return!1;c=e[1];e=parseInt(e[2]);this.i915GemObjectSlice(b,a,c,{obj:c,size:e});return!0},gemObjectBindEvent:function(a,c,e,b,g){g=/obj=(\w+), offset=(\w+), size=(\d+)/.exec(g.details);if(!g)return!1;c=g[1];e=g[2];g=parseInt(g[3]);this.i915ObjectGemSlice(b,a+":"+c,{obj:c,
72 return!0}};b.registerSubtype(d);return{I915Parser:d}});"use strict";base.require("tracing.importer.linux_perf.parser");
73 base.exportTo("tracing.importer.linux_perf",function(){function d(a){b.call(this,a);a.registerEventHandler("graph_ent",d.prototype.traceKernelFuncEnterEvent.bind(this));a.registerEventHandler("graph_ret",d.prototype.traceKernelFuncReturnEvent.bind(this));this.model_=a.model_;this.ppids_={}}var b=tracing.importer.linux_perf.Parser,a=/func=(.+)/;d.prototype={__proto__:b.prototype,traceKernelFuncEnterEvent:function(c,e,b,g,h){c=a.exec(h.details);if(!c||void 0===h.tgid)return!1;e=parseInt(h.tgid);c=c[1];
75 !1;0<h.openSliceCount&&h.endSlice(g);return!0}};b.registerSubtype(d);return{KernelFuncParser:d}});"use strict";base.require("tracing.importer.linux_perf.parser");
76 base.exportTo("tracing.importer.linux_perf",function(){function d(a){b.call(this,a);a.registerEventHandler("mali_dvfs_event",d.prototype.dvfsEventEvent.bind(this));a.registerEventHandler("mali_dvfs_set_clock",d.prototype.dvfsSetClockEvent.bind(this));a.registerEventHandler("mali_dvfs_set_voltage",d.prototype.dvfsSetVoltageEvent.bind(this));this.addJMCounter("mali_hwc_MESSAGES_SENT","Messages Sent");this.addJMCounter("mali_hwc_MESSAGES_RECEIVED","Messages Received");this.addJMCycles("mali_hwc_GPU_ACTIVE",
94 d.prototype.maliDDKEvent.bind(this));this.model_=a.model_}var b=tracing.importer.linux_perf.Parser;d.prototype={__proto__:b.prototype,maliDDKOpenSlice:function(a,c,e,b,g){a=this.importer.model_.getOrCreateProcess(a).getOrCreateThread(c);b=/^([\w\d_]*)(?:\(\))?:?\s*(.*)$/.exec(b);a.sliceGroup.beginSlice("gpu-driver",b[1],e,{args:b[2],blockinfo:g})},maliDDKCloseSlice:function(a,c,e,b,g){a=this.importer.model_.getOrCreateProcess(a).getOrCreateThread(c);a.sliceGroup.openSliceCount&&a.sliceGroup.endSlice(e)},
96 c,b,[],a[3])}return!0},dvfsSample:function(a,c,e,b){var g=parseInt(b);a=this.model_.getOrCreateProcess(0).getOrCreateCounter("DVFS",a);0===a.numSeries&&a.addSeries(new tracing.trace_model.CounterSeries(c,tracing.getStringColorId(a.name)));a.series.forEach(function(a){a.addSample(e,g)})},dvfsEventEvent:function(a,c,e,b,g){a=/utilization=(\d+)/.exec(g.details);if(!a)return!1;this.dvfsSample("DVFS Utilization","utilization",b,a[1]);return!0},dvfsSetClockEvent:function(a,c,e,b,g){a=/frequency=(\d+)/.exec(g.details);
97 if(!a)return!1;this.dvfsSample("DVFS Frequency","frequency",b,a[1]);return!0},dvfsSetVoltageEvent:function(a,c,e,b,g){a=/voltage=(\d+)/.exec(g.details);if(!a)return!1;this.dvfsSample("DVFS Voltage","voltage",b,a[1]);return!0},hwcSample:function(a,c,e,b,g){g=/val=(\d+)/.exec(g.details);if(!g)return!1;var h=parseInt(g[1]);a=this.model_.getOrCreateProcess(0).getOrCreateCounter(a,c);0===a.numSeries&&a.addSeries(new tracing.trace_model.CounterSeries(e,tracing.getStringColorId(a.name)));a.series.forEach(function(a){a.addSample(b,
104 a,c,b,f)},addL2Counter:function(a,c){this.importer.registerEventHandler(a,function(a,b,g,d,k){return this.l2Sample(c,"count",d,k)}.bind(this))},addL2Cycles:function(a,c){this.importer.registerEventHandler(a,function(a,b,g,d,k){return this.l2Sample(c,"cycles",d,k)}.bind(this))}};b.registerSubtype(d);return{MaliParser:d}});"use strict";base.require("tracing.importer.linux_perf.parser");base.require("tracing.trace_model.counter_series");
105 base.exportTo("tracing.importer.linux_perf",function(){function d(a){b.call(this,a);a.registerEventHandler("power_start",d.prototype.powerStartEvent.bind(this));a.registerEventHandler("power_frequency",d.prototype.powerFrequencyEvent.bind(this));a.registerEventHandler("cpu_frequency",d.prototype.cpuFrequencyEvent.bind(this));a.registerEventHandler("cpu_idle",d.prototype.cpuIdleEvent.bind(this))}var b=tracing.importer.linux_perf.Parser;d.prototype={__proto__:b.prototype,cpuStateSlice:function(a,c,
106 b,f){c=this.importer.getOrCreateCpuState(c);"1"!=b?this.importer.importError("Don't understand power_start events of type "+b):(b=c.cpu.getOrCreateCounter("","C-State"),0===b.numSeries&&b.addSeries(new tracing.trace_model.CounterSeries("state",tracing.getStringColorId(b.name+".state"))),b.series.forEach(function(c){c.addSample(a,f)}))},cpuIdleSlice:function(a,c,b){c=this.importer.getOrCreateCpuState(c).cpu.getOrCreateCounter("","C-State");0===c.numSeries&&c.addSeries(new tracing.trace_model.CounterSeries("state",
107 tracing.getStringColorId(c.name)));var f=4294967295!=b?b:0;c.series.forEach(function(c){c.addSample(a,f)})},cpuFrequencySlice:function(a,c,b){c=this.importer.getOrCreateCpuState(c).cpu.getOrCreateCounter("","Clock Frequency");0===c.numSeries&&c.addSeries(new tracing.trace_model.CounterSeries("state",tracing.getStringColorId(c.name+".state")));c.series.forEach(function(c){c.addSample(a,b)})},powerStartEvent:function(a,c,b,f,g){a=/type=(\d+) state=(\d) cpu_id=(\d)+/.exec(g.details);if(!a)return!1;c=
109 if(!c)return!1;a=parseInt(c[2]);c=parseInt(c[1]);this.cpuIdleSlice(f,a,c);return!0}};b.registerSubtype(d);return{PowerParser:d}});"use strict";base.require("tracing.importer.linux_perf.parser");
110 base.exportTo("tracing.importer.linux_perf",function(){function d(a){b.call(this,a);a.registerEventHandler("sched_switch",d.prototype.schedSwitchEvent.bind(this));a.registerEventHandler("sched_wakeup",d.prototype.schedWakeupEvent.bind(this))}var b=tracing.importer.linux_perf.Parser,a={},c=RegExp("prev_comm=(.+) prev_pid=(\\d+) prev_prio=(\\d+) prev_state=(\\S\\+?|\\S\\|\\S) ==> next_comm=(.+) next_pid=(\\d+) next_prio=(\\d+)");a.schedSwitchRE=c;var e=/comm=(.+) pid=(\d+) prio=(\d+) success=(\d+) target_cpu=(\d+)/;
112 "use strict";base.require("tracing.importer.linux_perf.parser");
113 base.exportTo("tracing.importer.linux_perf",function(){function d(a){b.call(this,a);a.registerEventHandler("sync_timeline",d.prototype.timelineEvent.bind(this));a.registerEventHandler("sync_wait",d.prototype.syncWaitEvent.bind(this));a.registerEventHandler("sync_pt",d.prototype.syncPtEvent.bind(this));this.model_=a.model_}var b=tracing.importer.linux_perf.Parser,a=/name=(\S+) value=(\S*)/,c=/(\S+) name=(\S+) state=(\d+)/,e=/name=(\S+) value=(\S*)/;d.prototype={__proto__:b.prototype,timelineEvent:function(c,
114 b,e,d,l){c=a.exec(l.details);if(!c)return!1;b=this.importer.getOrCreatePseudoThread(c[1]);void 0!==b.lastActiveTs&&(e=d-b.lastActiveTs,l=b.lastActiveValue,void 0==l&&(l=" "),e=new tracing.trace_model.Slice("",l,tracing.getStringColorId(l),b.lastActiveTs,{},e),b.thread.sliceGroup.pushSlice(e));b.lastActiveTs=d;b.lastActiveValue=c[2];return!0},syncWaitEvent:function(a,b,e,d,l){a=c.exec(l.details);if(!a||void 0===l.tgid)return!1;b=parseInt(l.tgid);e=this.model_.getOrCreateProcess(b).getOrCreateThread(e);
115 e.name=l.threadName;l=e.kernelSliceGroup;if(!l.isTimestampValidForBeginOrEnd(d))return this.model_.importErrors.push("Timestamps are moving backward."),!1;e='fence_wait("'+a[2]+'")';if("begin"==a[1])l.beginSlice(null,e,d,{"Start state":a[3]});else if("end"==a[1])0<l.openSliceCount&&l.endSlice(d);else return!1;return!0},syncPtEvent:function(a,c,b,d,l){return e.exec(l.details)?!0:!1}};b.registerSubtype(d);return{SyncParser:d}});"use strict";base.require("tracing.importer.linux_perf.parser");
116 base.exportTo("tracing.importer.linux_perf",function(){function d(a){b.call(this,a);a.registerEventHandler("workqueue_execute_start",d.prototype.executeStartEvent.bind(this));a.registerEventHandler("workqueue_execute_end",d.prototype.executeEndEvent.bind(this));a.registerEventHandler("workqueue_queue_work",d.prototype.executeQueueWork.bind(this));a.registerEventHandler("workqueue_activate_work",d.prototype.executeActivateWork.bind(this))}var b=tracing.importer.linux_perf.Parser,a=/work struct (.+): function (\S+)/,
117 c=/work struct (.+)/;d.prototype={__proto__:b.prototype,executeStartEvent:function(c,b,g,d,k){c=a.exec(k.details);if(!c)return!1;g=this.importer.getOrCreateKernelThread(k.threadName,g,g);g.openSliceTS=d;g.openSlice=c[2];return!0},executeEndEvent:function(a,b,g,d,k){if(!c.exec(k.details))return!1;a=this.importer.getOrCreateKernelThread(k.threadName,g,g);a.openSlice&&(d=new tracing.trace_model.Slice("",a.openSlice,tracing.getStringColorId(a.openSlice),a.openSliceTS,{},d-a.openSliceTS),a.thread.sliceGroup.pushSlice(d));
125 base.exportTo("tracing",function(){function d(){}function b(a){this.text_=a.toLowerCase()}function a(a){this.categories_={};a=a||[];for(var b=0;b<a.length;b++)this.addCategory(a[b])}d.prototype={__proto__:Object.prototype,matchCounter:function(a){return!0},matchCpu:function(a){return!0},matchProcess:function(a){return!0},matchSlice:function(a){return!0},matchThread:function(a){return!0}};b.prototype={__proto__:d.prototype,matchCounter:function(a){return 0===this.text_.length||void 0===a.name?!1:-1!==
127 f.push(b[g]);return f},filterSliceArray:function(a,b){if(void 0===a)return b;for(var f=[],g=0;g<b.length;++g)a.matchSlice(b[g])&&f.push(b[g]);return f},Filter:d,TitleFilter:b,CategoryFilter:a}});"use strict";base.require("base.guid");base.require("base.range");base.require("tracing.trace_model.counter_series");
128 base.exportTo("tracing.trace_model",function(){function d(b,a,c,e){this.guid_=base.GUID.allocate();this.parent=b;this.id=a;this.category=c||"";this.name=e;this.series_=[];this.bounds=new base.Range}d.prototype={__proto__:Object.prototype,get guid(){return this.guid_},toJSON:function(){for(var b={},a=Object.keys(this),c=0;c<a.length;c++){var e=a[c];"function"!=typeof this[e]&&(b[e]="parent"==e?this[e].guid:this[e])}return b},set timestamps(b){throw Error("Bad counter API. No cookie.");},set seriesNames(b){throw Error("Bad counter API. No cookie.");
131 this.maxTotal=Math.max(e,this.maxTotal)}}}};d.compare=function(b,a){var c=b.parent.compareTo(a);if(0!=c)return c;c=b.name.localeCompare(a.name);return 0==c?b.tid-a.tid:c};return{Counter:d}});"use strict";base.exportTo("tracing.trace_model",function(){function d(b,a,c,e,f){this.category=b||"";this.title=a;this.colorId=c;this.start=e;this.args=f;this.didNotFinish=!1}d.prototype={selected:!1,duration:0,get end(){return this.start}};return{TraceModelEvent:d}});"use strict";base.require("tracing.trace_model.trace_model_event");
132 base.exportTo("tracing.trace_model",function(){function d(b,a,c,e,f,g){tracing.trace_model.TraceModelEvent.call(this,b,a,c,e,f);void 0!==g&&(this.duration=g)}d.prototype={__proto__:tracing.trace_model.TraceModelEvent.prototype,get end(){return this.start+this.duration}};return{Slice:d}});"use strict";base.require("base.range");base.require("tracing.trace_model.slice");base.require("tracing.trace_model.counter");
133 base.exportTo("tracing.trace_model",function(){function d(a){this.cpuNumber=a;this.slices=[];this.counters={};this.bounds=new base.Range}var b=tracing.trace_model.Counter;d.prototype={getOrCreateCounter:function(a,c){var e;e=a.length?a+"."+c:c;this.counters[e]||(this.counters[e]=new b(this,e,a,c));return this.counters[e]},shiftTimestampsForward:function(a){for(var c=0;c<this.slices.length;c++)this.slices[c].start+=a;for(var b in this.counters)this.counters[b].shiftTimestampsForward(a)},updateBounds:function(){this.bounds.reset();
141 base.exportTo("tracing.trace_model",function(){function d(b,a,c){this.objectInstance=b;this.ts=a;this.args=c;this.selected=!1}d.prototype={__proto__:Object.prototype,preInitialize:function(){},initialize:function(){}};d.nameToConstructorMap_={};d.register=function(b,a){if(d.nameToConstructorMap_[b])throw Error("Constructor already registerd for "+b);d.nameToConstructorMap_[b]=a};d.unregister=function(b){delete d.nameToConstructorMap_[b]};d.getConstructor=function(b){return d.nameToConstructorMap_[b]?
142 d.nameToConstructorMap_[b]:d};return{ObjectSnapshot:d}});"use strict";base.require("base.range");base.require("base.sorted_array_utils");base.require("tracing.trace_model.object_snapshot");
143 base.exportTo("tracing.trace_model",function(){function d(b,a,c,e,f){this.parent=b;this.id=a;this.category=c;this.name=e;this.creationTs=f;this.creationTsWasExplicit=!1;this.deletionTs=Number.MAX_VALUE;this.selected=this.deletionTsWasExplicit=!1;this.colorId=0;this.bounds=new base.Range;this.snapshots=[];this.hasImplicitSnapshots=!1}d.prototype={__proto__:Object.prototype,get typeName(){return this.name},addSnapshot:function(b,a){if(b<this.creationTs)throw Error("Snapshots must be >= instance.creationTs");
144 if(b>=this.deletionTs)throw Error("Snapshots cannot be added after an objects deletion timestamp.");var c;if(0<this.snapshots.length){c=this.snapshots[this.snapshots.length-1];if(c.ts==b)throw Error("Snapshots already exists at this time!");if(b<c.ts)throw Error("Snapshots must be added in increasing timestamp order");}c=new (tracing.trace_model.ObjectSnapshot.getConstructor(this.name))(this,b,a);this.snapshots.push(c);return c},wasDeleted:function(b){var a;if(0<this.snapshots.length&&(a=this.snapshots[this.snapshots.length-
149 base.exportTo("tracing.trace_model",function(){function d(b,a,c){this.createObjectInstanceFunction_=b;this.parent=a;this.id=c;this.instances=[]}d.prototype={idWasCreated:function(b,a,c){if(0==this.instances.length)return this.instances.push(this.createObjectInstanceFunction_(this.parent,this.id,b,a,c)),this.instances[0].creationTsWasExplicit=!0,this.instances[0];var e=this.instances[this.instances.length-1];if(c<e.deletionTs)throw Error("Mutation of the TimeToObjectInstanceMap must be done in ascending timestamp order.");
154 return{TimeToObjectInstanceMap:d}});"use strict";base.require("base.utils");base.require("base.range");base.require("base.sorted_array_utils");base.require("tracing.trace_model.object_instance");base.require("tracing.trace_model.time_to_object_instance_map");
155 base.exportTo("tracing.trace_model",function(){function d(b){this.parent=b;this.bounds=new base.Range;this.instanceMapsById_={};this.instancesByTypeName_={};this.createObjectInstance_=this.createObjectInstance_.bind(this)}d.prototype={__proto__:Object.prototype,createObjectInstance_:function(b,a,c,e,f){b=new (tracing.trace_model.ObjectInstance.getConstructor(e))(b,a,c,e,f);a=b.typeName;c=this.instancesByTypeName_[a];c||(c=[],this.instancesByTypeName_[a]=c);c.push(b);return b},getOrCreateInstanceMap_:function(b){var a=
156 this.instanceMapsById_[b];if(a)return a;a=new tracing.trace_model.TimeToObjectInstanceMap(this.createObjectInstance_,this.parent,b);return this.instanceMapsById_[b]=a},idWasCreated:function(b,a,c,e){return this.getOrCreateInstanceMap_(b).idWasCreated(a,c,e)},addSnapshot:function(b,a,c,e,f){b=this.getOrCreateInstanceMap_(b,a,c,e).addSnapshot(a,c,e,f);if(b.objectInstance.category!=a)throw Error("Added snapshot with different category than when it was created");if(b.objectInstance.name!=c)throw Error("Added snapshot with different name than when it was created");
160 addCategoriesToDict:function(b){this.iterObjectInstances(function(a){b[a.category]=!0})},toJSON:function(){return{}}};return{ObjectCollection:d}});"use strict";base.require("tracing.trace_model.slice");
161 base.exportTo("tracing.trace_model",function(){function d(b,a,c,e,f){tracing.trace_model.Slice.apply(this,arguments)}d.prototype={__proto__:tracing.trace_model.Slice.prototype,toJSON:function(){for(var b={},a=Object.keys(this),c=0;c<a.length;c++){var e=a[c];"function"!=typeof this[e]&&(b[e]="startThread"==e||"endThread"==e?this[e].guid:this[e])}return b},id:void 0,startThread:void 0,endThread:void 0,subSlices:void 0};return{AsyncSlice:d}});"use strict";base.require("base.range");base.require("tracing.trace_model.async_slice");
162 base.exportTo("tracing.trace_model",function(){function d(){this.slices=[];this.bounds=new base.Range}d.prototype={__proto__:Object.prototype,push:function(b){this.slices.push(b)},get length(){return this.slices.length},shiftTimestampsForward:function(b){for(var a=0;a<this.slices.length;a++){var c=this.slices[a];c.start+=b;for(var e=0;e<c.subSlices.length;e++)c.subSlices[e].start+=b}},updateBounds:function(){this.bounds.reset();for(var b=0;b<this.slices.length;b++)this.bounds.addValue(this.slices[b].start),
163 this.bounds.addValue(this.slices[b].end)},computeSubGroups:function(){for(var b={},a=0;a<this.slices.length;++a){var c=this.slices[a],e=c.startThread.guid;b[e]||(b[e]=new d);b[e].slices.push(c)}var a=[],f;for(f in b)c=b[f],c.updateBounds(),a.push(c);return a}};return{AsyncSliceGroup:d}});"use strict";base.require("tracing.trace_model.trace_model_event");
164 base.exportTo("tracing.trace_model",function(){function d(b,a,c,e,f){tracing.trace_model.TraceModelEvent.apply(this,arguments)}d.prototype={__proto__:tracing.trace_model.TraceModelEvent.prototype};return{Sample:d}});"use strict";base.require("base.range");base.require("tracing.trace_model.slice");base.require("tracing.color_scheme");base.require("tracing
165 base.exportTo("tracing.trace_model",function(){function d(a){this.sliceConstructor=a||b;this.openPartialSlices_=[];this.slices=[];this.bounds=new base.Range}var b=tracing.trace_model.Slice;d.prototype={__proto__:Object.prototype,get length(){return this.slices.length},pushSlice:function(a){this.slices.push(a);return a},pushSlices:function(a){this.slices.push.apply(this.slices,a)},pushInstantEvent:function(a){this.slices.push(a)},beginSlice:function(a,c,b,f){if(this.openPartialSlices_.length&&b<this.openPartialSlices_[this.openPartialSlices_.length-
166 1].start)throw Error("Slices must be added in increasing timestamp order");var g=tracing.getStringColorId(c);a=new this.sliceConstructor(a,c,g,b,f?f:{});this.openPartialSlices_.push(a);return a},isTimestampValidForBeginOrEnd:function(a){return this.openPartialSlices_.length?a>=this.openPartialSlices_[this.openPartialSlices_.length-1].start:!0},get openSliceCount(){return this.openPartialSlices_.length},get mostRecentlyOpenedPartialSlice(){return this.openPartialSlices_.length?this.openPartialSlices_[this.openPartialSlices_.length-
171 return b};return{SliceGroup:d}});"use strict";base.require("base.guid");base.require("base.range");base.require("tracing.trace_model.slice");base.require("tracing.trace_model.slice_group");base.require("tracing.trace_model.async_slice_group");base.require("tracing.trace_model.sample");
172 base.exportTo("tracing.trace_model",function(){function d(c,b,e,d,l,m){a.call(this,c,b,e,d,l,m);this.subSlices=[]}function b(a,b){this.guid_=base.GUID.allocate();if(!a)throw Error("Parent must be provided.");this.parent=a;this.sortIndex=0;this.tid=b;this.sliceGroup=new c(d);this.cpuSlices=void 0;this.samples_=[];this.kernelSliceGroup=new c;this.asyncSliceGroup=new e;this.bounds=new base.Range;this.ephemeralSettings={}}var a=tracing.trace_model.Slice,c=tracing.trace_model.SliceGroup,e=tracing.trace_model.AsyncSliceGroup;
173 d.prototype={__proto__:a.prototype};b.prototype={get guid(){return this.guid_},compareTo:function(a){return b.compare(this,a)},toJSON:function(){for(var a={},c=Object.keys(this),b=0;b<c.length;b++){var e=c[b];"function"!=typeof this[e]&&(a[e]="parent"==e?this[e].guid:this[e])}return a},addSample:function(a,c,b,e){if(this.samples_.length&&b<this.samples_[this.samples_.length-1].start)throw Error("Samples must be added in increasing timestamp order.");var d=tracing.getStringColorId(c);a=new tracing.trace_model.Sample(a,
181 base.exportTo("tracing",function(){function d(a){this.model=a;this.objectsByKey_=[];this.nonuniqueKeys_=[];this.buildObjectsByKeyMap_();this.removeNonuniqueKeysFromSettings_()}var b=base.Settings;d.prototype={buildObjectsByKeyMap_:function(){var a=[this.model.kernel];a.push.apply(a,base.dictionaryValues(this.model.processes));a.push.apply(a,this.model.getAllThreads());for(var c={},b=0;b<a.length;b++){var f=a[b],g=f.getSettingsKey();g&&(c[g]=void 0===c[g]?f:"nonuniqueKey")}var d={};base.dictionaryKeys(c).forEach(function(a){"nonuniqueKey"===
183 void 0!==c?c:e;a=b.get("trace_model_settings",{});a[f]||(a[f]={});c=a[f][c];return void 0!==c?c:e},setSettingFor:function(a,c,e){var f=a.getSettingsKey();f&&this.objectsByKey_[f]?(a=b.get("trace_model_settings",{}),a[f]||(a[f]={}),a[f][c]=e,b.set("trace_model_settings",a)):a.ephemeralSettings[c]=e}};return{TraceModelSettings:d}});"use strict";base.require("base.guid");base.require("base.range");base.require("tracing.trace_model.counter");base.require("tracing.trace_model.object_collection");base.require("tracing.trace_model.thread");
184 base.require("tracing.trace_model_settings");
185 base.exportTo("tracing.trace_model",function(){function d(a){if(!a)throw Error("Must provide a model");this.guid_=base.GUID.allocate();this.model=a;this.threads={};this.counters={};this.objects=new tracing.trace_model.ObjectCollection(this);this.bounds=new base.Range;this.sortIndex=0;this.ephemeralSettings={}}var b=tracing.trace_model.Thread,a=tracing.trace_model.Counter;d.compare=function(a,b){return a.sortIndex-b.sortIndex};d.prototype={get guid(){return this.guid_},get numThreads(){var a=0,b;for(b in this.threads)a++;
189 (this.threads[a]=new b(this,a));return this.threads[a]},getOrCreateCounter:function(c,b){var f=c+"."+b;this.counters[f]||(this.counters[f]=new a(this,f,c,b));return this.counters[f]},getSettingsKey:function(){throw Error("Not implemented");}};return{ProcessBase:d}});"use strict";base.require("tracing.trace_model.cpu");base.require("tracing.trace_model.process_base");
190 base.exportTo("tracing.trace_model",function(){function d(c){if(void 0===c)throw Error("model must be provided");a.call(this,c);this.cpus={}}var b=tracing.trace_model.Cpu,a=tracing.trace_model.ProcessBase;d.compare=function(a,b){return 0};d.prototype={__proto__:a.prototype,compareTo:function(a){return d.compare(this,a)},get userFriendlyName(){return"Kernel"},get userFriendlyDetails(){return"Kernel"},getOrCreateCpu:function(a){this.cpus[a]||(this.cpus[a]=new b(a));return this.cpus[a]},shiftTimestampsForward:function(c){a.prototype.shiftTimestampsForward.call(this);
191 for(var b in this.cpus)this.cpus[b].shiftTimestampsForward(c)},updateBounds:function(){a.prototype.updateBounds.call(this);for(var c in this.cpus){var b=this.cpus[c];b.updateBounds();this.bounds.addRange(b.bounds)}},addCategoriesToDict:function(c){a.prototype.addCategoriesToDict.call(this,c);for(var b in this.cpus)this.cpus[b].addCategoriesToDict(c)},getSettingsKey:function(){return"kernel"}};return{Kernel:d}});"use strict";base.require("tracing.trace_model.process_base");
192 base.exportTo("tracing.trace_model",function(){function d(b,a){if(void 0===b)throw Error("model must be provided");if(void 0===a)throw Error("pid must be provided");tracing.trace_model.ProcessBase.call(this,b);this.pid=a;this.name=void 0;this.labels=[];this.instantEvents=[]}d.compare=function(b,a){var c=tracing.trace_model.ProcessBase.compare(b,a);return c||(c=base.comparePossiblyUndefinedValues(b.name,a.name,function(a,c){return a.localeCompare(c)}))?c:(c=base.compareArrays(b.labels,a.labels,function(a,
193 c){return a.localeCompare(c)}))?c:b.pid-a.pid};d.prototype={__proto__:tracing.trace_model.ProcessBase.prototype,compareTo:function(b){return d.compare(this,b)},pushInstantEvent:function(b){this.instantEvents.push(b)},get userFriendlyName(){var b;b=this.name?this.name:"Process "+this.pid;this.labels.length&&(b+=": "+this.labels.join(", "));return b},get userFriendlyDetails(){return this.name?this.name+" (pid "+this.pid+")":"pid: "+this.pid},getSettingsKey:function(){return this.name?this.labels.length?
194 "processes."+this.name+"."+this.labels.join("."):"processes."+this.name:void 0},shiftTimestampsForward:function(b){for(var a in this.instantEvents)this.instantEvents[a].start+=b;tracing.trace_model.ProcessBase.prototype.shiftTimestampsForward.apply(this,arguments)}};return{Process:d}});"use strict";base.require("base.range");base.require("base.events");base.require("tracing.trace_model.process");base.require("tracing.trace_model.kernel");base.require("tracing.filter");
195 base.exportTo("tracing",function(){function d(a,b){this.kernel=new c(this);this.processes={};this.importErrors=[];this.metadata=[];this.categories=[];this.bounds=new base.Range;this.instantEvents=[];a&&this.importTraces([a],b)}function b(a){this.importPriority=0}var a=tracing.trace_model.Process,c=tracing.trace_model.Kernel;d.importerConstructors_=[];d.registerImporter=function(a){d.importerConstructors_.push(a)};d.prototype={__proto__:base.EventTarget.prototype,get numProcesses(){var a=0,c;for(c in this.processes)a++;
202 d.registerImporter(b);return{TraceModel:d}});"use strict";base.require("tracing.trace_model");base.require("tracing.color_scheme");base.require("tracing.importer.linux_perf.bus_parser");base.require("tracing.importer.linux_perf.clock_parser");base.require("tracing.importer.linux_perf.cpufreq_parser");base.require("tracing.importer.linux_perf.disk_parser");base.require("tracing.importer.linux_perf.drm_parser");base.require("tracing.importer.linux_perf.exynos_parser");base.require("tracing.importer.linux_perf.gesture_parser");
203 base.require("tracing.importer.linux_perf.i915_parser");base.require("tracing.importer.linux_perf.mali_parser");base.require("tracing.importer.linux_perf.power_parser");base.require("tracing.importer.linux_perf.sched_parser");base.require("tracing.importer.linux_perf.sync_parser");base.require("tracing.importer.linux_perf.workqueue_parser");base.require("tracing.importer.linux_perf.android_parser");base.require("tracing.importer.linux_perf.kfunc_parser");
204 base.exportTo("tracing.importer",function(){function d(a){this.cpu=a}function b(a,c){this.importPriority=2;this.model_=a;this.events_=c;this.clockSyncRecords_=[];this.cpuStates_={};this.wakeups_=[];this.kernelThreadStates_={};this.buildMapFromLinuxPidsToThreads();this.lineNumberBase=0;this.lineNumber=-1;this.pseudoThreadCounter=1;this.parsers_=[];this.eventHandlers_={}}function a(a){return"{"==a[0]?!1:e.test(a)?f:g.test(a)?h:k.test(a)?l:null}d.prototype={__proto__:Object.prototype,switchRunningLinuxPid:function(a,
205 c,b,e,f,g){if(void 0!==this.lastActivePid&&0!=this.lastActivePid){var d=b-this.lastActiveTs;a=(a=a.threadsByLinuxPid[this.lastActivePid])?a.userFriendlyName:this.lastActiveComm;c=new tracing.trace_model.Slice("",a,tracing.getStringColorId(a),this.lastActiveTs,{comm:this.lastActiveComm,tid:this.lastActivePid,prio:this.lastActivePrio,stateWhenDescheduled:c},d);this.cpu.slices.push(c)}this.lastActiveTs=b;this.lastActivePid=e;this.lastActiveComm=f;this.lastActivePrio=g}};var c={},e=RegExp("^\\s*(.+)-(\\d+)\\s+\\(\\s*(\\d+|-+)\\)\\s\\[(\\d+)\\]\\s+[dX.][N.][Hhs.][0-9a-f.]\\s+(\\d+\\.\\d+):\\s+(\\S+):\\s(.*)$"),
212 this.wakeups_[b],f=this.threadsByLinuxPid[a.tid])f.tempWakeups=f.tempWakeups||[],f.tempWakeups.push(a);var g=tracing.getColorIdByName("running"),d=tracing.getColorIdByName("runnable"),h=tracing.getColorIdByName("sleeping"),k=tracing.getColorIdByName("iowait");this.model_.getAllThreads().forEach(function(a){if(void 0!==a.tempCpuSlices){var c=a.tempCpuSlices;delete a.tempCpuSlices;c.sort(function(a,c){return a.start-c.start});var b=a.tempWakeups||[];delete a.tempWakeups;b.sort(function(a,c){return a.ts-
213 c.ts});var e=[];if(c.length){var f=c[0];if(b.length&&b[0].ts<f.start){var l=b.shift();e.push(new tracing.trace_model.Slice("","Runnable",d,l.ts,{"wakeup from tid":l.fromTid},f.start-l.ts))}e.push(new tracing.trace_model.Slice("","Running",g,f.start,{},f.duration))}l=void 0;for(f=1;f<c.length;f++){for(var m=c[f-1],n=c[f],p=n.start-m.end;b.length&&b[0].ts<n.start;){var q=b.shift();void 0===l&&q.ts>m.end&&(l=q)}q=function(a,c){void 0!==l&&(p=l.ts-m.end);e.push(new tracing.trace_model.Slice("",a,c,m.end,
214 {},p));void 0!==l&&(e.push(new tracing.trace_model.Slice("","Runnable",d,l.ts,{"wakeup from tid":l.fromTid},n.start-l.ts)),l=void 0)};"S"==m.args.stateWhenDescheduled?q("Sleeping",h):"R"==m.args.stateWhenDescheduled||"R+"==m.args.stateWhenDescheduled?e.push(new tracing.trace_model.Slice("","Runnable",d,m.end,{},p)):"D"==m.args.stateWhenDescheduled?q("Uninterruptible Sleep",k):"T"==m.args.stateWhenDescheduled?e.push(new tracing.trace_model.Slice("","__TASK_STOPPED",k,m.end,{},p)):"t"==m.args.stateWhenDescheduled?
215 e.push(new tracing.trace_model.Slice("","debug",k,m.end,{},p)):"Z"==m.args.stateWhenDescheduled?e.push(new tracing.trace_model.Slice("","Zombie",k,m.end,{},p)):"X"==m.args.stateWhenDescheduled?e.push(new tracing.trace_model.Slice("","Exit Dead",k,m.end,{},p)):"x"==m.args.stateWhenDescheduled?e.push(new tracing.trace_model.Slice("","Task Dead",k,m.end,{},p)):"K"==m.args.stateWhenDescheduled?e.push(new tracing.trace_model.Slice("","Wakekill",k,m.end,{},p)):"W"==m.args.stateWhenDescheduled?e.push(new tracing.trace_model.Slice("",
216 "Waking",k,m.end,{},p)):"D|K"==m.args.stateWhenDescheduled?q("Uninterruptible Sleep | WakeKill",k):"D|W"==m.args.stateWhenDescheduled?q("Uninterruptible Sleep | Waking",k):(e.push(new tracing.trace_model.Slice("","UNKNOWN",k,m.end,{},p)),this.model_.importErrors.push("Unrecognized sleep state: "+m.args.stateWhenDescheduled));e.push(new tracing.trace_model.Slice("","Running",g,n.start,{},n.duration))}a.cpuSlices=e}},this)},alignClocks:function(a){if(0==this.clockSyncRecords_.length){if(!a)return!0;
218 for(var a in this.cpuStates_)delete this.model_.kernel.cpus[a];for(var c in this.kernelThreadStates_){a=this.kernelThreadStates_[c].thread;var b=a.parent;delete b.threads[a.tid];delete this.model_.processes[b.pid]}this.model_.importErrors.push("Cannot import kernel trace without a clock sync.")},createParsers:function(){for(var a=tracing.importer.linux_perf.Parser.getSubtypeConstructors(),c=0;c<a.length;++c)this.parsers_.push(new a[c](this));this.registerEventHandler("tracing_mark_write:trace_event_clock_sync",
222 e);continue}var f=c(e);if(f){var g=parseInt(f.pid),d=parseInt(f.cpuNumber),h=1E3*parseFloat(f.timestamp),k=f.eventName,l=this.eventHandlers_[k];l?l(k,d,g,h,f)||this.importError("Malformed "+k+" event ("+e+")"):this.importError("Unknown event "+k+" ("+e+")")}else this.importError("Unrecognized line: "+e)}}}};tracing.TraceModel.registerImporter(b);return{LinuxPerfImporter:b,_LinuxPerfImporterTestExports:c}});"use strict";base.requireRawScript("../third_party/gl-matrix/src/gl-matrix/common.js");base.requireRawScript("../third_party/gl-matrix/src/gl-matrix/mat2d.js");
232 vec2.toString(this.p1)+", "+vec2.toString(this.p2)+", "+vec2.toString(this.p3)+", "+vec2.toString(this.p4)+")"}};return{vecInTriangle2:c,Quad:b}});"use strict";base.require("tracing.trace_model.trace_model_event");
233 base.exportTo("tracing.trace_model",function(){function d(a,c,b,e,d){tracing.trace_model.TraceModelEvent.apply(this,arguments);this.type=void 0}function b(a,c,b,k,l){d.apply(this,arguments);this.type=e.GLOBAL}function a(a,c,b,k,l){d.apply(this,arguments);this.type=e.PROCESS}function c(a,c,b,k,l){d.apply(this,arguments);this.type=e.THREAD}var e={GLOBAL:1,PROCESS:2,THREAD:3};d.prototype={__proto__:tracing.trace_model.TraceModelEvent.prototype};b.prototype={__proto__:d.prototype};a.prototype={__proto__:d.prototype};
234 c.prototype={__proto__:d.prototype};return{GlobalInstantEvent:b,ProcessInstantEvent:a,ThreadInstantEvent:c,InstantEventType:e}});"use strict";base.require("base.quad");base.require("tracing.trace_model");base.require("tracing.color_scheme");base.require("tracing.trace_model.instant_event");base.require("tracing.trace_model.counter_series");
235 base.exportTo("tracing.importer",function(){function d(a){if(!(a instanceof Object)){if(void 0===a||null===a)return a;if("string"==typeof a)return a.substring();if("boolean"==typeof a||"number"==typeof a)return a;throw Error("Unrecognized: "+typeof a);}if(a instanceof Array){for(var c=Array(a.length),b=0;b<a.length;b++)c[b]=d(a[b]);return c}if(a.__proto__!=Object.prototype)throw Error("Can only clone simple types");c={};for(b in a)c[b]=d(a[b]);return c}function b(a,c){this.importPriority=1;this.model_=
238 this.allAsyncEvents_.push({event:a,thread:c})},processCounterEvent:function(a){var c;c=void 0!==a.id?a.name+"["+a.id+"]":a.name;c=this.model_.getOrCreateProcess(a.pid).getOrCreateCounter(a.cat,c);if(0===c.numSeries){for(var b in a.args)c.addSeries(new tracing.trace_model.CounterSeries(b,tracing.getStringColorId(c.name+"."+b)));if(0===c.numSeries){this.model_.importErrors.push("Expected counter "+a.name+" to have at least one argument to use as a value.");delete c.parent.counters[c.name];return}}var f=
242 a.name)},processInstantEvent:function(a){var c;switch(a.s){case "g":c=tracing.trace_model.GlobalInstantEvent;break;case "p":c=tracing.trace_model.ProcessInstantEvent;break;default:c=tracing.trace_model.ThreadInstantEvent}var b=tracing.getStringColorId(a.name);c=new c(a.cat,a.name,b,a.ts/1E3,this.deepCopyIfNeeded_(a.args));switch(c.type){case tracing.trace_model.InstantEventType.GLOBAL:this.model_.pushInstantEvent(c);break;case tracing.trace_model.InstantEventType.PROCESS:this.model_.getOrCreateProcess(a.pid).pushInstantEvent(c);
243 break;case tracing.trace_model.InstantEventType.THREAD:this.model_.getOrCreateProcess(a.pid).getOrCreateThread(a.tid).sliceGroup.pushInstantEvent(c);break;default:throw Error("Unknown instant event type: "+a.s);}},processSampleEvent:function(a){this.model_.getOrCreateProcess(a.pid).getOrCreateThread(a.tid).addSample(a.cat,a.name,a.ts/1E3,this.deepCopyIfNeeded_(a.args))},importEvents:function(){for(var a=this.events_,c=0;c<a.length;c++){var b=a[c];"B"===b.ph||"E"===b.ph?this.processDurationEvent(b):
246 a[d]&&(a[d]={}),a[d][k]?this.model_.importErrors.push("At "+g.ts+", a slice of the same id "+k+" was alrady open."):(a[d][k]=[],a[d][k].push(f));else if(void 0===a[d])this.model_.importErrors.push("At "+g.ts+", no slice named "+d+" was open.");else if(void 0===a[d][k])this.model_.importErrors.push("At "+g.ts+", no slice named "+d+" with id="+k+" was open.");else{var l=a[d][k];l.push(f);if("F"==g.ph){var m=new tracing.trace_model.AsyncSlice(l[0].event.cat,d,tracing.getStringColorId(d),l[0].event.ts/
247 1E3);m.duration=g.ts/1E3-l[0].event.ts/1E3;m.startThread=l[0].thread;m.endThread=f.thread;m.id=k;m.args=this.deepCopyIfNeeded_(l[0].event.args);m.subSlices=[];for(f=1;f<l.length;++f){var n=d;"T"==l[f-1].event.ph&&(n=d+":"+l[f-1].event.args.step);n=new tracing.trace_model.AsyncSlice(l[0].event.cat,n,tracing.getStringColorId(d+f),l[f-1].event.ts/1E3);n.duration=l[f].event.ts/1E3-l[f-1].event.ts/1E3;n.startThread=l[f-1].thread;n.endThread=l[f].thread;n.id=k;n.args=this.deepCopyIfNeeded_(l[f-1].event.args);
250 c.id+" at ts="+b+": "+d);return}e=g.objectInstance}else if("D"==c.ph)try{e=a.objects.idWasDeleted(c.id,c.cat,c.name,b)}catch(t){this.model_.importErrors.push("While processing delete of "+c.id+" at ts="+b+": "+t);return}e&&(e.colorId=tracing.getStringColorId(e.typeName))}if(0!=this.allObjectEvents_.length){this.allObjectEvents_.sort(function(a,c){return a.event.ts-c.event.ts});for(var c=this.allObjectEvents_,b=0;b<c.length;b++){var f=c[b];try{a.call(this,f)}catch(g){this.model_.importErrors.push(g.message)}}}},
251 createImplicitObjects_:function(){base.iterItems(this.model_.processes,function(a,c){this.createImplicitObjectsForProcess_(c)},this)},createImplicitObjectsForProcess_:function(a){function c(c,b,e,d){if(e&&void 0!==e.id&&!(e instanceof tracing.trace_model.ObjectSnapshot)){var l=e.id,m=/(.+)\/(.+)/.exec(l);if(!m)throw Error("Implicit snapshots must have names.");delete e.id;var n=m[1],m=m[2],p;try{p=a.objects.addSnapshot(m,d.objectInstance.category,n,d.ts,e)}catch(q){this.model_.importErrors.push("While processing implicit snapshot of "+
252 l+" at ts="+d.ts+": "+q);return}p.objectInstance.hasImplicitSnapshots=!0;p.containingSnapshot=d;c[b]=p;if(!(p instanceof tracing.trace_model.ObjectSnapshot))throw Error("Created object must be instanceof snapshot");return p.args}}function b(a,c,d,k){if(a instanceof Object)if(a instanceof Array)for(var l=0;l<a.length;l++){var m=c.call(k,a,l,a[l],d);m?b(m,c,d,k):b(a[l],c,d,k)}else for(l in a)(m=c.call(k,a,l,a[l],d))?b(m,c,d,k):b(a[l],c,d,k)}a.objects.iterObjectInstances(function(a){a.snapshots.forEach(function(a){if(void 0!==
254 this);a.objects.iterObjectInstances(function(b){b.snapshots.forEach(function(b){this.searchItemForIDRefs_(c,a.objects,"ts",b)},this)},this);c.forEach(function(a){a.object[a.field]=a.value})},searchItemForIDRefs_:function(a,c,b,f){function d(g,h,m){void 0!==m&&(m.id_ref||m.idRef)&&(m=c.getSnapshotAt(m.id_ref||m.idRef,f[b]))&&a.push({object:g,field:h,value:m})}function h(a){if(a instanceof Object&&!(a instanceof tracing.trace_model.ObjectSnapshot||a instanceof Float32Array||a instanceof base.Quad))if(a instanceof
255 Array)for(var c=0;c<a.length;c++)d(a,c,a[c]),h(a[c]);else for(c in a){var b=a[c];d(a,c,b);h(b)}}if(!f.args)throw Error("");h(f.args)}};tracing.TraceModel.registerImporter(b);return{TraceEventImporter:b}});"use strict";
256 base.exportTo("tracing.importer.v8",function(){function d(){}d.prototype.root_=null;d.prototype.isEmpty=function(){return!this.root_};d.prototype.insert=function(b,a){if(this.isEmpty())this.root_=new d.Node(b,a);else if(this.splay_(b),this.root_.key!=b){var c=new d.Node(b,a);b>this.root_.key?(c.left=this.root_,c.right=this.root_.right,this.root_.right=null):(c.right=this.root_,c.left=this.root_.left,this.root_.left=null);this.root_=c}};d.prototype.remove=function(b){if(this.isEmpty())throw Error("Key not found: "+
260 a.push(c.right))}};d.Node=function(b,a){this.key=b;this.value=a};d.Node.prototype.left=null;d.Node.prototype.right=null;return{SplayTree:d}});"use strict";base.require("tracing.importer.v8.splaytree");
261 base.exportTo("tracing.importer.v8",function(){function d(){this.dynamics_=new tracing.importer.v8.SplayTree;this.dynamicsNameGen_=new tracing.importer.v8.CodeMap.NameGenerator;this.statics_=new tracing.importer.v8.SplayTree;this.libraries_=new tracing.importer.v8.SplayTree;this.pages_=[]}d.PAGE_ALIGNMENT=12;d.PAGE_SIZE=1<<d.PAGE_ALIGNMENT;d.prototype.addCode=function(b,a){this.deleteAllCoveredNodes_(this.dynamics_,b,b+a.size);this.dynamics_.insert(b,a)};d.prototype.moveCode=function(b,a){var c=this.dynamics_.remove(b);
267 base.exportTo("tracing.importer.v8",function(){function d(){}function b(a){this.dispatchTable_=a;this.lineNum_=0;this.csvParser_=new d}d.CSV_FIELD_RE_=/^"((?:[^"]|"")*)"|([^,]*)/;d.DOUBLE_QUOTE_RE_=/""/g;d.prototype.parseLine=function(a){var c=d.CSV_FIELD_RE_,b=d.DOUBLE_QUOTE_RE_,f=0,g=a.length,h=[];if(0<g){do{var k=c.exec(a.substr(f));"string"===typeof k[1]?(k=k[1],f+=k.length+3,h.push(k.replace(b,'"'))):(k=k[2],f+=k.length+1,h.push(k))}while(f<=g)}return h};b.prototype.printError=function(a){};
269 [],f=0;f<c.parsers.length;++f){var d=c.parsers[f];if(null===d)b.push(a[1+f]);else if("function"==typeof d)b.push(d(a[1+f]));else{b.push(a.slice(1+f));break}}c.processor.apply(this,b)}};b.prototype.processLog_=function(a){for(var c=0,b=a.length;c<b;++c,++this.lineNum_){var f=a[c];if(f)try{var d=this.csvParser_.parseLine(f);this.dispatchLogRow_(d)}catch(h){this.printError("line "+(this.lineNum_+1)+": "+(h.message||h))}}};return{LogReader:b}});"use strict";base.require("tracing.trace_model");base.require("tracing.trace_model.slice");
270 base.require("tracing.color_scheme");base.require("tracing.importer.v8.log_reader");base.require("tracing.importer.v8.codemap");
271 base.exportTo("tracing.importer",function(){function d(a,b){this.importPriority=3;this.model_=a;this.logData_=b;this.code_map_=new tracing.importer.v8.CodeMap;this.v8_samples_thread_=this.v8_stack_thread_=this.v8_timer_thread_=void 0}var b=["/d8","/libv8.so"],a={"V8.Execute":{pause:!1,no_execution:!1},"V8.External":{pause:!1,no_execution:!0},"V8.CompileFullCode":{pause:!0,no_execution:!0},"V8.RecompileSynchronous":{pause:!0,no_execution:!0},"V8.RecompileParallel":{pause:!1,no_execution:!1},"V8.CompileEval":{pause:!0,
273 extractSubtrace:function(){},processTimerEvent_:function(c,b,f){var d=a[c];if(void 0!==d){b/=1E3;f/=1E3;var h=tracing.getStringColorId(c);c=new tracing.trace_model.Slice("v8",c,h,b,d,f);this.v8_timer_thread_.sliceGroup.pushSlice(c)}},processTimerEventStart_:function(c,b){var f=a[c];void 0!==f&&this.v8_timer_thread_.sliceGroup.beginSlice("v8",c,b/1E3,f)},processTimerEventEnd_:function(a,b){this.v8_timer_thread_.sliceGroup.endSlice(b/1E3)},processCodeCreateEvent_:function(a,b,f,d,h){a=new tracing.importer.v8.CodeMap.CodeEntry(d,
274 h);a.kind=b;this.code_map_.addCode(f,a)},processCodeMoveEvent_:function(a,b){this.code_map_.moveCode(a,b)},processCodeDeleteEvent_:function(a){this.code_map_.deleteCode(a)},processSharedLibrary_:function(a,e,f){f=new tracing.importer.v8.CodeMap.CodeEntry(f-e,a);f.kind=-3;for(var d=0;d<b.length;d++){var h=b[d];if(0<=a.indexOf(h,a.length-h.length)){f.kind=-1;break}}this.code_map_.addLibrary(e,f)},findCodeKind_:function(a){for(name in CodeKinds)if(0<=CodeKinds[name].kinds.indexOf(a))return CodeKinds[name]},
275 nameForCodeEntry_:function(a){return a?a.name:"UnknownCode"},processTickEvent_:function(a,b,f,d,h,k,l){b=this.code_map_.findEntry(a);b=this.nameForCodeEntry_(b);f/=1E3;this.v8_samples_thread_.addSample("v8",b,f);if(l&&l.length)for(a=0;8>a&&l[a];a++)b=this.code_map_.findEntry(l[a]),b=this.nameForCodeEntry_(b),d=tracing.getStringColorId(b),b=new tracing.trace_model.Slice("v8",b,d,f,{},0),this.v8_stack_thread_.sliceGroup.pushSlice(b)},processDistortion_:function(a){distortion_per_entry=a/1E6},processPlotRange_:function(a,
276 b){xrange_start_override=a;xrange_end_override=b},importEvents:function(){var a=new tracing.importer.v8.LogReader({"timer-event":{parsers:[null,parseInt,parseInt],processor:this.processTimerEvent_.bind(this)},"shared-library":{parsers:[null,parseInt,parseInt],processor:this.processSharedLibrary_.bind(this)},"timer-event-start":{parsers:[null,parseInt],processor:this.processTimerEventStart_.bind(this)},"timer-event-end":{parsers:[null,parseInt],processor:this.processTimerEventEnd_.bind(this)},"code-creation":{parsers:[null,
278 this.v8_timer_thread_=this.model_.getOrCreateProcess(-32).getOrCreateThread(1);this.v8_timer_thread_.name="V8 Timers";this.v8_stack_thread_=this.model_.getOrCreateProcess(-32).getOrCreateThread(2);this.v8_stack_thread_.name="V8 JavaScript";this.v8_samples_thread_=this.model_.getOrCreateProcess(-32).getOrCreateThread(3);this.v8_samples_thread_.name="V8 PC";for(var b=this.logData_.split("\n"),f=0;f<b.length;f++)a.processLogLine(b[f])},finalizeImport:function(){},joinRefs:function(){}};tracing.TraceModel.registerImporter(d);
279 return{V8LogImporter:d}});"use strict";base.require("tracing.importer.linux_perf_importer");base.require("tracing.importer.trace_event_importer");base.require("tracing.importer.v8_log_importer");"use strict";base.exportTo("tracing.analysis",function(){return{tsRound:function(d){return Math.round(1E3*d)/1E3}}});"use strict";base.require("base.events");base.require("base.guid");base.require("base.range");
280 base.exportTo("tracing",function(){function d(a,c){this.track=a;this.slice=c}function b(a,c,b){this.track=a;this.counter=c;this.sampleIndex=b}function a(a,c){this.track=a;this.objectSnapshot=c}function c(a,c){this.track=a;this.objectInstance=c}function e(a){this.bounds_dirty_=!0;this.bounds_=new base.Range;this.length_=0;this.guid_=base.GUID.allocate();a&&this.pushHits(a)}d.prototype={get modelObject(){return this.slice},get selected(){return this.slice.selected},set selected(a){this.slice.selected=
287 function(c){a++});return a},map:function(a){for(var c=0;c<this.length_;c++)a(this[c])},getShiftedSelection:function(a){for(var c=new e,b=0;b<this.length_;b++){var f=this[b];f.track.addItemNearToProvidedHitToSelection(f,a,c)}return 0==c.length?void 0:c}};return{SelectionSliceHit:d,SelectionCounterSampleHit:b,SelectionObjectSnapshotHit:a,SelectionObjectInstanceHit:c,Selection:e,createSelectionFromObjectAndView:function(a,c){var b=new e;if(a instanceof tracing.trace_model.Slice)b.addSlice(void 0,a);
288 else if(a instanceof tracing.trace_model.ObjectSnapshot)b.addObjectSnapshot(void 0,a);else if(a instanceof tracing.trace_model.ObjectInstance)b.addObjectInstance(void 0,a);else throw Error("Unrecognized selection type");return b}}});"use strict";
291 for(var a=d;a.parentNode;){if(a==b)return!0;a=a.parentNode}return!1}}});"use strict";base.requireStylesheet("tracing.analysis.analysis_link");base.require("base.events");base.require("tracing.selection");base.require("tracing.analysis.util");base.require("ui");
292 base.exportTo("tracing.analysis",function(){var d=tracing.analysis.tsRound,b=base.Event.bind(void 0,"requestSelectionChange",!0,!1),a=ui.define("a");a.prototype={__proto__:HTMLAnchorElement.prototype,decorate:function(){this.classList.add("analysis-link");this.selectionGenerator;this.addEventListener("click",this.onClicked_.bind(this))},onClicked_:function(){var a=new b;a.selection=this.selectionGenerator();this.dispatchEvent(a)}};var c=ui.define("object-snapshot-link",a);c.prototype={__proto__:a.prototype,
293 decorate:function(){a.prototype.decorate.apply(this)},set objectSnapshot(a){this.textContent=a.objectInstance.typeName+" "+a.objectInstance.id+" @ "+d(a.ts)+" ms";this.selectionGenerator=function(){return tracing.createSelectionFromObjectAndView(a,this)}.bind(this)}};var e=ui.define("object-instance-link",a);e.prototype={__proto__:a.prototype,decorate:function(){a.prototype.decorate.apply(this)},set objectInstance(a){this.textContent=a.typeName+" "+a.id;this.selectionGenerator=function(){return tracing.createSelectionFromObjectAndView(a,
294 this)}.bind(this)}};return{RequestSelectionChangeEvent:b,AnalysisLink:a,ObjectSnapshotLink:c,ObjectInstanceLink:e}});"use strict";base.requireStylesheet("tracing.analysis.generic_object_view");base.require("base.utils");base.require("tracing.analysis.analysis_link");base.require("ui");
295 base.exportTo("tracing.analysis",function(){var d=ui.define("x-generic-object-view");d.prototype={__proto__:HTMLUnknownElement.prototype,decorate:function(){this.object_=void 0},get object(){return this.object_},set object(b){this.object_=b;this.updateContents_()},updateContents_:function(){this.textContent="";this.appendElementsForType_("",this.object_,0,0,5,"")},appendElementsForType_:function(b,a,c,e,f,d){e>f?this.appendSimpleText_(b,c,"<recursion limit reached>",d):void 0===a?this.appendSimpleText_(b,
296 c,"undefined",d):null===a?this.appendSimpleText_(b,c,"null",d):a instanceof Object?a instanceof tracing.trace_model.ObjectSnapshot?(e=new tracing.analysis.ObjectSnapshotLink(a),e.objectSnapshot=a,this.appendElementWithLabel_(b,c,e,d)):a instanceof tracing.trace_model.ObjectInstance?(e=new tracing.analysis.ObjectInstanceLink(a),e.objectInstance=a,this.appendElementWithLabel_(b,c,e,d)):a instanceof Array?this.appendElementsForArray_(b,a,c,e,f,d):this.appendElementsForObject_(b,a,c,e,f,d):"string"==
299 tracing.analysis.analysis_results");base.require("tracing.analysis.util");base.require("tracing.analysis.analysis_link");base.require("tracing.analysis.generic_object_view");base.require("ui");
300 base.exportTo("tracing.analysis",function(){var d=ui.define("div");d.prototype={__proto__:HTMLDivElement.prototype,decorate:function(){this.className="analysis-results"},clear:function(){this.textContent=""},createSelectionChangingLink:function(b,a,c){var e=this.ownerDocument.createElement("a");tracing.analysis.AnalysisLink.decorate(e);e.textContent=b;e.selectionGenerator=a;c&&(e.title=c);return e},appendElement_:function(b,a,c){a=b.ownerDocument.createElement(a);b.appendChild(a);void 0!=c&&(a.textContent=
303 c?(a=new tracing.analysis.GenericObjectView,a.object=c,a.classList.add("analysis-table-col-1"),a.style.display="table-cell",e.appendChild(a)):this.appendTableCell_(b,e,1,"");for(c=2;c<b.numColumns;c++)this.appendTableCell_(b,e,c,"")},appendSpacingRow:function(b){var a=this.appendElement_(b,"tr");a.className="analysis-table-row";for(var c=0;c<b.numColumns;c++)this.appendTableCell_(b,a,c," ")},appendSummaryRowTime:function(b,a,c){this.appendSummaryRow(b,a,tracing.analysis.tsRound(c)+" ms")},appendDataRow:function(b,
304 a,c,e,f,d){var h=void 0;f&&(h="Min Duration:\t"+tracing.analysis.tsRound(f.min)+" ms \rMax Duration:\t"+tracing.analysis.tsRound(f.max)+" ms \rAvg Duration:\t"+tracing.analysis.tsRound(f.avg)+" ms (\u03c3 = "+tracing.analysis.tsRound(f.avg_stddev)+")",f.start&&(h+="\rStart Time:\t"+tracing.analysis.tsRound(f.start)+" ms"),f.end&&(h+="\rEnd Time:\t"+tracing.analysis.tsRound(f.end)+" ms"),f.frequency&&f.frequency_stddev&&(h+="\rFrequency:\t"+tracing.analysis.tsRound(f.frequency)+" occurrences/s (\u03c3 = "+
305 tracing.analysis.tsRound(f.frequency_stddev)+")"));f=this.appendElement_(b,"tr");f.className="analysis-table-row";if(d){var k=this.appendTableCellWithTooltip_(b,f,0,a,h);k.textContent="";k.appendChild(this.createSelectionChangingLink(a,d,h))}else this.appendTableCellWithTooltip_(b,f,0,a,h);void 0!==c?c instanceof Array?this.appendTableCellWithTooltip_(b,f,1,"["+c.join(", ")+"]",h):this.appendTableCellWithTooltip_(b,f,1,tracing.analysis.tsRound(c)+" ms",h):this.appendTableCell_(b,f,1,"");void 0!==
306 e?this.appendTableCellWithTooltip_(b,f,2,String(e)+" occurrences",h):this.appendTableCell_(b,f,2,"")}};return{AnalysisResults:d}});"use strict";base.require("tracing.analysis.util");base.require("ui");
307 base.exportTo("tracing.analysis",function(){return{analyzeSingleCounterSampleHit:function(d,b){for(var a=b.counter,c=b.sampleIndex,e=[],f=0;f<a.numSeries;++f)e.push(a.getSeries(f).getSample(c).value);var g=d.appendTable("analysis-counter-table",2);d.appendTableHeader(g,"Selected counter:");d.appendSummaryRow(g,"Title",a.name);d.appendSummaryRowTime(g,"Timestamp",a.timestamps[c]);for(f=0;f<a.numSeries;f++)d.appendSummaryRow(g,a.getSeries(f).name,e[f])},analyzeMultipleCounterSampleHits:function(d,b){for(var a=
308 {},c=0;c<b.length;c++){var e=b[c].counter;a[e.guid]||(a[e.guid]=[]);a[e.guid].push(b[c])}var f=d.appendTable("analysis-counter-table",2);d.appendTableHeader(f,"Counters:");for(var g in a){for(var h=a[g],e=h[0].counter,k=[],c=0;c<h.length;c++)k.push(h[c].sampleIndex);h=e.getSampleStatistics(k);for(c=0;c<h.length;c++){for(var l=[],m=0;m<k.length;++m)l.push(e.getSeries(c).getSample(k[m]).value);d.appendDataRow(f,e.name+": series("+e.getSeries(c).name+")",l,l.length,h[c])}}}}});"use strict";base.requireStylesheet("tracing.analysis.analyze_slices");
309 base.require("tracing.analysis.util");base.require("ui");
310 base.exportTo("tracing.analysis",function(){function d(b,a){var c=a.slice,e=b.appendTable("analysis-slice-table",2);b.appendTableHeader(e,"Selected slice:");b.appendSummaryRow(e,"Title",c.title);c.category&&b.appendSummaryRow(e,"Category",c.category);b.appendSummaryRowTime(e,"Start",c.start);b.appendSummaryRowTime(e,"Duration",c.duration);c.durationInUserTime&&b.appendSummaryRowTime(e,"Duration (U)",c.durationInUserTime);var f=0,d;for(d in c.args)f+=1;if(0<f)for(d in b.appendSummaryRow(e,"Args"),
313 s.frequency-1E3/(c.hits[g].slice.start-c.hits[g-1].slice.start),r+=u*u;s.frequency_stddev=Math.sqrt(r/(h-1))}b.appendDataRow(l,a,e,c.hits.length,s,function(){return new tracing.Selection(c.hits)});if(1===f)for(g=0;g<c.hits.length;g++)d(b,c.hits[g])});1!==f&&(b.appendDataRow(l,"*Totals",m,a.length),b.appendSpacingRow(l));b.appendSummaryRowTime(l,"Selection start",c);b.appendSummaryRowTime(l,"Selection extent",e-c)}}});"use strict";base.require("tracing.analysis.analyze_counters");base.require("tracing.analysis.analyze_slices");
314 base.require("tracing.analysis.util");base.require("ui");
315 base.exportTo("tracing.analysis",function(){function d(a,c){var e=c.slices,f=c.counterSamples,d=new tracing.Selection;d.addSelection(c.objectSnapshots);d.addSelection(c.objectInstances);1==e.length?tracing.analysis.analyzeSingleSliceHit(a,e[0]):1<e.length&&tracing.analysis.analyzeMultipleSliceHits(a,e);1==f.length?tracing.analysis.analyzeSingleCounterSampleHit(a,f[0]):1<f.length&&tracing.analysis.analyzeMultipleCounterSampleHits(a,f);d.length&&b(a,d)}function b(a,c){c=base.asArray(c).sort(base.Range.compareByMinTimes);
316 var b=a.appendTable("analysis-object-sample-table",2);a.appendTableHeader(b,"Selected Objects:");c.forEach(function(c){var d=a.appendTableRow(b),h,k,l;if(c instanceof tracing.SelectionObjectSnapshotHit){var m=c.objectSnapshot;h=tracing.analysis.tsRound(m.ts);k=m.objectInstance.typeName+" "+m.objectInstance.id;l=function(){var a=new tracing.Selection;a.addObjectSnapshot(c.track,m);return a}}else{var n=c.objectInstance;h=n.deletionTs==Number.MAX_VALUE?"":tracing.analysis.tsRound(n.deletionTs);h=tracing.analysis.tsRound(n.creationTs)+
317 "-"+h;k=n.typeName+" "+n.id;l=function(){var a=new tracing.Selection;a.addObjectInstance(c.track,n);return a}}a.appendTableCell(b,d,h);a.appendTableCell(b,d,"").appendChild(a.createSelectionChangingLink(k,l))})}return{analyzeSelection:function(a,c){d(a,c.getHitsOrganizedByType())},analyzeHitsByType:d}});"use strict";base.require("ui");
318 base.exportTo("tracing.analysis",function(){var d=ui.define("object-instance-view");d.prototype={__proto__:HTMLDivElement.prototype,decorate:function(){this.objectInstance_=void 0},set modelObject(b){this.objectInstance=b},get modelObject(){return this.objectInstance},get objectInstance(){return this.objectInstance_},set objectInstance(b){this.objectInstance_=b;this.updateContents()},updateContents:function(){throw Error("Not implemented");}};d.typeNameToViewInfoMap={};d.register=function(b,a,c){if(d.typeNameToViewInfoMap[b])throw Error("Handler already registerd for "+
320 base.exportTo("tracing.analysis",function(){var d=ui.define("object-snapshot-view");d.prototype={__proto__:HTMLDivElement.prototype,decorate:function(){this.objectSnapshot_=void 0},set modelObject(b){this.objectSnapshot=b},get modelObject(){return this.objectSnapshot},get objectSnapshot(){return this.objectSnapshot_},set objectSnapshot(b){this.objectSnapshot_=b;this.updateContents()},updateContents:function(){throw Error("Not implemented");}};d.typeNameToViewInfoMap={};d.register=function(b,a,c){if(d.typeNameToViewInfoMap[b])throw Error("Handler already registered for "+
321 b);d.typeNameToViewInfoMap[b]={constructor:a,options:c||{showInTrackView:!0}}};d.unregister=function(b){if(void 0===d.typeNameToViewInfoMap[b])throw Error(b+" not registered");delete d.typeNameToViewInfoMap[b]};d.getViewInfo=function(b){return d.typeNameToViewInfoMap[b]};return{ObjectSnapshotView:d}});"use strict";base.requireStylesheet("tracing.analysis.default_object_view");base.require("tracing.analysis.analysis_link");base.require("tracing.analysis.object_instance_view");base.require("tracing.analysis.object_snapshot_view");
322 base.require("tracing.analysis.util");
323 base.exportTo("tracing.analysis",function(){var d=tracing.analysis.tsRound,b=ui.define("default-object-snapshot-view",tracing.analysis.ObjectSnapshotView);b.prototype={__proto__:tracing.analysis.ObjectSnapshotView.prototype,decorate:function(){tracing.analysis.ObjectSnapshotView.prototype.decorate.apply(this);this.classList.add("default-object-view");this.classList.add("default-object-snapshot-view")},updateContents:function(){var a=this.objectSnapshot;if(a){var b=a.objectInstance,f;f=""+('<div class="title">Snapshot of <a id="instance-link"></a> @ '+
324 d(a.ts)+"ms</div>\n");f+="<table><tr>";f+='<tr><td>args:</td><td id="args"></td></tr>\n';this.innerHTML=f+="</table>";f=new tracing.analysis.ObjectInstanceLink;f.objectInstance=b;b=this.querySelector("#instance-link");b.parentElement.replaceChild(f,b);this.querySelector("#args").textContent=JSON.stringify(a.args,null,2)}else this.textContent=""}};var a=ui.define("default-object-instance-view",tracing.analysis.ObjectInstanceView);a.prototype={__proto__:tracing.analysis.ObjectInstanceView.prototype,
325 decorate:function(){tracing.analysis.ObjectInstanceView.prototype.decorate.apply(this);this.classList.add("default-object-view");this.classList.add("default-object-instance-view")},updateContents:function(){var a=this.objectInstance;if(a){var b;b=""+('<div class="title">'+a.typeName+" "+a.id+"</div>\n");b+="<table><tr>";b+="<tr><td>creationTs:</td><td>"+a.creationTs+"</td></tr>\n";b=a.deletionTs!=Number.MAX_VALUE?b+("<tr><td>deletionTs:</td><td>"+a.deletionTs+"</td></tr>\n"):b+"<tr><td>deletionTs:</td><td>not deleted</td></tr>\n";
326 b+='<tr><td>snapshots:</td><td id="snapshots"></td></tr>\n';this.innerHTML=b+="</table>";var d=this.querySelector("#snapshots");a.snapshots.forEach(function(a){var c=new tracing.analysis.ObjectSnapshotLink;c.objectSnapshot=a;d.appendChild(c)})}else this.textContent=""}};return{DefaultObjectSnapshotView:b,DefaultObjectInstanceView:a}});"use strict";base.require("ui");
327 base.exportTo("tracing.analysis",function(){var d=ui.define("slice-view");d.prototype={__proto__:HTMLDivElement.prototype,decorate:function(){this.objectInstance_=void 0},set modelObject(b){this.slice=b},get modelObject(){return this.slice},get slice(){return this.slice_},set slice(b){this.slice_=b;this.updateContents()},updateContents:function(){throw Error("Not implemented");}};d.titleToViewInfoMap={};d.register=function(b,a){if(d.titleToViewInfoMap[b])throw Error("Handler already registerd for "+
328 b);d.titleToViewInfoMap[b]={constructor:a}};d.unregister=function(b){if(void 0===d.titleToViewInfoMap[b])throw Error(b+" not registered");delete d.titleToViewInfoMap[b]};d.getViewInfo=function(b){return d.titleToViewInfoMap[b]};return{SliceView:d}});"use strict";base.requireStylesheet("tracing.analysis.analysis_view");base.require("base.guid");base.require("tracing.analysis.analysis_results");base.require("tracing.analysis.analyze_selection");base.require("tracing.analysis.default_object_view");base.require("tracing.analysis.object_instance_view");
329 base.require("tracing.analysis.object_snapshot_view");base.require("tracing.analysis.slice_view");base.require("tracing.analysis.util");base.require("ui");
330 base.exportTo("tracing.analysis",function(){var d=ui.define("div");d.prototype={__proto__:HTMLDivElement.prototype,decorate:function(){this.className="analysis-view";this.currentSelection_=this.currentView_=void 0;this.selections_=[];this.guid_=base.GUID.allocate();window.addEventListener("popstate",this.onPopState.bind(this))},changeViewType:function(b){if(!(this.currentView_ instanceof b)){this.textContent="";try{this.currentView_=new b,this.appendChild(this.currentView_)}catch(a){throw this.currentView_=
331 void 0,a;}this.currentView_ instanceof tracing.analysis.AnalysisResults?this.classList.remove("viewing-object"):this.classList.add("viewing-object")}},get currentView(){return this.currentView_},get selection(){return this.currentSelection_},set selection(b){this.selections_.push(b);window.history.pushState({view_guid:this.guid_,selection_guid:b.guid});this.processSelection(b)},clearSelectionHistory:function(){this.selections_=[]},onPopState:function(b){if(null!==b.state&&b.state.view_guid===this.guid_){var a;
332 for(a=0;a<this.selections_.length&&this.selections_[a].guid!==b.state.selection_guid;++a);a>=this.selections_.length||(this.processSelection(this.selections_[a]),b.stopPropagation())}},processSelection:function(b){var a=b.getHitsOrganizedByType();1==b.length&&0==a.counterSamples.length&&this.tryToProcessSelectionUsingCustomViewer(b[0])||(this.changeViewType(tracing.analysis.AnalysisResults),this.currentView.clear(),this.currentSelection_=b,tracing.analysis.analyzeHitsByType(this.currentView,a))},
333 tryToProcessSelectionUsingCustomViewer:function(b){var a,c,e;a=b.modelObject;if(b instanceof tracing.SelectionObjectSnapshotHit)c=a.objectInstance.typeName,e=tracing.analysis.ObjectSnapshotView,b=tracing.analysis.DefaultObjectSnapshotView;else if(b instanceof tracing.SelectionObjectInstanceHit)c=a.typeName,e=tracing.analysis.ObjectInstanceView,b=tracing.analysis.DefaultObjectInstanceView;else if(b instanceof tracing.SelectionSliceHit)c=a.title,e=tracing.analysis.SliceView,b=void 0;else return!1;b=
347 !1;a.preventDefault()}}};return{Overlay:b}});"use strict";base.requireTemplate("tracing.category_filter_dialog");base.require("base.utils");base.require("tracing.filter");base.require("ui.overlay");
348 base.exportTo("tracing",function(){var d=ui.define("div");d.prototype={__proto__:ui.Overlay.prototype,decorate:function(){ui.Overlay.prototype.decorate.call(this);this.className="view-category-filter-overlay";this.obeyCloseEvents=!0;var b=base.instantiateTemplate("#view-category-filter-dialog-template");this.appendChild(b);this.formEl_=this.querySelector("form");this.categoriesEl_=this.querySelector(".categories");this.addEventListener("visibleChange",this.onVisibleChange_.bind(this))},set categories(b){this.categories_=
350 var d=document.createElement("label");d.textContent=c;d.setAttribute("for",c);c=document.createElement("div");c.appendChild(e);c.appendChild(d);this.categoriesEl_.appendChild(c)}},updateSetting_:function(b){void 0!==this.settingUpdatedCallback_&&this.settingUpdatedCallback_(this.unselectedCategories_())}};return{CategoryFilterDialog:d}});"use strict";base.exportTo("tracing",function(){return{mouseModeConstants:{MOUSE_MODE_SELECTION:1,MOUSE_MODE_PANSCAN:2,MOUSE_MODE_ZOOM:3}}});"use strict";base.require("base.events");
351 base.exportTo("tracing",function(){function d(a){this.parentEl_=a;this.modelTrackContainer_=null;this.scaleX_=1;this.gridTimebase_=this.panY_=this.panX_=0;this.gridStep_=1E3/60;this.hasCalledSetupFunction_=this.gridEnabled_=!1;this.onResize_=this.onResize_.bind(this);this.onModelTrackControllerScroll_=this.onModelTrackControllerScroll_.bind(this);this.checkForAttachInterval_=setInterval(this.checkForAttach_.bind(this),250);this.markers=[]}function b(a,c){this.viewport_=a;this.positionWorld_=c;this.selected_=
368 "use strict";base.requireStylesheet("tracing.tracks.track");base.require("ui");base.require("ui.container_that_decorates_its_children");base.require("tracing.color_scheme");
369 base.exportTo("tracing.tracks",function(){var d=tracing.getColorPaletteHighlightIdBoost(),b=ui.define("track",ui.ContainerThatDecoratesItsChildren);b.prototype={__proto__:ui.ContainerThatDecoratesItsChildren.prototype,decorate:function(a){ui.ContainerThatDecoratesItsChildren.prototype.decorate.call(this);if(void 0===a)throw Error("viewport is required when creating a Track.");this.viewport_=a;this.classList.add("track");this.categoryFilter_=void 0},get viewport(){return this.viewport_},context:function(){if(this.parentNode){if(!this.parentNode.context)throw Error("Parent container does not support context() method.");
372 h);h=this.getBoundingClientRect();b=Math.max(b,h.top);d=Math.min(d,h.bottom);b>d||this.addIntersectingItemsInRangeToSelectionInWorldSpace(a,c,k,g)},addIntersectingItemsInRangeToSelectionInWorldSpace:function(a,c,b,d){},drawInstantEvents_:function(a,c,b){var f=this.context(),g=window.devicePixelRatio||1,g=this.getBoundingClientRect().height*g,h=this.viewport,k=h.xViewVectorToWorld(1),l=tracing.getColorPalette();f.save();h.applyTransformToCanvas(f);h=new tracing.FastRectRenderer(f,2*k,2*k,l);h.setYandH(0,
373 g);for(c=base.findLowIndexInSortedArray(a,function(a){return a.start},c);c<a.length;++c){var m=a[c],n=m.start;if(n>b)break;Math.max(m.duration,0.001);m=m.selected?m.colorId+d:m.colorId;0.001<k?h.fillRect(n,k,m):(f.fillStyle=l[m],f.beginPath(),f.moveTo(n-4*k,g),f.lineTo(n,0),f.lineTo(n+4*k,g),f.closePath(),f.fill())}h.flush();f.restore()}};return{Track:b}});"use strict";base.requireStylesheet("tracing.tracks.drawing_container");base.require("base.raf");base.require("tracing.tracks.track");base.require("ui");
374 base.exportTo("tracing.tracks",function(){var d={SLICE:1,INSTANT_EVENT:2},b=ui.define("drawing-container",tracing.tracks.Track);b.prototype={__proto__:tracing.tracks.Track.prototype,decorate:function(a){tracing.tracks.Track.prototype.decorate.call(this,a);this.classList.add("drawing-container");this.canvas_=document.createElement("canvas");this.canvas_.className="drawing-container-canvas";this.canvas_.style.left=tracing.constants.HEADING_WIDTH+"px";this.appendChild(this.canvas_);this.ctx_=this.canvas_.getContext("2d");
376 0;a<this.children.length;++a)this.children[a]instanceof tracing.tracks.Track&&this.children[a].drawTrack(d.INSTANT_EVENT);for(a=0;a<this.children.length;++a)this.children[a]instanceof tracing.tracks.Track&&this.children[a].drawTrack(d.SLICE);var c=window.devicePixelRatio||1,b=this.canvas_.getBoundingClientRect(),a=this.viewport.xViewToWorld(0),c=this.viewport.xViewToWorld(b.width*c);this.viewport.drawGridLines(this.ctx_,a,c);this.viewport.drawMarkerLines(this.ctx_,a,c)},this)},this))},updateCanvasSizeIfNeeded_:function(){var a=
377 base.asArray(this.children).filter(this.visibleFilter_),b=this.getBoundingClientRect(),e=a[0].getBoundingClientRect(),d=a[a.length-1].getBoundingClientRect(),a=e.width-tracing.constants.HEADING_WIDTH,d=d.bottom-e.top,g=window.devicePixelRatio||1;this.canvas_.width!=a*g&&(this.canvas_.width=a*g,this.canvas_.style.width=a+"px");this.canvas_.height!=d*g&&(this.canvas_.height=d*g,this.canvas_.style.height=d+"px");b=e.top-b.top+this.scrollTop;this.canvas_.style.top+"px"!==b&&(this.canvas_.style.top=b+
378 "px")},visibleFilter_:function(a){return a instanceof tracing.tracks.Track?"none"!==window.getComputedStyle(a).display:!1}};return{DrawingContainer:b,DrawType:d}});"use strict";base.exportTo("tracing",function(){return{constants:{HEADING_WIDTH:250}}});"use strict";base.requireStylesheet("tracing.tracks.heading_track");base.require("tracing.constants");base.require("tracing.tracks.track");base.require("ui");
379 base.exportTo("tracing.tracks",function(){var d=ui.define("heading-track",tracing.tracks.Track);d.prototype={__proto__:tracing.tracks.Track.prototype,decorate:function(b){tracing.tracks.Track.prototype.decorate.call(this,b);this.classList.add("heading-track");this.headingDiv_=document.createElement("heading");this.headingDiv_.style.width=tracing.constants.HEADING_WIDTH+"px";this.appendChild(this.headingDiv_)},get heading(){return this.headingDiv_.textContent},set heading(b){this.headingDiv_.textContent=
380 b},set tooltip(b){this.headingDiv_.title=b},draw:function(b,a,c){throw Error("draw implementation missing");}};return{HeadingTrack:d}});"use strict";base.requireStylesheet("tracing.tracks.ruler_track");base.require("tracing.constants");base.require("tracing.tracks.track");base.require("tracing.tracks.heading_track");base.require("ui");
381 base.exportTo("tracing.tracks",function(){var d=ui.define("ruler-track",tracing.tracks.HeadingTrack),b=Math.log(10);d.prototype={__proto__:tracing.tracks.HeadingTrack.prototype,decorate:function(a){tracing.tracks.HeadingTrack.prototype.decorate.call(this,a);this.classList.add("ruler-track");this.strings_secs_=[];this.strings_msecs_=[];this.addEventListener("mousedown",this.onMouseDown);this.viewportMarkersChange_=this.viewportMarkersChange_.bind(this);a.addEventListener("markersChange",this.viewportMarkersChange_)},
382 detach:function(){tracing.tracks.HeadingTrack.prototype.detach.call(this);this.viewport.removeEventListener("markersChange",this.viewportMarkersChange_)},viewportMarkersChange_:function(){2>this.viewport.markers.length?this.classList.remove("ruler-track-with-distance-measurements"):this.classList.add("ruler-track-with-distance-measurements")},onMouseDown:function(a){0===a.button&&this.placeAndBeginDraggingMarker(a.clientX)},placeAndBeginDraggingMarker:function(a){var b=window.devicePixelRatio||1;
383 a=this.viewport.xViewToWorld((a-this.offsetLeft-tracing.constants.HEADING_WIDTH)*b);var e=this.viewport.findMarkerNear(a,6),d=!1,g=!1;e||(e=this.viewport.addMarker(a),d=!0);e.selected=!0;var h=function(a){a=this.viewport.xViewToWorld((a.clientX-this.offsetLeft-tracing.constants.HEADING_WIDTH)*b);e.positionWorld=a;g=!0}.bind(this),k=function(a){e.selected=!1;g||d||this.viewport.removeMarker(e);document.removeEventListener("mouseup",k);document.removeEventListener("mousemove",h)}.bind(this);document.addEventListener("mouseup",
384 k);document.addEventListener("mousemove",h)},drawLine_:function(a,b,e,d,g,h){a.beginPath();a.moveTo(b,e);a.lineTo(d,g);a.closePath();a.strokeStyle=h;a.stroke()},drawArrow_:function(a,b,e,d,g,h,k){this.drawLine_(a,b,e,d,g,k);var l=d-b,m=g-e,n=Math.sqrt(l*l+m*m),p=(n-10)/n;b+=p*l;e+=p*m;m=m/n*h;h*=-(l/n);a.beginPath();a.fillStyle=k;a.moveTo(b+m,e+h);a.lineTo(d,g);a.lineTo(b-m,e-h);a.lineTo(b+m,e+h);a.closePath();a.fill()},draw:function(a,b,e){switch(a){case tracing.tracks.DrawType.SLICE:this.drawSlices_(b,
390 this.iframe_=b;this.iframe_.contentDocument.body.style.cssText="padding:0;margin:0;overflow:hidden";for(var b=document.querySelectorAll("link[rel=stylesheet]"),a=0;a<b.length;a++){var c=b[a],e=this.iframe_.contentDocument.createElement("link");e.rel="stylesheet";e.href=c.href;this.iframe_.contentDocument.head.appendChild(e)}},detach:function(){document.body.removeChild(this.iframe_);this.iframe_=void 0}};return{MeasuringStick:d}});"use strict";base.require("tracing.tracks.track");base.require("tracing.filter");
392 base.exportTo("tracing.tracks",function(){var d=ui.define("container-track",tracing.tracks.Track);d.prototype={__proto__:tracing.tracks.Track.prototype,decorate:function(b){tracing.tracks.Track.prototype.decorate.call(this,b)},detach:function(){this.textContent=""},get tracks_(){for(var b=[],a=0;a<this.children.length;a++)this.children[a].classList.contains("track")&&b.push(this.children[a]);return b},drawTrack:function(b){for(var a=0;a<this.children.length;++a)this.children[a]instanceof tracing.tracks.Track&&
393 this.children[a].drawTrack(b)},addIntersectingItemsInRangeToSelection:function(b,a,c,e,d){for(var g=0;g<this.tracks_.length;g++){var h=this.tracks_[g].getBoundingClientRect(),k=Math.max(c,h.top),h=Math.min(e,h.bottom);k<=h&&this.tracks_[g].addIntersectingItemsInRangeToSelection(b,a,c,e,d)}tracing.tracks.Track.prototype.addIntersectingItemsInRangeToSelection.apply(this,arguments)},addAllObjectsMatchingFilterToSelection:function(b,a){for(var c=0;c<this.tracks_.length;c++)this.tracks_[c].addAllObjectsMatchingFilterToSelection(b,
395 base.exportTo("tracing",function(){function d(b,a,c,e){this.ctx_=b;this.minRectSize_=a;this.maxMergeDist_=c;this.pallette_=e}d.prototype={y_:0,h_:0,merging_:!1,mergeStartX_:0,mergeCurRight_:0,setYandH:function(b,a){this.flush();this.y_=b;this.h_=a},fillRect:function(b,a,c){var e=b+a;a<this.minRectSize_?(e-this.mergeStartX_>this.maxMergeDist_&&this.flush(),this.merging_?(this.mergeCurRight_=e,this.mergedColorId=Math.max(this.mergedColorId,c)):(this.merging_=!0,this.mergeStartX_=b,this.mergeCurRight_=
396 e,this.mergedColorId=c)):(this.merging_&&this.flush(),this.ctx_.fillStyle=this.pallette_[c],this.ctx_.fillRect(b,this.y_,a,this.h_))},flush:function(){this.merging_&&(this.ctx_.fillStyle=this.pallette_[this.mergedColorId],this.ctx_.fillRect(this.mergeStartX_,this.y_,this.mergeCurRight_-this.mergeStartX_,this.h_),this.merging_=!1)}};return{FastRectRenderer:d}});"use strict";base.requireStylesheet("tracing.tracks.slice_track");base.require("base.sorted_array_utils");base.require("tracing.tracks.heading_track");
397 base.require("tracing.fast_rect_renderer");base.require("tracing.color_scheme");base.require("ui");
398 base.exportTo("tracing.tracks",function(){function d(){}function b(a,b){this.string=a;this.width=b}var a=tracing.getColorPalette(),c=ui.define("slice-track",tracing.tracks.HeadingTrack);c.prototype={__proto__:tracing.tracks.HeadingTrack.prototype,SHOULD_ELIDE_TEXT:!0,decorate:function(a){tracing.tracks.HeadingTrack.prototype.decorate.call(this,a);this.classList.add("slice-track");this.elidedTitleCache=new d;this.asyncStyle_=!1;this.slices_=null},get asyncStyle(){return this.asyncStyle_},set asyncStyle(a){this.asyncStyle_=
399 !!a},get slices(){return this.slices_},set slices(a){this.slices_=a||[]},get height(){return window.getComputedStyle(this).height},set height(a){this.style.height=a},get hasVisibleContent(){return 0<this.slices.length},labelWidth:function(a){var b=this.context(),c=f[a];c||(c=b.measureText(a).width,f[a]=c);return c+2},labelWidthWorld:function(a,b){return this.labelWidth(a)*b},draw:function(a,b,c){switch(a){case tracing.tracks.DrawType.SLICE:this.drawSlices_(b,c)}},drawSlices_:function(b,c){var d=this.context(),
400 f=window.devicePixelRatio||1,g=this.getBoundingClientRect().height*f,p=this.viewport,q=p.xViewVectorToWorld(1);d.save();p.applyTransformToCanvas(d);this.asyncStyle_&&(d.globalAlpha=0.25);var t=new tracing.FastRectRenderer(d,2*q,2*q,a);t.setYandH(0,g);for(var v=this.slices_,w=base.findLowIndexInSortedArray(v,function(a){return a.start+a.duration},b),s=w;s<v.length;++s){var r=v[s],u=r.start;if(u>c)break;var x=Math.max(r.duration,0.001),y=r.selected?r.colorId+e:r.colorId;x<q&&(x=q);0<r.duration?t.fillRect(u,
404 b.addSlice(this,this.slices_[c]);this.decorateHit(e)}}};var e=tracing.getColorPaletteHighlightIdBoost(),f={},g={};d.prototype={get:function(a,c,e,d,f){var p=g[e];p||(p={},g[e]=p);d=p[c];d||(p[c]={},d=p[c]);p=d[f];if(void 0===p){for(p=!1;a.labelWidthWorld(e,c)>f&&!(1>0.75*e.length);)e=e.substring(0,0.75*e.length),p=!0;p&&3<e.length&&(e=e.substring(0,e.length-3)+"...");p=new b(e,a.labelWidth(e));d[f]=p}return p}};return{SliceTrack:c}});"use strict";base.require("tracing.tracks.container_track");base.require("tracing.tracks.slice_track");
405 base.require("tracing.filter");base.require("tracing.trace_model");base.require("ui");
406 base.exportTo("tracing.tracks",function(){var d=ui.define("cpu-track",tracing.tracks.ContainerTrack);d.prototype={__proto__:tracing.tracks.ContainerTrack.prototype,decorate:function(b){tracing
407 updateContents_:function(){this.detach();if(this.cpu_){var b=tracing.filterSliceArray(this.categoryFilter_,this.cpu_.slices);if(b.length){var a=new tracing.tracks.SliceTrack(this.viewport);a.slices=b;a.heading="CPU "+this.cpu_.cpuNumber+":";this.appendChild(a)}for(var c in this.cpu_.counters){b=this.cpu_.counters[c];if(!this.categoryFilter_.matchCounter(b))break;a=new tracing.tracks.CounterTrack(this.viewport);a.heading="CPU "+this.cpu_.cpuNumber+" "+b.name+":";a.counter=b;a.categoryFilter=this.categoryFilter_;
408 this.appendChild(a)}}}};return{CpuTrack:d}});"use strict";base.requireStylesheet("tracing.tracks.object_instance_track");base.require("base.sorted_array_utils");base.require("tracing.tracks.heading_track");base.require("tracing.color_scheme");base.require("ui");
409 base.exportTo("tracing.tracks",function(){var d=tracing.getColorPalette(),b=tracing.getColorPaletteHighlightIdBoost(),a=ui.define("object-instance-track",tracing.tracks.HeadingTrack);a.prototype={__proto__:tracing.tracks.HeadingTrack.prototype,decorate:function(a){tracing.tracks.HeadingTrack.prototype.decorate.call(this,a);this.classList.add("object-instance-track");this.objectInstances_=[];this.objectSnapshots_=[]},get objectInstances(){return this.objectInstances_},set objectInstances(a){a&&0!=
410 a.length?(this.heading=a[0].typeName,this.objectInstances_=a,this.objectSnapshots_=[],this.objectInstances_.forEach(function(a){this.objectSnapshots_.push.apply(this.objectSnapshots_,a.snapshots)},this)):(this.heading="",this.objectInstances_=[],this.objectSnapshots_=[])},get height(){return window.getComputedStyle(this).height},set height(a){this.style.height=a},get snapshotRadiusView(){return 7*(window.devicePixelRatio||1)},draw:function(a,b,d){switch(a){case tracing.tracks.DrawType.SLICE:this.drawSlices_(b,
414 a.creationTs},a,b,h)},addItemNearToProvidedHitToSelection:function(a,b,d){if(a instanceof tracing.SelectionObjectSnapshotHit){if(a=this.objectSnapshots_.indexOf(a.objectSnapshot),b=a+b,0<=b&&b<this.objectSnapshots_.length)return d.addObjectSnapshot(this,this.objectSnapshots_[b]),!0}else if(a instanceof tracing.SelectionObjectInstanceHit){if(a=this.objectInstances_.indexOf(a.objectInstance),b=a+b,0<=b&&b<this.objectInstances_.length)return d.addObjectInstance(this,this.objectInstances_[b]),!0}else throw Error("Unrecognized hit");
415 return!1},addAllObjectsMatchingFilterToSelection:function(a,b){}};a.typeNameToTrackConstructorMap={};a.register=function(b,e){if(a.typeNameToTrackConstructorMap[b])throw Error("Handler already registered for "+b);a.typeNameToTrackConstructorMap[b]=e};a.getTrackConstructor=function(b){return a.typeNameToTrackConstructorMap[b]};return{ObjectInstanceTrack:a}});"use strict";base.requireStylesheet("tcmalloc.heap_instance_track");base.require("base.sorted_array_utils");base.require("tracing.tracks.heading_track");
416 base.require("tracing.tracks.object_instance_track");base.require("tracing.color_scheme");base.require("ui");
417 base.exportTo("tcmalloc",function(){var d=tracing.getColorPalette(),b=tracing.getColorPaletteHighlightIdBoost(),a=ui.define("heap-instance-track",tracing.tracks.HeadingTrack);a.prototype={__proto__:tracing.tracks.HeadingTrack.prototype,decorate:function(a){tracing.tracks.HeadingTrack.prototype.decorate.call(this,a);this.classList.add("heap-instance-track");this.objectInstance_=null},set objectInstances(a){if(a){if(1!=a.length)throw Error("Bad object instance count.");this.objectInstance_=a[0];this.maxBytes_=
418 this.computeMaxBytes_(this.objectInstance_.snapshots)}else this.objectInstance_=[]},computeMaxBytes_:function(a){for(var b=0,d=0;d<a.length;d++){for(var g=a[d],h=Object.keys(g.heap_.children),k=0,l=0;l<h.length;l++)k+=g.heap_.children[h[l]].currentBytes;k>b&&(b=k)}return b},get height(){return window.getComputedStyle(this).height},set height(a){this.style.height=a},draw:function(a,b,d){switch(a){case tracing.tracks.DrawType.SLICE:this.drawSlices_(b,d)}},drawSlices_:function(a,e){var f=this.context(),
421 a,b,function(a){g.addObjectSnapshot(h,a)})},addItemNearToProvidedHitToSelection:function(a,b,d){if(a instanceof tracing.SelectionObjectSnapshotHit){var g=this.objectInstance_.snapshots;a=g.indexOf(a.objectSnapshot)+b;if(0<=a&&a<g.length)return d.addObjectSnapshot(this,g[a]),!0}else throw Error("Unrecognized hit");return!1},addAllObjectsMatchingFilterToSelection:function(a,b){}};tracing.tracks.ObjectInstanceTrack.register("memory::Heap",a);return{HeapInstanceTrack:a}});"use strict";base.requireStylesheet("tracing.tracks.counter_track");
422 base.require("tracing.tracks.heading_track");base.require("tracing.color_scheme");base.require("ui");
423 base.exportTo("tracing.tracks",function(){var d=tracing.getColorPalette(),b=ui.define("counter-track",tracing.tracks.HeadingTrack);b.prototype={__proto__:tracing.tracks.HeadingTrack.prototype,decorate:function(a){tracing.tracks.HeadingTrack.prototype.decorate.call(this,a);this.classList.add("counter-track");this.selectedSamples_={};this.categoryFilter_=new tracing.Filter},decorateHit:function(a){},get counter(){return this.counter_},set counter(a){this.counter_=a;this.heading=a.name+": "},get categoryFilter(){return this.categoryFilter_},
424 set categoryFilter(a){this.categoryFilter_=a},get selectedSamples(){return this.selectedSamples_},draw:function(a,b,e){switch(a){case tracing.tracks.DrawType.SLICE:this.drawSlices_(b,e)}},drawSlices_:function(a,b){var e=this.context(),f=window.devicePixelRatio||1,f=this.getBoundingClientRect().height*f,g=this.counter_,h=this.viewport,k=h.xViewVectorToWorld(1),l=h.xViewVectorToWorld(1);e.save();h.applyTransformToCanvas(e);for(var h=g.numSeries,m=g.numSamples,n=base.findLowIndexInSortedArray(g.timestamps,
427 g,b);a<=b;a++)0>a||a>=h.timestamps.length||(e=d.addCounterSample(this,this.counter,a),this.decorateHit(e))},addAllObjectsMatchingFilterToSelection:function(a,b){}};return{CounterTrack:b}});"use strict";base.requireStylesheet("tracing.tracks.spacing_track");base.require("tracing.tracks.heading_track");
428 base.exportTo("tracing.tracks",function(){var d=ui.define("spacing-track",tracing.tracks.HeadingTrack);d.prototype={__proto__:tracing.tracks.HeadingTrack.prototype,decorate:function(b){tracing.tracks.HeadingTrack.prototype.decorate.call(this,b);this.classList.add("spacing-track")},draw:function(b,a,c){},addAllObjectsMatchingFilterToSelection:function(b,a){}};return{SpacingTrack:d}});"use strict";base.require("base.sorted_array_utils");base.require("tracing.tracks.container_track");base.require("ui");
429 base.exportTo("tracing.tracks",function(){var d=ui.define("slice-group-track",tracing.tracks.ContainerTrack);d.prototype={__proto__:tracing.tracks.ContainerTrack.prototype,decorate:function(b){tracing.tracks.ContainerTrack.prototype.decorate.call(this,b);this.classList.add("slice-group-track");this.heading_=this.tooltip_=""},get group(){return this.group_},set group(b){this.group_=b;this.updateContents_()},get heading(){return this.heading_},set heading(b){this.heading_=b;this.updateContents_()},
430 get tooltip(){return this.tooltip_},set tooltip(b){this.tooltip_=b;this.updateContents_()},set decorateHit(b){this.decorateHit_=b;this.updateContents_()},addSliceTrack_:function(b){var a=new tracing.tracks.SliceTrack(this.viewport);a.slices=b;a.decorateHit=this.decorateHit_;a.categoryFilter_=this.categoryFilter;this.appendChild(a);return a},get subRows(){return base.asArray(this.children).map(function(b){return b.slices})},get hasVisibleContent(){return 0<this.children.length},updateContents_:function(){if(this.group_){var b=
431 tracing.filterSliceArray(this.categoryFilter,this.group_.slices);if(this.areArrayContentsSame_(this.filteredSlices_,b))this.updateHeadingAndTooltip_();else if(this.filteredSlices_=b,this.detach(),b.length){for(var b=this.buildSubRows_(b),a=0;a<b.length;a++){var c=b[a];c.length&&this.addSliceTrack_(c)}this.updateHeadingAndTooltip_()}}else this.updateHeadingAndTooltip_()},updateHeadingAndTooltip_:function(){this.firstChild&&(this.firstChild.heading=this.heading_,this.firstChild.tooltip=this.tooltip_)},
433 k.subSlices&&k.subSlices.push(d);g=!0;break}}g||e[0].push(d)}return e},areArrayContentsSame_:function(b,a){if(!(b&&a&&b.length&&a.length)||b.length!=a.length)return!1;for(var c=0;c<b.length;++c)if(b[c]!=a[c])return!1;return!0}};return{SliceGroupTrack:d}});"use strict";base.require("tracing.tracks.slice_group_track");base.require("ui");
434 base.exportTo("tracing.tracks",function(){var d=ui.define("async-slice-group-track",tracing.tracks.SliceGroupTrack);d.prototype={__proto__:tracing.tracks.SliceGroupTrack.prototype,decorate:function(b){tracing.tracks.SliceGroupTrack.prototype.decorate.call(this,b);this.classList.add("async-slice-group-track")},addSliceTrack_:function(b){b=tracing.tracks.SliceGroupTrack.prototype.addSliceTrack_.call(this,b);b.asyncStyle=!0;return b},buildSubRows_:function(){var b=tracing.filterSliceArray(this.categoryFilter,
436 base.requireStylesheet("tracing.tracks.thread_track");base.require("tracing.tracks.container_track");base.require("tracing.tracks.slice_track");base.require("tracing.tracks.slice_group_track");base.require("tracing.tracks.async_slice_group_track");base.require("tracing.filter");base.require("ui");
437 base.exportTo("tracing.tracks",function(){var d=ui.define("thread-track",tracing.tracks.ContainerTrack);d.prototype={__proto__:tracing.tracks.ContainerTrack.prototype,decorate:function(b){tracing.tracks.ContainerTrack.prototype.decorate.call(this,b);this.classList.add("thread-track")},get thread(){return this.thread_},set thread(b){this.thread_=b;this.updateContents_()},get hasVisibleContent(){return 0<this.tracks_.length},updateContents_:function(){this.detach();if(this.thread_){this.heading=this.thread_.userFriendlyName+
438 ": ";this.tooltip=this.thread_.userFriendlyDetails;if(this.thread_.asyncSliceGroup.length){var b=new tracing.tracks.AsyncSliceGroupTrack(this.viewport);b.categoryFilter=this.categoryFilter;b.decorateHit=function(a){};b.group=this.thread_.asyncSliceGroup;b.hasVisibleContent&&this.appendChild(b)}this.thread_.samples.length&&(b=new tracing.tracks.SliceTrack(this.viewport),b.categoryFilter=b,b.group=this.thread_,b.slices=this.thread_.samples,b.decorateHit=function(a){a.thread=this.thread_},this.appendChild(b));
439 this.thread_.cpuSlices&&(b=new tracing.tracks.SliceTrack(this.viewport),b.categoryFilter=this.categoryFilter,b.heading="",b.height="4px",b.decorateHit=function(a){a.thread=this.thread_},b.slices=this.thread_.cpuSlices,b.hasVisibleContent&&this.appendChild(b));this.thread_.sliceGroup.length&&(b=new tracing.tracks.SliceGroupTrack(this.viewport),b.categoryFilter=this.categoryFilter,b.heading=this.thread_.userFriendlyName,b.tooltip=this.thread_.userFriendlyDetails,b.decorateHit=function(a){a.thread=this.thread_},
445 base.require("tracing.analysis.object_snapshot_view");base.require("tracing.analysis.object_instance_view");base.require("tracing.tracks.container_track");base.require("tracing.tracks.counter_track");base.require("tracing.tracks.object_instance_track");base.require("tracing.tracks.spacing_track");base.require("tracing.tracks.thread_track");base.require("tracing.trace_model_settings");base.require("tracing.filter");base.require("ui");base.require("ui.dom_helpers");base.requireStylesheet("tracing.tracks.process_track_base");
446 base.exportTo("tracing.tracks",function(){var d=tracing.analysis.ObjectSnapshotView,b=tracing.analysis.ObjectInstanceView,a=tracing.TraceModelSettings,c=tracing.tracks.SpacingTrack,e=ui.define("process-track-base",tracing.tracks.ContainerTrack);e.prototype={__proto__:tracing.tracks.ContainerTrack.prototype,decorate:function(a){tracing.tracks.ContainerTrack.prototype.decorate.call(this,a);this.processBase_=void 0;this.classList.add("process-track-base");this.classList.add("expanded");this.expandEl_=
451 !n||g.push(q))}0!==g.length&&(c=tracing.tracks.ObjectInstanceTrack.getTrackConstructor(c),c||(c=tracing.tracks.ObjectInstanceTrack),c=new c(this.viewport),c.categoryFilter=this.categoryFilter_,c.objectInstances=g,this.appendChild(c),h=!0)},this);h&&this.appendChild(new c(this.viewport))},appendCounterTracks_:function(){var a=base.dictionaryValues(this.processBase.counters).filter(this.categoryFilter.matchCounter,this.categoryFilter);a.sort(tracing.trace_model.Counter.compare);a.forEach(function(a){var b=
452 new tracing.tracks.CounterTrack(this.viewport);b.categoryFilter=this.categoryFilter_;b.counter=a;this.appendChild(b);this.appendChild(new c(this.viewport))}.bind(this))},appendThreadTracks_:function(){var a=base.dictionaryValues(this.processBase.threads).filter(function(a){return this.categoryFilter_.matchThread(a)},this);a.sort(tracing.trace_model.Thread.compare);a.forEach(function(a){var b=new tracing.tracks.ThreadTrack(this.viewport);b.categoryFilter=this.categoryFilter_;b.thread=a;b.hasVisibleContent&&
453 (this.appendChild(b),this.appendChild(new c(this.viewport)))}.bind(this))}};return{ProcessTrackBase:e}});"use strict";base.require("tracing.tracks.process_track_base");base.require("tracing.tracks.cpu_track");base.require("tracing.tracks.spacing_track");
454 base.exportTo("tracing.tracks",function(){var d=tracing.tracks.ProcessTrackBase,b=tracing.tracks.SpacingTrack,a=ui.define("kernel-track",d);a.prototype={__proto__:d.prototype,decorate:function(a){tracing.tracks.ProcessTrackBase.prototype.decorate.call(this,a)},set kernel(a){this.processBase=a},get kernel(){return this.processBase},willAppendTracks_:function(){var a=this.categoryFilter,d=base.dictionaryValues(this.kernel.cpus);d.sort(tracing.trace_model.Cpu.compare);for(var f=!1,g=0;g<d.length;++g){var h=
455 d[g];if(!a.matchCpu(h))return;var k=new tracing.tracks.CpuTrack(this.viewport);k.categoryFilter=a;k.cpu=h;k.hasVisibleContent&&(this.appendChild(k),f=!0)}f&&this.appendChild(new b(this.viewport))}};return{KernelTrack:a}});"use strict";base.require("tracing.tracks.process_track_base");
456 base.exportTo("tracing.tracks",function(){var d=tracing.tracks.ProcessTrackBase,b=ui.define("process-track",d);b.prototype={__proto__:d.prototype,decorate:function(a){tracing.tracks.ProcessTrackBase.prototype.decorate.call(this,a)},drawTrack:function(a){switch(a){case tracing.tracks.DrawType.INSTANT_EVENT:if(!this.processBase.instantEvents||0===this.processBase.instantEvents.length)break;var b=this.context();if(void 0===b)break;b.save();var d=this.setupCanvasForDraw_();this.drawInstantEvents_(this.processBase.instantEvents,
457 d.left,d.right);b.restore()}tracing.tracks.ContainerTrack.prototype.drawTrack.call(this,a)},set process(a){this.processBase=a},get process(){return this.processBase},addIntersectingItemsInRangeToSelectionInWorldSpace:function(a,b,d,f){base.iterateOverIntersectingIntervals(this.processBase.instantEvents,function(a){return a.start},function(a){return a.duration},a,b,function(a){a=f.addSlice(this,a);this.decorateHit(a)}.bind(this));tracing.tracks.ContainerTrack.prototype.addIntersectingItemsInRangeToSelectionInWorldSpace.apply(this,
458 arguments)}};return{ProcessTrack:b}});"use strict";base.requireStylesheet("tracing.tracks.trace_model_track");base.require("base.measuring_stick");base.require("tracing.tracks.container_track");base.require("tracing.tracks.kernel_track");base.require("tracing.tracks.process_track");base.require("ui");
459 base.exportTo("tracing.tracks",function(){var d=ui.define("trace-model-track",tracing.tracks.ContainerTrack);d.prototype={__proto__:tracing.tracks.ContainerTrack.prototype,decorate:function(b){tracing.tracks.ContainerTrack.prototype.decorate.call(this,b);this.classList.add("model-track")},detach:function(){tracing.tracks.ContainerTrack.prototype.detach.call(this)},get model(){return this.model_},set model(b){this.model_=b;this.updateContents_()},get hasVisibleContent(){return 0<this.children.length},
460 applyCategoryFilter_:function(){this.updateContents_()},updateContents_:function(){this.textContent="";if(this.model_&&this.categoryFilter){var b=this.categoryFilter;this.appendKernelTrack_();var a=this.model_.getAllProcesses();a.sort(tracing.trace_model.Process.compare);for(var c=0;c<a.length;++c){var d=a[c];if(!b.matchProcess(d))break;var f=new tracing.tracks.ProcessTrack(this.viewport);f.categoryFilter=b;f.process=d;f.hasVisibleContent&&this.appendChild(f)}}},appendKernelTrack_:function(){if(this.categoryFilter.matchProcess(this.model.kernel)){var b=
461 new tracing.tracks.KernelTrack(this.viewport);b.categoryFilter=this.categoryFilter;b.kernel=this.model.kernel;b.hasVisibleContent&&this.appendChild(b)}},drawTrack:function(b){switch(b){case tracing.tracks.DrawType.INSTANT_EVENT:if(!this.model_.instantEvents||0===this.model_.instantEvents.length)break;var a=this.context();if(void 0===a)break;a.save();var c=this.setupCanvasForDraw_();this.drawInstantEvents_(this.model_.instantEvents,c.left,c.right);a.restore()}tracing.tracks.ContainerTrack.prototype.drawTrack.call(this,
462 b)},addIntersectingItemsInRangeToSelectionInWorldSpace:function(b,a,c,d){base.iterateOverIntersectingIntervals(this.model_.instantEvents,function(a){return a.start},function(a){return a.duration},b,a,function(a){a=d.addSlice(this,a);this.decorateHit(a)}.bind(this));tracing.tracks.ContainerTrack.prototype.addIntersectingItemsInRangeToSelectionInWorldSpace.apply(this,arguments)}};return{TraceModelTrack:d}});"use strict";base.requireStylesheet("ui.tool_button");base.requireStylesheet("ui.mouse_mode_selector");
463 base.requireTemplate("ui.mouse_mode_selector");base.require("base.events");base.require("tracing.mouse_mode_constants");base.require("ui");
467 this.onMouseDown_.bind(this));document.addEventListener("keypress",this.onKeyPress_.bind(this));document.addEventListener("keydown",this.onKeyDown_.bind(this));document.addEventListener("keyup",this.onKeyUp_.bind(this));this.mode=base.Settings.get("mouse_mode_selector.mouseMode",tracing.mouseModeConstants.MOUSE_MODE_PANSCAN);this.isInteracting_=this.isInTemporaryAlternativeMouseMode_=!1},get mode(){return this.currentMode_},set mode(b){if(this.currentMode_!==b){var a=tracing.mouseModeConstants;this.currentMode_=
469 b)}},getCurrentModeEventNames_:function(){var b=tracing.mouseModeConstants,a={begin:"",update:"",end:""};switch(this.mode){case b.MOUSE_MODE_PANSCAN:a.begin="beginpan";a.update="updatepan";a.end="endpan";break;case b.MOUSE_MODE_SELECTION:a.begin="beginselection";a.update="updateselection";a.end="endselection";break;case b.MOUSE_MODE_ZOOM:a.begin="beginzoom";a.update="updatezoom";a.end="endzoom";break;default:throw Error("Unsupported interaction mode");}return a},onMouseDown_:function(b){var a=this.getCurrentModeEventNames_(),
470 a=new base.Event(a.begin,!0,!0);a.data=b;this.dispatchEvent(a);this.isInteracting_=!0},onMouseMove_:function(b){var a=this.getCurrentModeEventNames_(),a=new base.Event(a.update,!0,!0);a.data=b;this.dispatchEvent(a)},onMouseUp_:function(b){var a=this.getCurrentModeEventNames_(),a=new base.Event(a.end,!0,!0),c=!b.shiftKey,d=base.isMac&&!b.metaKey||!base.isMac&&!b.ctrlKey;a.data=b;this.dispatchEvent(a);this.isInteracting_=!1;this.isInTemporaryAlternativeMouseMode_&&(c&&d)&&(this.mode=tracing.mouseModeConstants.MOUSE_MODE_PANSCAN)},
471 onButtonMouseDown_:function(b){b.preventDefault();b.stopImmediatePropagation()},onButtonMouseUp_:function(b){b.preventDefault();b.stopImmediatePropagation()},onButtonPress_:function(b){var a=tracing.mouseModeConstants;switch(b.target){case this.panScanModeButton_:this.mode=a.MOUSE_MODE_PANSCAN;break;case this.selectionModeButton_:this.mode=a.MOUSE_MODE_SELECTION;break;case this.zoomModeButton_:this.mode=a.MOUSE_MODE_ZOOM;break;default:throw Error("Unknown mouse mode button pressed");}b.preventDefault();
472 this.isInTemporaryAlternativeMouseMode_=!1},onKeyPress_:function(b){if(!this.isInteracting_){var a=tracing.mouseModeConstants;switch(b.keyCode){case 49:this.mode=a.MOUSE_MODE_PANSCAN;break;case 50:this.mode=a.MOUSE_MODE_SELECTION;break;case 51:this.mode=a.MOUSE_MODE_ZOOM}}},onKeyDown_:function(b){if(!this.isInteracting_){var a=tracing.mouseModeConstants,c=base.isMac&&b.metaKey||!base.isMac&&b.ctrlKey,d=b.shiftKey;this.mode===a.MOUSE_MODE_PANSCAN&&(c||d)&&(this.mode=c?a.MOUSE_MODE_ZOOM:a.MOUSE_MODE_SELECTION,
473 this.isInTemporaryAlternativeMouseMode_=!0,b.preventDefault())}},onKeyUp_:function(b){if(!this.isInteracting_){var a=tracing.mouseModeConstants,c=base.isMac&&!b.metaKey||!base.isMac&&!b.ctrlKey;b=b.shiftKey;this.isInTemporaryAlternativeMouseMode_&&(c||b)&&(this.mode=a.MOUSE_MODE_PANSCAN);this.isInTemporaryAlternativeMouseMode_=!1}},constrainPositionToWindowBounds_:function(){var b=window.innerHeight-this.offsetHeight,a=window.innerWidth-this.offsetWidth;this.pos_.x=Math.max(this.pos_.x,0);this.pos_.x=
476 "use strict";base.requireStylesheet("tracing.timeline_track_view");base.require("base.events");base.require("base.properties");base.require("base.settings");base.require("tracing.filter");base.require("tracing.selection");base.require("tracing.timeline_viewport");base.require("tracing.mouse_mode_constants");base.require("tracing.tracks.drawing_container");base.require("tracing.tracks.trace_model_track");base.require("tracing.tracks.ruler_track");base.require("ui");base.require("ui.mouse_mode_selector");
477 base.exportTo("tracing",function(){var d=tracing.Selection,b=tracing.TimelineViewport,a=ui.define("div");a.prototype={__proto__:HTMLDivElement.prototype,model_:null,decorate:function(){this.classList.add("timeline-track-view");this.categoryFilter_=new tracing.CategoryFilter;this.viewport_=new b(this);this.viewportStateAtMouseDown_=null;this.rulerTrackContainer_=new tracing.tracks.DrawingContainer(this.viewport_);this.appendChild(this.rulerTrackContainer_);this.rulerTrackContainer_.invalidate();this.rulerTrack_=
478 new tracing.tracks.RulerTrack(this.viewport_);this.rulerTrackContainer_.appendChild(this.rulerTrack_);this.modelTrackContainer_=new tracing.tracks.DrawingContainer(this.viewport_);this.appendChild(this.modelTrackContainer_);this.modelTrackContainer_.style.display="block";this.modelTrackContainer_.invalidate();this.viewport_.modelTrackContainer=this.modelTrackContainer_;this.modelTrack_=new tracing.tracks.TraceModelTrack(this.viewport_);this.modelTrackContainer_.appendChild(this.modelTrack_);this.mouseModeSelector_=
485 this.activeElement instanceof tracing.FindControl?!1:this.focusElement_?0<=this.focusElement.tabIndex?document.activeElement==this.focusElement?!0:ui.elementIsChildOf(document.activeElement,this.focusElement):!0:!0},onMouseMove_:function(a){this.isZooming_||this.storeLastMousePos_(a)},onKeypress_:function(a){var b=this.viewport_;if(this.listenToKeys_&&"INPUT"!=document.activeElement.nodeName){var d=this.modelTrackContainer_.canvas.clientWidth;switch(a.keyCode){case 119:case 44:this.zoomBy_(1.5);break;
503 "use strict";base.require("tracing.timeline_track_view");base.require("tracing.filter");base.require("ui.overlay");
504 base.exportTo("tracing",function(){function d(){this.model_=this.timeline_=void 0;this.filterText_="";this.filterHits_=new tracing.Selection;this.filterHitsDirty_=!0;this.currentHitIndex_=-1}var b=ui.define("div");b.prototype={__proto__:ui.Overlay.prototype,decorate:function(){ui.Overlay.prototype.decorate.call(this);this.className="find-control";this.hitCountEl_=document.createElement("div");this.hitCountEl_.className="hit-count-label";this.hitCountEl_.textContent="1 of 7";var a=document.createElement("div");
509 get filterHits(){if(this.filterHitsDirty_&&(this.filterHitsDirty_=!1,this.filterHits_.clear(),this.currentHitIndex_=-1,this.timeline_&&this.filterText.length)){var a=new tracing.TitleFilter(this.filterText);this.timeline.addAllObjectsMatchingFilterToSelection(a,this.filterHits_)}return this.filterHits_},get currentHitIndex(){return this.currentHitIndex_},showHits_:function(a,b,d){this.timeline&&(this.timeline.selection=a,b?this.timeline.zoomToSelection():d&&this.timeline.panToSelection())},find_:function(a){var b=
515 this.horizontal_?b.clientY:b.clientX,document.addEventListener("mousemove",this.onMouseMove_),document.addEventListener("mouseup",this.onMouseUp_),b.preventDefault(),!0},onMouseUp_:function(b){document.removeEventListener("mousemove",this.onMouseMove_);document.removeEventListener("mouseup",this.onMouseUp_);b.preventDefault()}};return{DragHandle:d}});"use strict";base.requireStylesheet("tracing.timeline_view");base.requireTemplate("tracing.timeline_view");base.require("base.utils");base.require("base.settings");
516 base.require("tracing.analysis.analysis_view");base.require("tracing.category_filter_dialog");base.require("tracing.filter");base.require("tracing.find_control");base.require("tracing.timeline_track_view");base.require("ui.overlay");base.require("ui.drag_handle");
517 base.exportTo("tracing",function(){var d=ui.define("div");d.prototype={__proto__:HTMLDivElement.prototype,decorate:function(){this.classList.add("timeline-view");var b=base.instantiateTemplate("#timeline-view-template");this.appendChild(b);this.titleEl_=this.querySelector(".title");this.leftControlsEl_=this.querySelector("#left-controls");this.rightControlsEl_=this.querySelector("#right-controls");this.timelineContainer_=this.querySelector(".container");this.categoryFilterButton_=this.createCategoryFilterButton_();
518 this.categoryFilterButton_.callback=this.updateCategoryFilter_.bind(this);this.findCtl_=new tracing.FindControl;this.findCtl_.controller=new tracing.FindController;this.rightControls.appendChild(this.createImportErrorsButton_());this.rightControls.appendChild(this.categoryFilterButton_);this.rightControls.appendChild(this.createMetadataButton_());this.rightControls.appendChild(this.findCtl_);this.rightControls.appendChild(this.createHelpButton_());this.dragEl_=new ui.DragHandle;this.appendChild(this.dragEl_);
519 this.analysisEl_=new tracing.analysis.AnalysisView;this.analysisEl_.addEventListener("requestSelectionChange",this.onRequestSelectionChange_.bind(this));this.appendChild(this.analysisEl_);this.onSelectionChanged_=this.onSelectionChanged_.bind(this);document.addEventListener("keypress",this.onKeypress_.bind(this),!0);this.dragEl_.target=this.analysisEl_},createImportErrorsButton_:function(){var b=base.instantiateTemplate("#import-errors-btn-template"),a=b.querySelector(".view-import-errors-button"),
521 new tracing.CategoryFilter(b))},createCategoryFilterButton_:function(){var b=base.instantiateTemplate("#category-filter-btn-template").querySelector(".view-info-button");b.addEventListener("click",function(){var a=new tracing.CategoryFilterDialog;a.categories=this.model.categories;a.settings_key="categories";a.settingUpdatedCallback=this.updateCategoryFilter_.bind(this);a.visible=!0}.bind(this));var a=function(){b.style.display=this.model?"":"none"}.bind(this);a();this.addEventListener("modelChange",
525 b)},set traceData(b){this.model=new tracing.TraceModel(b)},get model(){if(this.timeline_)return this.timeline_.model},set model(b){var a=b!=this.model,c=b&&!b.bounds.isEmpty;a&&(this.timelineContainer_.textContent="",this.timeline_&&(this.timeline_.removeEventListener("selectionChange",this.onSelectionChanged_),this.timeline_.detach(),this.timeline_=void 0,this.findCtl_.controller.timeline=void 0));c&&!this.timeline_&&(this.timeline_=new tracing.TimelineTrackView,this.timeline_.focusElement=this.focusElement_?
528 63==b.keyCode&&(this.querySelector(".view-help-button").click(),b.preventDefault()))},beginFind:function(){if(!this.findInProgress_){this.findInProgress_=!0;var b=tracing.FindControl();b.controller=new tracing.FindController;b.controller.timeline=this.timeline;b.visible=!0;b.addEventListener("close",function(){this.findInProgress_=!1}.bind(this));b.addEventListener("findNext",function(){});b.addEventListener("findPrevious",function(){})}},onSelectionChanged_:function(b){b=this.timelineContainer_.scrollTop;
529 var a=this.timeline_?this.timeline_.selection:new tracing.Selection;this.analysisEl_.selection=a;this.timelineContainer_.scrollTop=b},onRequestSelectionChange_:function(b){this.timeline_.selection=b.selection;b.stopPropagation()}};return{TimelineView:d}});"use strict";base.require("tracing.timeline_view");base.require("tracing.importer");