Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Side by Side Diff: chrome/browser/resources/profiler/profiler.js

Issue 2386123003: Add heap allocator usage to task profiler. (Closed)
Patch Set: Figure out where the @#$%! corruption is coming from. Move heap tracking to TaskStopwatch." Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var g_browserBridge; 5 var g_browserBridge;
6 var g_mainView; 6 var g_mainView;
7 7
8 // TODO(eroman): The handling of "max" across snapshots is not correct. 8 // TODO(eroman): The handling of "max" across snapshots is not correct.
9 // For starters the browser needs to be aware to generate new maximums. 9 // For starters the browser needs to be aware to generate new maximums.
10 // Secondly, we need to take into account the "max" of intermediary snapshots, 10 // Secondly, we need to take into account the "max" of intermediary snapshots,
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 var BEGIN_KEY = 1; // Start at 1 rather than 0 to simplify sorting code. 120 var BEGIN_KEY = 1; // Start at 1 rather than 0 to simplify sorting code.
121 var END_KEY = BEGIN_KEY; 121 var END_KEY = BEGIN_KEY;
122 122
123 var KEY_COUNT = END_KEY++; 123 var KEY_COUNT = END_KEY++;
124 var KEY_RUN_TIME = END_KEY++; 124 var KEY_RUN_TIME = END_KEY++;
125 var KEY_AVG_RUN_TIME = END_KEY++; 125 var KEY_AVG_RUN_TIME = END_KEY++;
126 var KEY_MAX_RUN_TIME = END_KEY++; 126 var KEY_MAX_RUN_TIME = END_KEY++;
127 var KEY_QUEUE_TIME = END_KEY++; 127 var KEY_QUEUE_TIME = END_KEY++;
128 var KEY_AVG_QUEUE_TIME = END_KEY++; 128 var KEY_AVG_QUEUE_TIME = END_KEY++;
129 var KEY_ALLOC_OPS = END_KEY++;
130 var KEY_FREE_OPS = END_KEY++;
131 var KEY_ALLOCATED_BYTES = END_KEY++;
132 var KEY_FREED_BYTES = END_KEY++;
133 var KEY_NET_BYTES = END_KEY++;
134 var KEY_ALLOC_OVERHEAD_BYTES = END_KEY++;
135 var KEY_MAX_ALLOCATED_BYTES = END_KEY++;
129 var KEY_MAX_QUEUE_TIME = END_KEY++; 136 var KEY_MAX_QUEUE_TIME = END_KEY++;
130 var KEY_BIRTH_THREAD = END_KEY++; 137 var KEY_BIRTH_THREAD = END_KEY++;
131 var KEY_DEATH_THREAD = END_KEY++; 138 var KEY_DEATH_THREAD = END_KEY++;
132 var KEY_PROCESS_TYPE = END_KEY++; 139 var KEY_PROCESS_TYPE = END_KEY++;
133 var KEY_PROCESS_ID = END_KEY++; 140 var KEY_PROCESS_ID = END_KEY++;
134 var KEY_FUNCTION_NAME = END_KEY++; 141 var KEY_FUNCTION_NAME = END_KEY++;
135 var KEY_SOURCE_LOCATION = END_KEY++; 142 var KEY_SOURCE_LOCATION = END_KEY++;
136 var KEY_FILE_NAME = END_KEY++; 143 var KEY_FILE_NAME = END_KEY++;
137 var KEY_LINE_NUMBER = END_KEY++; 144 var KEY_LINE_NUMBER = END_KEY++;
138 145
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 KEY_PROPERTIES[KEY_RUN_TIME] = { 418 KEY_PROPERTIES[KEY_RUN_TIME] = {
412 name: 'Total run time', 419 name: 'Total run time',
413 cellAlignment: 'right', 420 cellAlignment: 'right',
414 sortDescending: true, 421 sortDescending: true,
415 textPrinter: formatNumberAsText, 422 textPrinter: formatNumberAsText,
416 inputJsonKey: 'death_data.run_ms', 423 inputJsonKey: 'death_data.run_ms',
417 aggregator: SumAggregator, 424 aggregator: SumAggregator,
418 diff: diffFuncForCount, 425 diff: diffFuncForCount,
419 }; 426 };
420 427
428 KEY_PROPERTIES[KEY_ALLOC_OPS] = {
429 name: 'Allocation count',
430 cellAlignment: 'right',
431 sortDescending: true,
432 textPrinter: formatNumberAsText,
433 inputJsonKey: 'death_data.alloc_ops',
434 aggregator: SumAggregator,
435 diff: diffFuncForCount,
436 };
437
438 KEY_PROPERTIES[KEY_FREE_OPS] = {
439 name: 'Free Count',
440 cellAlignment: 'right',
441 sortDescending: true,
442 textPrinter: formatNumberAsText,
443 inputJsonKey: 'death_data.free_ops',
444 aggregator: SumAggregator,
445 diff: diffFuncForCount,
446 };
447
448 KEY_PROPERTIES[KEY_ALLOCATED_BYTES] = {
449 name: 'Allocated bytes',
450 cellAlignment: 'right',
451 sortDescending: true,
452 textPrinter: formatNumberAsText,
453 inputJsonKey: 'death_data.allocated_bytes',
454 aggregator: SumAggregator,
455 diff: diffFuncForCount,
456 };
457
458 KEY_PROPERTIES[KEY_FREED_BYTES] = {
459 name: 'Freed bytes',
460 cellAlignment: 'right',
461 sortDescending: true,
462 textPrinter: formatNumberAsText,
463 inputJsonKey: 'death_data.freed_bytes',
464 aggregator: SumAggregator,
465 diff: diffFuncForCount,
466 };
467
468 KEY_PROPERTIES[KEY_NET_BYTES] = {
469 name: 'Net allocated bytes',
470 cellAlignment: 'right',
471 sortDescending: true,
472 textPrinter: formatNumberAsText,
473 inputJsonKey: 'death_data.net_allocated_bytes',
474 aggregator: SumAggregator,
475 diff: diffFuncForCount,
476 };
477
478 KEY_PROPERTIES[KEY_ALLOC_OVERHEAD_BYTES] = {
479 name: 'Overhead bytes',
480 cellAlignment: 'right',
481 sortDescending: true,
482 textPrinter: formatNumberAsText,
483 inputJsonKey: 'death_data.alloc_overhead_bytes',
484 aggregator: SumAggregator,
485 diff: diffFuncForCount,
486 };
487
488 KEY_PROPERTIES[KEY_MAX_ALLOCATED_BYTES] = {
489 name: 'Max allocated (outstanding) bytes',
490 cellAlignment: 'right',
491 sortDescending: true,
492 textPrinter: formatNumberAsText,
493 inputJsonKey: 'death_data.max_allocated_bytes',
494 aggregator: MaxAggregator,
495 diff: diffFuncForMax,
496 };
497
421 KEY_PROPERTIES[KEY_AVG_RUN_TIME] = { 498 KEY_PROPERTIES[KEY_AVG_RUN_TIME] = {
422 name: 'Avg run time', 499 name: 'Avg run time',
423 cellAlignment: 'right', 500 cellAlignment: 'right',
424 sortDescending: true, 501 sortDescending: true,
425 textPrinter: formatNumberAsText, 502 textPrinter: formatNumberAsText,
426 aggregator: AvgAggregator.create(KEY_RUN_TIME, KEY_COUNT), 503 aggregator: AvgAggregator.create(KEY_RUN_TIME, KEY_COUNT),
427 }; 504 };
428 505
429 KEY_PROPERTIES[KEY_MAX_RUN_TIME] = { 506 KEY_PROPERTIES[KEY_MAX_RUN_TIME] = {
430 name: 'Max run time', 507 name: 'Max run time',
(...skipping 12 matching lines...) Expand all
443 textPrinter: formatNumberAsText, 520 textPrinter: formatNumberAsText,
444 aggregator: AvgAggregator.create(KEY_QUEUE_TIME, KEY_COUNT), 521 aggregator: AvgAggregator.create(KEY_QUEUE_TIME, KEY_COUNT),
445 }; 522 };
446 523
447 KEY_PROPERTIES[KEY_SOURCE_LOCATION] = { 524 KEY_PROPERTIES[KEY_SOURCE_LOCATION] = {
448 name: 'Source location', 525 name: 'Source location',
449 type: 'string', 526 type: 'string',
450 aggregator: UniquifyAggregator, 527 aggregator: UniquifyAggregator,
451 }; 528 };
452 529
530
453 /** 531 /**
454 * Returns the string name for |key|. 532 * Returns the string name for |key|.
455 */ 533 */
456 function getNameForKey(key) { 534 function getNameForKey(key) {
457 var props = KEY_PROPERTIES[key]; 535 var props = KEY_PROPERTIES[key];
458 if (props == undefined) 536 if (props == undefined)
459 throw 'Did not define properties for key: ' + key; 537 throw 'Did not define properties for key: ' + key;
460 return props.name; 538 return props.name;
461 } 539 }
462 540
(...skipping 1740 matching lines...) Expand 10 before | Expand all | Expand 10 after
2203 groupKey.push(entry); 2281 groupKey.push(entry);
2204 } 2282 }
2205 2283
2206 return JSON.stringify(groupKey); 2284 return JSON.stringify(groupKey);
2207 }; 2285 };
2208 }, 2286 },
2209 }; 2287 };
2210 2288
2211 return MainView; 2289 return MainView;
2212 })(); 2290 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698