blob: 1daaf8202445e4ac4150533462352ead0f191efe [file] [log] [blame]
<!DOCTYPE html>
<!--
Copyright (c) 2015 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="/model/container_memory_dump.html">
<link rel="import" href="/base/units/util.html">
<script>
'use strict';
/**
* @fileoverview Provides the GlobalMemoryDump class.
*/
tr.exportTo('tr.model', function() {
/**
* The GlobalMemoryDump represents a simultaneous memory dump of all
* processes.
* @constructor
*/
function GlobalMemoryDump(model, start) {
tr.model.ContainerMemoryDump.call(this, start);
this.model = model;
this.processMemoryDumps = {};
}
GlobalMemoryDump.prototype = {
__proto__: tr.model.ContainerMemoryDump.prototype,
get userFriendlyName() {
return 'Global memory dump ' + ' at ' +
tr.b.units.tsString(this.start);
},
calculateGraphAttributes: function() {
// TODO(petrcermak): Calculate sizes using the graph.
this.aggregateMemoryAllocatorDumpAttributes(this.model);
tr.b.iterItems(this.processMemoryDumps, function(pid, dump) {
dump.aggregateMemoryAllocatorDumpAttributes(this.model);
}, this);
// TODO(petrcermak): Consider factoring out all the finalization code and
// constants to a single file.
tr.b.iterItems(this.processMemoryDumps, function(pid, dump) {
dump.discountTracingOverhead(this.model);
}, this);
}
};
tr.model.EventRegistry.register(
GlobalMemoryDump,
{
name: 'globalMemoryDump',
pluralName: 'globalMemoryDumps',
singleViewElementName: 'tr-c-a-single-global-memory-dump-sub-view',
multiViewElementName: 'tr-c-a-multi-global-memory-dump-sub-view'
});
return {
GlobalMemoryDump: GlobalMemoryDump
};
});
</script>