| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
| 5 found in the LICENSE file. | 5 found in the LICENSE file. |
| 6 --> | 6 --> |
| 7 | 7 |
| 8 <link rel="import" href="/tracing/base/base64.html"> | 8 <link rel="import" href="/tracing/base/base64.html"> |
| 9 <link rel="import" href="/tracing/base/color_scheme.html"> | 9 <link rel="import" href="/tracing/base/color_scheme.html"> |
| 10 <link rel="import" href="/tracing/base/range.html"> | 10 <link rel="import" href="/tracing/base/math/range.html"> |
| 11 <link rel="import" href="/tracing/base/scalar.html"> | 11 <link rel="import" href="/tracing/base/scalar.html"> |
| 12 <link rel="import" href="/tracing/base/unit.html"> | 12 <link rel="import" href="/tracing/base/unit.html"> |
| 13 <link rel="import" href="/tracing/base/utils.html"> | 13 <link rel="import" href="/tracing/base/utils.html"> |
| 14 <link rel="import" href="/tracing/extras/importer/heap_dump_trace_event_importer
.html"> | 14 <link rel="import" href="/tracing/extras/importer/heap_dump_trace_event_importer
.html"> |
| 15 <link rel="import" href="/tracing/extras/importer/trace_code_entry.html"> | 15 <link rel="import" href="/tracing/extras/importer/trace_code_entry.html"> |
| 16 <link rel="import" href="/tracing/extras/importer/trace_code_map.html"> | 16 <link rel="import" href="/tracing/extras/importer/trace_code_map.html"> |
| 17 <link rel="import" href="/tracing/extras/importer/v8/codemap.html"> | 17 <link rel="import" href="/tracing/extras/importer/v8/codemap.html"> |
| 18 <link rel="import" href="/tracing/importer/context_processor.html"> | 18 <link rel="import" href="/tracing/importer/context_processor.html"> |
| 19 <link rel="import" href="/tracing/importer/importer.html"> | 19 <link rel="import" href="/tracing/importer/importer.html"> |
| 20 <link rel="import" href="/tracing/model/comment_box_annotation.html"> | 20 <link rel="import" href="/tracing/model/comment_box_annotation.html"> |
| (...skipping 2345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2366 createMemoryDumps_: function() { | 2366 createMemoryDumps_: function() { |
| 2367 for (var dumpId in this.allMemoryDumpEvents_) | 2367 for (var dumpId in this.allMemoryDumpEvents_) |
| 2368 this.createGlobalMemoryDump_(this.allMemoryDumpEvents_[dumpId], dumpId); | 2368 this.createGlobalMemoryDump_(this.allMemoryDumpEvents_[dumpId], dumpId); |
| 2369 }, | 2369 }, |
| 2370 | 2370 |
| 2371 createGlobalMemoryDump_: function(dumpIdEvents, dumpId) { | 2371 createGlobalMemoryDump_: function(dumpIdEvents, dumpId) { |
| 2372 // 1. Create a GlobalMemoryDump for the provided process memory dump | 2372 // 1. Create a GlobalMemoryDump for the provided process memory dump |
| 2373 // the events, all of which have the same dump ID. | 2373 // the events, all of which have the same dump ID. |
| 2374 | 2374 |
| 2375 // Calculate the range of the global memory dump. | 2375 // Calculate the range of the global memory dump. |
| 2376 var globalRange = new tr.b.Range(); | 2376 var globalRange = new tr.b.math.Range(); |
| 2377 for (var pid in dumpIdEvents) { | 2377 for (var pid in dumpIdEvents) { |
| 2378 var processEvents = dumpIdEvents[pid]; | 2378 var processEvents = dumpIdEvents[pid]; |
| 2379 for (var i = 0; i < processEvents.length; i++) | 2379 for (var i = 0; i < processEvents.length; i++) |
| 2380 globalRange.addValue(this.toModelTimeFromUs_(processEvents[i].ts)); | 2380 globalRange.addValue(this.toModelTimeFromUs_(processEvents[i].ts)); |
| 2381 } | 2381 } |
| 2382 if (globalRange.isEmpty) | 2382 if (globalRange.isEmpty) |
| 2383 throw new Error('Internal error: Global memory dump without events'); | 2383 throw new Error('Internal error: Global memory dump without events'); |
| 2384 | 2384 |
| 2385 // Create the global memory dump. | 2385 // Create the global memory dump. |
| 2386 var globalMemoryDump = new tr.model.GlobalMemoryDump( | 2386 var globalMemoryDump = new tr.model.GlobalMemoryDump( |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2418 // dumps have been parsed (i.e. it is necessary to iterate over the | 2418 // dumps have been parsed (i.e. it is necessary to iterate over the |
| 2419 // process memory dump trace events once more). | 2419 // process memory dump trace events once more). |
| 2420 this.parseMemoryDumpAllocatorEdges_(allMemoryAllocatorDumpsByGuid, | 2420 this.parseMemoryDumpAllocatorEdges_(allMemoryAllocatorDumpsByGuid, |
| 2421 dumpIdEvents, dumpId); | 2421 dumpIdEvents, dumpId); |
| 2422 }, | 2422 }, |
| 2423 | 2423 |
| 2424 createProcessMemoryDump_: function(globalMemoryDump, | 2424 createProcessMemoryDump_: function(globalMemoryDump, |
| 2425 globalMemoryAllocatorDumpsByFullName, levelsOfDetail, | 2425 globalMemoryAllocatorDumpsByFullName, levelsOfDetail, |
| 2426 allMemoryAllocatorDumpsByGuid, processEvents, pid, dumpId) { | 2426 allMemoryAllocatorDumpsByGuid, processEvents, pid, dumpId) { |
| 2427 // Calculate the range of the process memory dump. | 2427 // Calculate the range of the process memory dump. |
| 2428 var processRange = new tr.b.Range(); | 2428 var processRange = new tr.b.math.Range(); |
| 2429 for (var i = 0; i < processEvents.length; i++) | 2429 for (var i = 0; i < processEvents.length; i++) |
| 2430 processRange.addValue(this.toModelTimeFromUs_(processEvents[i].ts)); | 2430 processRange.addValue(this.toModelTimeFromUs_(processEvents[i].ts)); |
| 2431 if (processRange.isEmpty) | 2431 if (processRange.isEmpty) |
| 2432 throw new Error('Internal error: Process memory dump without events'); | 2432 throw new Error('Internal error: Process memory dump without events'); |
| 2433 | 2433 |
| 2434 // Create the process memory dump. | 2434 // Create the process memory dump. |
| 2435 var process = this.model_.getOrCreateProcess(pid); | 2435 var process = this.model_.getOrCreateProcess(pid); |
| 2436 var processMemoryDump = new tr.model.ProcessMemoryDump( | 2436 var processMemoryDump = new tr.model.ProcessMemoryDump( |
| 2437 globalMemoryDump, process, processRange.min); | 2437 globalMemoryDump, process, processRange.min); |
| 2438 processMemoryDump.duration = processRange.range; | 2438 processMemoryDump.duration = processRange.range; |
| (...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3105 } | 3105 } |
| 3106 }; | 3106 }; |
| 3107 | 3107 |
| 3108 tr.importer.Importer.register(TraceEventImporter); | 3108 tr.importer.Importer.register(TraceEventImporter); |
| 3109 | 3109 |
| 3110 return { | 3110 return { |
| 3111 TraceEventImporter, | 3111 TraceEventImporter, |
| 3112 }; | 3112 }; |
| 3113 }); | 3113 }); |
| 3114 </script> | 3114 </script> |
| OLD | NEW |