_id
stringlengths
2
6
title
stringlengths
0
58
partition
stringclasses
3 values
text
stringlengths
52
373k
language
stringclasses
1 value
meta_information
dict
q53200
train
function(timeShift) { this.forEachLine(function(text, eventBase, cpuNumber, pid, ts) { var eventName = eventBase.eventName; var handler = this.eventHandlers_[eventName]; if (!handler) { this.model_.importWarning({ type: 'parse_error', message: 'Unknown eve...
javascript
{ "resource": "" }
q53201
train
function() { var lines = []; var extractResult = LinuxPerfImporter._extractEventsFromSystraceHTML( this.events_, true); if (!extractResult.ok) extractResult = LinuxPerfImporter._extractEventsFromSystraceMultiHTML( this.events_, true); var lines = extractResult.ok ? ...
javascript
{ "resource": "" }
q53202
train
function(handler) { for (var i = 0; i < this.lines_.length; ++i) { var line = this.lines_[i]; handler.apply(this, line); } }
javascript
{ "resource": "" }
q53203
Cpu
train
function Cpu(kernel, number) { if (kernel === undefined || number === undefined) throw new Error('Missing arguments'); this.kernel = kernel; this.cpuNumber = number; this.slices = []; this.counters = {}; this.bounds = new tr.b.Range(); this.samples_ = undefined; // Set during createSub...
javascript
{ "resource": "" }
q53204
train
function(amount) { for (var sI = 0; sI < this.slices.length; sI++) this.slices[sI].start = (this.slices[sI].start + amount); for (var id in this.counters) this.counters[id].shiftTimestampsForward(amount); }
javascript
{ "resource": "" }
q53205
train
function() { this.bounds.reset(); if (this.slices.length) { this.bounds.addValue(this.slices[0].start); this.bounds.addValue(this.slices[this.slices.length - 1].end); } for (var id in this.counters) { this.counters[id].updateBounds(); this.bounds.addRange(this.cou...
javascript
{ "resource": "" }
q53206
train
function(end_timestamp, args) { // Don't generate a slice if the last active thread is the idle task. if (this.lastActiveThread_ == undefined || this.lastActiveThread_ == 0) return; if (end_timestamp < this.lastActiveTimestamp_) { throw new Error('The end timestamp of a thread running...
javascript
{ "resource": "" }
q53207
train
function(range) { var stats = {}; function addStatsForFreq(freqSample, index) { // Counters don't have an explicit end or duration; // calculate the end by looking at the starting point // of the next value in the series, or if that doesn't // exist, assume this frequency is...
javascript
{ "resource": "" }
q53208
FlowEvent
train
function FlowEvent(category, id, title, colorId, start, args, opt_duration) { tr.model.TimedEvent.call(this, start); this.category = category || ''; this.title = title; this.colorId = colorId; this.start = start; this.args = args; this.id = id; this.startSlice = undefined; this.en...
javascript
{ "resource": "" }
q53209
dispatchSimpleEvent
train
function dispatchSimpleEvent(target, type, opt_bubbles, opt_cancelable) { var e = new tr.b.Event(type, opt_bubbles, opt_cancelable); return target.dispatchEvent(e); }
javascript
{ "resource": "" }
q53210
CpuSlice
train
function CpuSlice(cat, title, colorId, start, args, opt_duration) { Slice.apply(this, arguments); this.threadThatWasRunning = undefined; this.cpu = undefined; }
javascript
{ "resource": "" }
q53211
train
function(line) { // Matches Mali perf events with thread info var lineREWithThread = /^\s*\(([\w\-]*)\)\s*(\w+):\s*([\w\\\/\.\-]*@\d*):?\s*(.*)$/; if (lineREWithThread.test(line)) return lineREWithThread; // Matches old-style Mali perf events var lineRENoThread = /^s*()(...
javascript
{ "resource": "" }
q53212
EventSet
train
function EventSet(opt_events) { this.bounds_dirty_ = true; this.bounds_ = new tr.b.Range(); this.length_ = 0; this.guid_ = tr.b.GUID.allocate(); this.pushed_guids_ = {}; if (opt_events) { if (opt_events instanceof Array) { for (var i = 0; i < opt_events.length; i++) this...
javascript
{ "resource": "" }
q53213
train
function(event) { if (event.guid == undefined) throw new Error('Event must have a GUID'); if (this.contains(event)) return event; this.pushed_guids_[event.guid] = true; this[this.length_++] = event; this.bounds_dirty_ = true; return event; }
javascript
{ "resource": "" }
q53214
CounterSeries
train
function CounterSeries(name, color) { tr.model.EventContainer.call(this); this.name_ = name; this.color_ = color; this.timestamps_ = []; this.samples_ = []; // Set by counter.addSeries this.counter = undefined; this.seriesIndex = undefined; }
javascript
{ "resource": "" }
q53215
train
function(callback) { this.kernel.iterateAllPersistableObjects(callback); for (var pid in this.processes) this.processes[pid].iterateAllPersistableObjects(callback); }
javascript
{ "resource": "" }
q53216
train
function() { var categoriesDict = {}; this.device.addCategoriesToDict(categoriesDict); this.kernel.addCategoriesToDict(categoriesDict); for (var pid in this.processes) this.processes[pid].addCategoriesToDict(categoriesDict); this.categories = []; for (var category in categor...
javascript
{ "resource": "" }
q53217
train
function(event) { for (var i = 0; i < this.userFriendlyCategoryDrivers_.length; i++) { var ufc = this.userFriendlyCategoryDrivers_[i].fromEvent(event); if (ufc !== undefined) return ufc; } return undefined; }
javascript
{ "resource": "" }
q53218
train
function(data) { data.showToUser = !!data.showToUser; this.importWarnings_.push(data); // Only log each warning type once. We may want to add some kind of // flag to allow reporting all importer warnings. if (this.reportedImportWarnings_[data.type] === true) return; if (th...
javascript
{ "resource": "" }
q53219
Sample
train
function Sample(cpu, thread, title, start, leafStackFrame, opt_weight, opt_args) { tr.model.TimedEvent.call(this, start); this.title = title; this.cpu = cpu; this.thread = thread; this.leafStackFrame = leafStackFrame; this.weight = opt_weight; this.args = opt_args || {}; ...
javascript
{ "resource": "" }
q53220
ObjectSnapshot
train
function ObjectSnapshot(objectInstance, ts, args) { tr.model.Event.call(this); this.objectInstance = objectInstance; this.ts = ts; this.args = args; }
javascript
{ "resource": "" }
q53221
train
function(ts, val) { var sample = new PowerSample(this, ts, val); this.samples_.push(sample); return sample; }
javascript
{ "resource": "" }
q53222
Device
train
function Device(model) { if (!model) throw new Error('Must provide a model.'); tr.model.EventContainer.call(this); this.powerSeries_ = undefined; this.vSyncTimestamps_ = []; }
javascript
{ "resource": "" }
q53223
Slice
train
function Slice(category, title, colorId, start, args, opt_duration, opt_cpuStart, opt_cpuDuration, opt_argsStripped, opt_bind_id) { tr.model.TimedEvent.call(this, start); this.category = category || ''; this.title = title; this.colorId = colorId; this.args = args; ...
javascript
{ "resource": "" }
q53224
train
function(callback, opt_this) { var parentStack = []; var started = false; // get the root node and push it to the DFS stack var topmostSlice = this.mostTopLevelSlice; parentStack.push(topmostSlice); // Using the stack to perform DFS while (parentStack.length !== 0) { ...
javascript
{ "resource": "" }
q53225
train
function(callback, opt_this) { var curSlice = this; while (curSlice.parentSlice) { curSlice = curSlice.parentSlice; callback.call(opt_this, curSlice); } }
javascript
{ "resource": "" }
q53226
train
function(slice) { this.haveTopLevelSlicesBeenBuilt = false; slice.parentContainer = this.parentContainer_; this.slices.push(slice); return slice; }
javascript
{ "resource": "" }
q53227
train
function(slices) { this.haveTopLevelSlicesBeenBuilt = false; slices.forEach(function(slice) { slice.parentContainer = this.parentContainer_; this.slices.push(slice); }, this); }
javascript
{ "resource": "" }
q53228
train
function(category, title, ts, opt_args, opt_tts, opt_argsStripped, opt_colorId) { if (this.openPartialSlices_.length) { var prevSlice = this.openPartialSlices_[ this.openPartialSlices_.length - 1]; if (ts < prevSlice.start) throw new Error('Slices mus...
javascript
{ "resource": "" }
q53229
train
function(ts, opt_tts, opt_colorId) { if (!this.openSliceCount) throw new Error('endSlice called without an open slice'); var slice = this.openPartialSlices_[this.openSliceCount - 1]; this.openPartialSlices_.splice(this.openSliceCount - 1, 1); if (ts < slice.start) throw new Erro...
javascript
{ "resource": "" }
q53230
train
function(category, title, ts, duration, tts, cpuDuration, opt_args, opt_argsStripped, opt_colorId, opt_bind_id) { var colorId = opt_colorId || ColorScheme.getColorIdForGeneralPurposeString(title); var slice = new this.sliceConstructor...
javascript
{ "resource": "" }
q53231
train
function() { this.updateBounds(); var maxTimestamp = this.bounds.max; for (var sI = 0; sI < this.slices.length; sI++) { var slice = this.slices[sI]; if (slice.didNotFinish) slice.duration = maxTimestamp - slice.start; } this.openPartialSlices_ = []; }
javascript
{ "resource": "" }
q53232
train
function(amount) { for (var sI = 0; sI < this.slices.length; sI++) { var slice = this.slices[sI]; slice.start = (slice.start + amount); } }
javascript
{ "resource": "" }
q53233
train
function() { this.bounds.reset(); for (var i = 0; i < this.slices.length; i++) { this.bounds.addValue(this.slices[i].start); this.bounds.addValue(this.slices[i].end); } }
javascript
{ "resource": "" }
q53234
train
function(viewport) { var containerToTrack = viewport.containerToTrackMap; for (var i in this.yComponents_) { var yComponent = this.yComponents_[i]; var track = containerToTrack.getTrackByStableId(yComponent.stableId); if (track !== undefined) return track; } }
javascript
{ "resource": "" }
q53235
train
function(viewport) { var dt = viewport.currentDisplayTransform; var containerToTrack = viewport.containerToTrackMap; var viewX = dt.xWorldToView(this.xWorld_); var viewY = -1; for (var index in this.yComponents_) { var yComponent = this.yComponents_[index]; var track = con...
javascript
{ "resource": "" }
q53236
ContainerMemoryDump
train
function ContainerMemoryDump(start) { tr.model.TimedEvent.call(this, start); // 'light' or 'detailed' memory dump. See // base::trace_event::MemoryDumpLevelOfDetail in the Chromium // repository. this.levelOfDetail = undefined; this.memoryAllocatorDumps_ = undefined; this.memoryAllocatorDu...
javascript
{ "resource": "" }
q53237
Process
train
function Process(model, pid) { if (model === undefined) throw new Error('model must be provided'); if (pid === undefined) throw new Error('pid must be provided'); tr.model.ProcessBase.call(this, model); this.pid = pid; this.name = undefined; this.labels = []; this.instantEvents =...
javascript
{ "resource": "" }
q53238
decorate
train
function decorate(source, constr) { var elements; if (typeof source == 'string') elements = tr.doc.querySelectorAll(source); else elements = [source]; for (var i = 0, el; el = elements[i]; i++) { if (!(el instanceof constr)) constr.decorate(el); } }
javascript
{ "resource": "" }
q53239
define
train
function define(className, opt_parentConstructor, opt_tagNS) { if (typeof className == 'function') { throw new Error('Passing functions as className is deprecated. Please ' + 'use (className, opt_parentConstructor) to subclass'); } var className = className.toLowerCase(); if...
javascript
{ "resource": "" }
q53240
f
train
function f() { if (opt_parentConstructor && f.prototype.__proto__ != opt_parentConstructor.prototype) { throw new Error( className + ' prototye\'s __proto__ field is messed up. ' + 'It MUST be the prototype of ' + opt_parentConstructor.tagName); } var el; ...
javascript
{ "resource": "" }
q53241
CommentBoxAnnotationView
train
function CommentBoxAnnotationView(viewport, annotation) { this.viewport_ = viewport; this.annotation_ = annotation; this.textArea_ = undefined; this.styleWidth = 250; this.styleHeight = 50; this.fontSize = 10; this.rightOffset = 50; this.topOffset = 25; }
javascript
{ "resource": "" }
q53242
train
function(address, amount, label, message) { var tmpl = ["bitcoin:", address, "?"]; if(amount) { tmpl = tmpl.concat(["amount=", encodeURIComponent(amount), "&"]); } if(label) { tmpl = tmpl.concat(["label=", encodeURIComponent(label), "&"]); } if(...
javascript
{ "resource": "" }
q53243
train
function(elem, source) { // Replace .bitcoin-address in the template var addr = elem.find(".bitcoin-address"); // Add a maker class so that we don't reapply template // on the subsequent scans addr.addClass("bitcoin-address-controls"); addr.text(source.attr("data-bc-ad...
javascript
{ "resource": "" }
q53244
train
function() { var template = document.getElementById(this.config.template); if(!template) { throw new Error("Bitcoin address template element missing:" + this.config.template); } template = $(template); if(template.size() != 1) { throw new Error("Bitcoi...
javascript
{ "resource": "" }
q53245
train
function(target, template) { if(!template) { template = this.getTemplate(); } // Make a deep copy, so we don't accidentally modify // template elements in-place var elem = template.clone(false, true); this.buildControls(elem, target); // Make sure ...
javascript
{ "resource": "" }
q53246
train
function() { var self = this; var template = this.getTemplate(); // Optionally bail out if the default selection // is not given (user calls applyTemplate() manually) if(!this.config.selector) { return; } $(this.config.selector).each(function() { ...
javascript
{ "resource": "" }
q53247
train
function(elem) { var addy = elem.find(".bitcoin-address"); window.getSelection().selectAllChildren(addy.get(0)); elem.find(".bitcoin-action-hint").hide(); elem.find(".bitcoin-action-hint-copy").slideDown(); }
javascript
{ "resource": "" }
q53248
train
function(e) { var elem = $(e.target).parents(".bitcoin-address-container"); // We never know if the click action was succesfully complete elem.find(".bitcoin-action-hint").hide(); elem.find(".bitcoin-action-hint-send").slideDown(); }
javascript
{ "resource": "" }
q53249
train
function(e) { e.preventDefault(); var elem = $(e.target).parents(".bitcoin-address-container"); this.prepareCopySelection(elem); return false; }
javascript
{ "resource": "" }
q53250
train
function(qrContainer) { var elem = qrContainer.parents(".bitcoin-address-container"); var url; //var addr = elem.attr("data-bc-address"); if(this.config.qrRawAddress) { url = elem.attr("data-bc-address"); } else { url = this.buildBitcoinURI(elem.attr("da...
javascript
{ "resource": "" }
q53251
train
function(e) { e.preventDefault(); var elem = $(e.target).parents(".bitcoin-address-container"); var addr = elem.attr("data-bc-address"); var qrContainer = elem.find(".bitcoin-address-qr-container"); // Lazily generate the QR code if(qrContainer.children().size() === 0) {...
javascript
{ "resource": "" }
q53252
train
function(_config) { var self = this; if(!_config) { throw new Error("You must give bitcoinaddress config object"); } this.config = _config; $ = this.config.jQuery || jQuery; this.scan(); this.initUX(); }
javascript
{ "resource": "" }
q53253
train
function(traces) { if (tr.isHeadless) throw new Error('Cannot use this method in headless mode.'); var overlay = tr.ui.b.Overlay(); overlay.title = 'Importing...'; overlay.userCanClose = false; overlay.msgEl = document.createElement('div'); overlay.appendChild(overlay.msgEl)...
javascript
{ "resource": "" }
q53254
EventContainer
train
function EventContainer() { this.guid_ = tr.b.GUID.allocate(); this.important = true; this.bounds_ = new tr.b.Range(); }
javascript
{ "resource": "" }
q53255
train
function(callback, opt_this) { this.iterateAllEventContainers(function(ec) { ec.iterateAllEventsInThisContainer( function(eventType) { return true; }, callback, opt_this); }); }
javascript
{ "resource": "" }
q53256
train
function(callback, opt_this) { function visit(ec) { callback.call(opt_this, ec); ec.iterateAllChildEventContainers(visit); } visit(this); }
javascript
{ "resource": "" }
q53257
Event
train
function Event() { SelectableItem.call(this, this /* modelItem */); this.guid_ = tr.b.GUID.allocate(); this.selectionState = SelectionState.NONE; this.associatedAlerts = new tr.model.EventSet(); this.info = undefined; }
javascript
{ "resource": "" }
q53258
ThreadTimeSlice
train
function ThreadTimeSlice(thread, schedulingState, cat, start, args, opt_duration) { Slice.call(this, cat, schedulingState, this.getColorForState_(schedulingState), start, args, opt_duration); this.thread = thread; this.schedulingState = schedulingState; ...
javascript
{ "resource": "" }
q53259
findEmptyRangesBetweenRanges
train
function findEmptyRangesBetweenRanges(inRanges, opt_totalRange) { if (opt_totalRange && opt_totalRange.isEmpty) opt_totalRange = undefined; var emptyRanges = []; if (!inRanges.length) { if (opt_totalRange) emptyRanges.push(opt_totalRange); return emptyRanges; } inRanges =...
javascript
{ "resource": "" }
q53260
AsyncSlice
train
function AsyncSlice(category, title, colorId, start, args, duration, opt_isTopLevel, opt_cpuStart, opt_cpuDuration, opt_argsStripped) { tr.model.TimedEvent.call(this, start); this.category = category || ''; // We keep the original title from the trace file in ori...
javascript
{ "resource": "" }
q53261
Task
train
function Task(runCb, thisArg) { if (runCb !== undefined && thisArg === undefined) throw new Error('Almost certainly, you meant to pass a thisArg.'); this.runCb_ = runCb; this.thisArg_ = thisArg; this.afterTask_ = undefined; this.subTasks_ = []; }
javascript
{ "resource": "" }
q53262
train
function() { if (this.runCb_ !== undefined) this.runCb_.call(this.thisArg_, this); var subTasks = this.subTasks_; this.subTasks_ = undefined; // Prevent more subTasks from being posted. if (!subTasks.length) return this.afterTask_; // If there are subtasks, then we want t...
javascript
{ "resource": "" }
q53263
ObjectInstance
train
function ObjectInstance( parent, id, category, name, creationTs, opt_baseTypeName) { tr.model.Event.call(this); this.parent = parent; this.id = id; this.category = category; this.baseTypeName = opt_baseTypeName ? opt_baseTypeName : name; this.name = name; this.creationTs = creationTs; ...
javascript
{ "resource": "" }
q53264
ProtoIR
train
function ProtoIR(irType, name) { this.irType = irType; this.names = new Set(name ? [name] : undefined); this.start = Infinity; this.end = -Infinity; this.associatedEvents = new tr.model.EventSet(); }
javascript
{ "resource": "" }
q53265
train
function(typeNames) { for (var i = 0; i < this.associatedEvents.length; ++i) { if (typeNames.indexOf(this.associatedEvents[i].typeName) >= 0) return true; } return false; }
javascript
{ "resource": "" }
q53266
train
function() { var debugString = this.irType + '('; debugString += parseInt(this.start) + ' '; debugString += parseInt(this.end); this.associatedEvents.forEach(function(event) { debugString += ' ' + event.typeName; }); return debugString + ')'; }
javascript
{ "resource": "" }
q53267
ObjectCollection
train
function ObjectCollection(parent) { tr.model.EventContainer.call(this); this.parent = parent; this.instanceMapsById_ = {}; // id -> TimeToObjectInstanceMap this.instancesByTypeName_ = {}; this.createObjectInstance_ = this.createObjectInstance_.bind(this); }
javascript
{ "resource": "" }
q53268
GestureParser
train
function GestureParser(importer) { Parser.call(this, importer); importer.registerEventHandler('tracing_mark_write:log', GestureParser.prototype.logEvent.bind(this)); importer.registerEventHandler('tracing_mark_write:SyncInterpret', GestureParser.prototype.syncEvent.bind(this)); importer....
javascript
{ "resource": "" }
q53269
train
function(title, ts, opt_args) { var thread = this.importer.getOrCreatePseudoThread('gesture').thread; thread.sliceGroup.beginSlice( 'touchpad_gesture', title, ts, opt_args); }
javascript
{ "resource": "" }
q53270
Counter
train
function Counter(parent, id, category, name) { tr.model.EventContainer.call(this); this.parent_ = parent; this.id_ = id; this.category_ = category || ''; this.name_ = name; this.series_ = []; this.totals = []; }
javascript
{ "resource": "" }
q53271
train
function(amount) { for (var i = 0; i < this.series_.length; ++i) this.series_[i].shiftTimestampsForward(amount); }
javascript
{ "resource": "" }
q53272
train
function() { this.totals = []; this.maxTotal = 0; this.bounds.reset(); if (this.series_.length === 0) return; var firstSeries = this.series_[0]; var lastSeries = this.series_[this.series_.length - 1]; this.bounds.addValue(firstSeries.getTimestamp(0)); this.boun...
javascript
{ "resource": "" }
q53273
TimeToObjectInstanceMap
train
function TimeToObjectInstanceMap(createObjectInstanceFunction, parent, id) { this.createObjectInstanceFunction_ = createObjectInstanceFunction; this.parent = parent; this.id = id; this.instances = []; }
javascript
{ "resource": "" }
q53274
RegulatorParser
train
function RegulatorParser(importer) { Parser.call(this, importer); importer.registerEventHandler('regulator_enable', RegulatorParser.prototype.regulatorEnableEvent.bind(this)); importer.registerEventHandler('regulator_enable_delay', RegulatorParser.prototype.regulatorEnableDelayEvent.bind(th...
javascript
{ "resource": "" }
q53275
train
function(ctrName, valueName) { var ctr = this.model_.kernel .getOrCreateCounter(null, 'vreg ' + ctrName + ' ' + valueName); // Initialize the counter's series fields if needed. if (ctr.series[0] === undefined) { ctr.addSeries(new tr.model.CounterSeries(valueName, ColorScheme.ge...
javascript
{ "resource": "" }
q53276
TimedEvent
train
function TimedEvent(start) { tr.model.Event.call(this); this.start = start; this.duration = 0; this.cpuStart = undefined; this.cpuDuration = undefined; }
javascript
{ "resource": "" }
q53277
train
function(that, precisionUnit) { if (precisionUnit === undefined) { precisionUnit = tr.b.u.TimeDisplayModes.ms; } var startsBefore = precisionUnit.roundedLess(that.start, this.start); var endsAfter = precisionUnit.roundedLess(this.end, that.end); return !startsBefore && !endsAfter; ...
javascript
{ "resource": "" }
q53278
comparePossiblyUndefinedValues
train
function comparePossiblyUndefinedValues(x, y, cmp, opt_this) { if (x !== undefined && y !== undefined) return cmp.call(opt_this, x, y); if (x !== undefined) return -1; if (y !== undefined) return 1; return 0; }
javascript
{ "resource": "" }
q53279
group
train
function group(ary, fn) { return ary.reduce(function(accumulator, curr) { var key = fn(curr); if (key in accumulator) accumulator[key].push(curr); else accumulator[key] = [curr]; return accumulator; }, {}); }
javascript
{ "resource": "" }
q53280
invertArrayOfDicts
train
function invertArrayOfDicts(array, opt_dictGetter, opt_this) { opt_this = opt_this || this; var result = {}; for (var i = 0; i < array.length; i++) { var item = array[i]; if (item === undefined) continue; var dict = opt_dictGetter ? opt_dictGetter.call(opt_this, item) : item; ...
javascript
{ "resource": "" }
q53281
arrayToDict
train
function arrayToDict(array, valueToKeyFn, opt_this) { opt_this = opt_this || this; var result = {}; var length = array.length; for (var i = 0; i < length; i++) { var value = array[i]; var key = valueToKeyFn.call(opt_this, value); result[key] = value; } return result; }
javascript
{ "resource": "" }
q53282
ProcessMemoryDump
train
function ProcessMemoryDump(globalMemoryDump, process, start) { tr.model.ContainerMemoryDump.call(this, start); this.process = process; this.globalMemoryDump = globalMemoryDump; // Process memory totals (optional object) with the following fields (also // optional): // - residentBytes: Total r...
javascript
{ "resource": "" }
q53283
ThreadSlice
train
function ThreadSlice(cat, title, colorId, start, args, opt_duration, opt_cpuStart, opt_cpuDuration, opt_argsStripped, opt_bind_id) { Slice.call(this, cat, title, colorId, start, args, opt_duration, opt_cpuStart, opt_cpuDuration, opt_argsStripped, opt_bind...
javascript
{ "resource": "" }
q53284
train
function(event, opt_slice) { var thread = this.model_.getOrCreateProcess(event.pid). getOrCreateThread(event.tid); this.allFlowEvents_.push({ refGuid: tr.b.GUID.getLastGuid(), sequenceNumber: this.allFlowEvents_.length, event: event, slice: opt_slice, // slice for ...
javascript
{ "resource": "" }
q53285
train
function(event) { var ctr_name; if (event.id !== undefined) ctr_name = event.name + '[' + event.id + ']'; else ctr_name = event.name; var ctr = this.model_.getOrCreateProcess(event.pid) .getOrCreateCounter(event.cat, ctr_name); var reservedColorId = event.cname ?...
javascript
{ "resource": "" }
q53286
train
function() { if (this.softwareMeasuredCpuCount_ !== undefined) { this.model_.kernel.softwareMeasuredCpuCount = this.softwareMeasuredCpuCount_; } this.createAsyncSlices_(); this.createFlowSlices_(); this.createExplicitObjects_(); this.createImplicitObjects_(); ...
javascript
{ "resource": "" }
q53287
concatenateArguments
train
function concatenateArguments(args1, args2) { if (args1.params === undefined || args2.params === undefined) return tr.b.concatenateObjects(args1, args2); // Make an argument object to hold the combined params. var args3 = {}; args3.params...
javascript
{ "resource": "" }
q53288
HeapEntry
train
function HeapEntry(heapDump, leafStackFrame, size) { this.heapDump = heapDump; // The leaf stack frame of the associated backtrace (e.g. drawQuad for the // drawQuad <- draw <- MessageLoop::RunTask backtrace). If undefined, the // heap entry is a sum over all backtraces. On the other hand, an empty ...
javascript
{ "resource": "" }
q53289
KernelFuncParser
train
function KernelFuncParser(importer) { LinuxPerfParser.call(this, importer); importer.registerEventHandler('graph_ent', KernelFuncParser.prototype.traceKernelFuncEnterEvent. bind(this)); importer.registerEventHandler('graph_ret', KernelFuncParser.prototype.traceKernelFuncReturnEv...
javascript
{ "resource": "" }
q53290
GlobalMemoryDump
train
function GlobalMemoryDump(model, start) { tr.model.ContainerMemoryDump.call(this, start); this.model = model; this.processMemoryDumps = {}; }
javascript
{ "resource": "" }
q53291
train
function() { // 1. Calculate not-owned and not-owning sub-sizes of all MADs // (depth-first post-order traversal). this.traverseAllocatorDumpsInDepthFirstPostOrder( this.calculateDumpSubSizes_.bind(this)); // 2. Calculate owned and owning coefficients of owned and owner MADs // ...
javascript
{ "resource": "" }
q53292
train
function(dump) { // Completely skip dumps with undefined size. if (!hasSize(dump)) return; // We only need to consider owned dumps. if (dump.ownedBy.length === 0) return; // Sort the owners in decreasing order of ownership importance and // increasing order of not-o...
javascript
{ "resource": "" }
q53293
train
function(dump) { // Completely skip dumps with undefined size. As a result, each dump will // have defined effective size if and only if it has defined size. if (!hasSize(dump)) { // The rest of the pipeline relies on effective size being either a // valid ScalarAttribute, or undefined...
javascript
{ "resource": "" }
q53294
train
function(fn) { var visitedDumps = new WeakSet(); var openDumps = new WeakSet(); function visit(dump) { if (visitedDumps.has(dump)) return; if (openDumps.has(dump)) throw new Error(dump.userFriendlyName + ' contains a cycle'); openDumps.add(dump); ...
javascript
{ "resource": "" }
q53295
train
function(fn) { var visitedDumps = new WeakSet(); function visit(dump) { if (visitedDumps.has(dump)) return; // If this dumps owns another dump which hasn't been visited yet, then // wait for this dump to be visited later. if (dump.owns !== undefined && !visitedDum...
javascript
{ "resource": "" }
q53296
ModelIndices
train
function ModelIndices(model) { // For now the only indices we construct are for flowEvents this.flowEventsById_ = {}; model.flowEvents.forEach(function(fe) { if (fe.id !== undefined) { if (!this.flowEventsById_.hasOwnProperty(fe.id)) { this.flowEventsById_[fe.id] = new Array(); ...
javascript
{ "resource": "" }
q53297
AsyncSliceGroup
train
function AsyncSliceGroup(parentContainer, opt_name) { tr.model.EventContainer.call(this); this.parentContainer_ = parentContainer; this.slices = []; this.name_ = opt_name; this.viewSubGroups_ = undefined; }
javascript
{ "resource": "" }
q53298
train
function(amount) { for (var sI = 0; sI < this.slices.length; sI++) { var slice = this.slices[sI]; slice.start = (slice.start + amount); // Shift all nested subSlices recursively. var shiftSubSlices = function(subSlices) { if (subSlices === undefined || subSlices.length ==...
javascript
{ "resource": "" }
q53299
train
function(subSlices) { if (subSlices === undefined || subSlices.length === 0) return; for (var sJ = 0; sJ < subSlices.length; sJ++) { subSlices[sJ].start += amount; shiftSubSlices(subSlices[sJ].subSlices); } }
javascript
{ "resource": "" }