| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright (c) 2015 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
| 5 found in the LICENSE file. | 5 found in the LICENSE file. |
| 6 --> | 6 --> |
| 7 | 7 |
| 8 <link rel="import" href="/tracing/base/iteration_helpers.html"> | 8 <link rel="import" href="/tracing/base/iteration_helpers.html"> |
| 9 <link rel="import" href="/tracing/core/test_utils.html"> | 9 <link rel="import" href="/tracing/core/test_utils.html"> |
| 10 <link rel="import" href="/tracing/model/container_memory_dump.html"> | 10 <link rel="import" href="/tracing/model/container_memory_dump.html"> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 var checkStringFields = tr.ui.analysis.checkStringFields; | 33 var checkStringFields = tr.ui.analysis.checkStringFields; |
| 34 var checkColumns = tr.ui.analysis.checkColumns; | 34 var checkColumns = tr.ui.analysis.checkColumns; |
| 35 var isElementDisplayed = tr.ui.analysis.isElementDisplayed; | 35 var isElementDisplayed = tr.ui.analysis.isElementDisplayed; |
| 36 var DETAILED = tr.model.ContainerMemoryDump.LevelOfDetail.DETAILED; | 36 var DETAILED = tr.model.ContainerMemoryDump.LevelOfDetail.DETAILED; |
| 37 | 37 |
| 38 function createVMRegions() { | 38 function createVMRegions() { |
| 39 var model = tr.c.TestUtils.newModel(function(model) { | 39 var model = tr.c.TestUtils.newModel(function(model) { |
| 40 var process = model.getOrCreateProcess(1); | 40 var process = model.getOrCreateProcess(1); |
| 41 | 41 |
| 42 // First timestamp. | 42 // First timestamp. |
| 43 var gmd1 = addGlobalMemoryDump(model, 42, DETAILED); | 43 var gmd1 = addGlobalMemoryDump(model, {ts: 42, levelOfDetail: DETAILED}); |
| 44 var pmd1 = addProcessMemoryDump(gmd1, process, 42); | 44 var pmd1 = addProcessMemoryDump(gmd1, process, {ts: 42}); |
| 45 pmd1.vmRegions = VMRegionClassificationNode.fromRegions([ | 45 pmd1.vmRegions = VMRegionClassificationNode.fromRegions([ |
| 46 VMRegion.fromDict({ | 46 VMRegion.fromDict({ |
| 47 mappedFile: '/lib/chrome.so', | 47 mappedFile: '/lib/chrome.so', |
| 48 startAddress: 65536, | 48 startAddress: 65536, |
| 49 sizeInBytes: 536870912, | 49 sizeInBytes: 536870912, |
| 50 protectionFlags: VMRegion.PROTECTION_FLAG_READ | | 50 protectionFlags: VMRegion.PROTECTION_FLAG_READ | |
| 51 VMRegion.PROTECTION_FLAG_EXECUTE, | 51 VMRegion.PROTECTION_FLAG_EXECUTE, |
| 52 byteStats: { | 52 byteStats: { |
| 53 proportionalResident: 8192 | 53 proportionalResident: 8192 |
| 54 } | 54 } |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 proportionalResident: 200, | 104 proportionalResident: 200, |
| 105 privateDirtyResident: 96, | 105 privateDirtyResident: 96, |
| 106 swapped: 0 | 106 swapped: 0 |
| 107 } | 107 } |
| 108 }) | 108 }) |
| 109 ]); | 109 ]); |
| 110 | 110 |
| 111 // This is here so that we could test that tracing is discounted from the | 111 // This is here so that we could test that tracing is discounted from the |
| 112 // 'Native heap' category. | 112 // 'Native heap' category. |
| 113 pmd1.memoryAllocatorDumps = [ | 113 pmd1.memoryAllocatorDumps = [ |
| 114 newAllocatorDump(pmd1, 'tracing', { size: 500, resident_size: 32 }) | 114 newAllocatorDump(pmd1, 'tracing', |
| 115 {numerics: {size: 500, resident_size: 32}}) |
| 115 ]; | 116 ]; |
| 116 | 117 |
| 117 // Second timestamp. | 118 // Second timestamp. |
| 118 var gmd2 = addGlobalMemoryDump(model, 42, DETAILED); | 119 var gmd2 = addGlobalMemoryDump(model, {ts: 42, levelOfDetail: DETAILED}); |
| 119 var pmd2 = addProcessMemoryDump(gmd2, process, 42); | 120 var pmd2 = addProcessMemoryDump(gmd2, process, {ts: 42}); |
| 120 pmd2.vmRegions = VMRegionClassificationNode.fromRegions([ | 121 pmd2.vmRegions = VMRegionClassificationNode.fromRegions([ |
| 121 VMRegion.fromDict({ | 122 VMRegion.fromDict({ |
| 122 mappedFile: '/lib/chrome.so', | 123 mappedFile: '/lib/chrome.so', |
| 123 startAddress: 65536, | 124 startAddress: 65536, |
| 124 sizeInBytes: 536870912, | 125 sizeInBytes: 536870912, |
| 125 protectionFlags: VMRegion.PROTECTION_FLAG_READ | | 126 protectionFlags: VMRegion.PROTECTION_FLAG_READ | |
| 126 VMRegion.PROTECTION_FLAG_EXECUTE, | 127 VMRegion.PROTECTION_FLAG_EXECUTE, |
| 127 byteStats: { | 128 byteStats: { |
| 128 proportionalResident: 9216 | 129 proportionalResident: 9216 |
| 129 } | 130 } |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 | 481 |
| 481 // Just check that the table has the right shape. | 482 // Just check that the table has the right shape. |
| 482 var table = viewEl.$.table; | 483 var table = viewEl.$.table; |
| 483 var columns = table.tableColumns; | 484 var columns = table.tableColumns; |
| 484 checkColumns(columns, EXPECTED_COLUMNS, AggregationMode.DIFF); | 485 checkColumns(columns, EXPECTED_COLUMNS, AggregationMode.DIFF); |
| 485 var rows = table.tableRows; | 486 var rows = table.tableRows; |
| 486 assert.lengthOf(rows, 1); | 487 assert.lengthOf(rows, 1); |
| 487 }); | 488 }); |
| 488 }); | 489 }); |
| 489 </script> | 490 </script> |
| OLD | NEW |