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

Side by Side Diff: tools/tickprocessor.js

Issue 11428025: Include more information in --prof log. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years 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 | Annotate | Revision Log
« tools/plot-timer-events.js ('K') | « tools/plot-timer-events.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 case "~": return Profile.CodeState.OPTIMIZABLE; 66 case "~": return Profile.CodeState.OPTIMIZABLE;
67 case "*": return Profile.CodeState.OPTIMIZED; 67 case "*": return Profile.CodeState.OPTIMIZED;
68 } 68 }
69 throw new Error("unknown code state: " + s); 69 throw new Error("unknown code state: " + s);
70 } 70 }
71 71
72 72
73 function SnapshotLogProcessor() { 73 function SnapshotLogProcessor() {
74 LogReader.call(this, { 74 LogReader.call(this, {
75 'code-creation': { 75 'code-creation': {
76 parsers: [null, parseInt, parseInt, null, 'var-args'], 76 parsers: [null, parseInt, parseInt, parseInt, null, 'var-args'],
77 processor: this.processCodeCreation }, 77 processor: this.processCodeCreation },
78 'code-move': { parsers: [parseInt, parseInt], 78 'code-move': { parsers: [parseInt, parseInt],
79 processor: this.processCodeMove }, 79 processor: this.processCodeMove },
80 'code-delete': { parsers: [parseInt], 80 'code-delete': { parsers: [parseInt],
81 processor: this.processCodeDelete }, 81 processor: this.processCodeDelete },
82 'function-creation': null, 82 'function-creation': null,
83 'function-move': null, 83 'function-move': null,
84 'function-delete': null, 84 'function-delete': null,
85 'sfi-move': null, 85 'sfi-move': null,
86 'snapshot-pos': { parsers: [parseInt, parseInt], 86 'snapshot-pos': { parsers: [parseInt, parseInt],
(...skipping 13 matching lines...) Expand all
100 } 100 }
101 }; 101 };
102 102
103 this.profile_ = new V8Profile(); 103 this.profile_ = new V8Profile();
104 this.serializedEntries_ = []; 104 this.serializedEntries_ = [];
105 } 105 }
106 inherits(SnapshotLogProcessor, LogReader); 106 inherits(SnapshotLogProcessor, LogReader);
107 107
108 108
109 SnapshotLogProcessor.prototype.processCodeCreation = function( 109 SnapshotLogProcessor.prototype.processCodeCreation = function(
110 type, start, size, name, maybe_func) { 110 type, kind, start, size, name, maybe_func) {
111 if (maybe_func.length) { 111 if (maybe_func.length) {
112 var funcAddr = parseInt(maybe_func[0]); 112 var funcAddr = parseInt(maybe_func[0]);
113 var state = parseState(maybe_func[1]); 113 var state = parseState(maybe_func[1]);
114 this.profile_.addFuncCode(type, name, start, size, funcAddr, state); 114 this.profile_.addFuncCode(type, name, start, size, funcAddr, state);
115 } else { 115 } else {
116 this.profile_.addCode(type, name, start, size); 116 this.profile_.addCode(type, name, start, size);
117 } 117 }
118 }; 118 };
119 119
120 120
(...skipping 28 matching lines...) Expand all
149 cppEntriesProvider, 149 cppEntriesProvider,
150 separateIc, 150 separateIc,
151 callGraphSize, 151 callGraphSize,
152 ignoreUnknown, 152 ignoreUnknown,
153 stateFilter, 153 stateFilter,
154 snapshotLogProcessor) { 154 snapshotLogProcessor) {
155 LogReader.call(this, { 155 LogReader.call(this, {
156 'shared-library': { parsers: [null, parseInt, parseInt], 156 'shared-library': { parsers: [null, parseInt, parseInt],
157 processor: this.processSharedLibrary }, 157 processor: this.processSharedLibrary },
158 'code-creation': { 158 'code-creation': {
159 parsers: [null, parseInt, parseInt, null, 'var-args'], 159 parsers: [null, parseInt, parseInt, parseInt, null, 'var-args'],
160 processor: this.processCodeCreation }, 160 processor: this.processCodeCreation },
161 'code-move': { parsers: [parseInt, parseInt], 161 'code-move': { parsers: [parseInt, parseInt],
162 processor: this.processCodeMove }, 162 processor: this.processCodeMove },
163 'code-delete': { parsers: [parseInt], 163 'code-delete': { parsers: [parseInt],
164 processor: this.processCodeDelete }, 164 processor: this.processCodeDelete },
165 'sfi-move': { parsers: [parseInt, parseInt], 165 'sfi-move': { parsers: [parseInt, parseInt],
166 processor: this.processFunctionMove }, 166 processor: this.processFunctionMove },
167 'snapshot-pos': { parsers: [parseInt, parseInt], 167 'snapshot-pos': { parsers: [parseInt, parseInt],
168 processor: this.processSnapshotPosition }, 168 processor: this.processSnapshotPosition },
169 'tick': { 169 'tick': {
170 parsers: [parseInt, parseInt, parseInt, 170 parsers: [parseInt, parseInt, parseInt, parseInt,
171 parseInt, parseInt, 'var-args'], 171 parseInt, parseInt, 'var-args'],
172 processor: this.processTick }, 172 processor: this.processTick },
173 'heap-sample-begin': { parsers: [null, null, parseInt], 173 'heap-sample-begin': { parsers: [null, null, parseInt],
174 processor: this.processHeapSampleBegin }, 174 processor: this.processHeapSampleBegin },
175 'heap-sample-end': { parsers: [null, null], 175 'heap-sample-end': { parsers: [null, null],
176 processor: this.processHeapSampleEnd }, 176 processor: this.processHeapSampleEnd },
177 // Ignored events. 177 // Ignored events.
178 'profiler': null, 178 'profiler': null,
179 'function-creation': null, 179 'function-creation': null,
180 'function-move': null, 180 'function-move': null,
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 var self = this; 302 var self = this;
303 var libFuncs = this.cppEntriesProvider_.parseVmSymbols( 303 var libFuncs = this.cppEntriesProvider_.parseVmSymbols(
304 name, startAddr, endAddr, function(fName, fStart, fEnd) { 304 name, startAddr, endAddr, function(fName, fStart, fEnd) {
305 self.profile_.addStaticCode(fName, fStart, fEnd); 305 self.profile_.addStaticCode(fName, fStart, fEnd);
306 self.setCodeType(fName, 'CPP'); 306 self.setCodeType(fName, 'CPP');
307 }); 307 });
308 }; 308 };
309 309
310 310
311 TickProcessor.prototype.processCodeCreation = function( 311 TickProcessor.prototype.processCodeCreation = function(
312 type, start, size, name, maybe_func) { 312 type, kind, start, size, name, maybe_func) {
313 name = this.deserializedEntriesNames_[start] || name; 313 name = this.deserializedEntriesNames_[start] || name;
314 if (maybe_func.length) { 314 if (maybe_func.length) {
315 var funcAddr = parseInt(maybe_func[0]); 315 var funcAddr = parseInt(maybe_func[0]);
316 var state = parseState(maybe_func[1]); 316 var state = parseState(maybe_func[1]);
317 this.profile_.addFuncCode(type, name, start, size, funcAddr, state); 317 this.profile_.addFuncCode(type, name, start, size, funcAddr, state);
318 } else { 318 } else {
319 this.profile_.addCode(type, name, start, size); 319 this.profile_.addCode(type, name, start, size);
320 } 320 }
321 }; 321 };
322 322
(...skipping 20 matching lines...) Expand all
343 } 343 }
344 }; 344 };
345 345
346 346
347 TickProcessor.prototype.includeTick = function(vmState) { 347 TickProcessor.prototype.includeTick = function(vmState) {
348 return this.stateFilter_ == null || this.stateFilter_ == vmState; 348 return this.stateFilter_ == null || this.stateFilter_ == vmState;
349 }; 349 };
350 350
351 TickProcessor.prototype.processTick = function(pc, 351 TickProcessor.prototype.processTick = function(pc,
352 sp, 352 sp,
353 ns_since_start,
353 is_external_callback, 354 is_external_callback,
354 tos_or_external_callback, 355 tos_or_external_callback,
355 vmState, 356 vmState,
356 stack) { 357 stack) {
357 this.ticks_.total++; 358 this.ticks_.total++;
358 if (vmState == TickProcessor.VmStates.GC) this.ticks_.gc++; 359 if (vmState == TickProcessor.VmStates.GC) this.ticks_.gc++;
359 if (!this.includeTick(vmState)) { 360 if (!this.includeTick(vmState)) {
360 this.ticks_.excluded++; 361 this.ticks_.excluded++;
361 return; 362 return;
362 } 363 }
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 if (arg !== synArg && dispatch === this.argsDispatch_[synArg]) { 872 if (arg !== synArg && dispatch === this.argsDispatch_[synArg]) {
872 synonims.push(synArg); 873 synonims.push(synArg);
873 delete this.argsDispatch_[synArg]; 874 delete this.argsDispatch_[synArg];
874 } 875 }
875 } 876 }
876 print(' ' + padRight(synonims.join(', '), 20) + dispatch[2]); 877 print(' ' + padRight(synonims.join(', '), 20) + dispatch[2]);
877 } 878 }
878 quit(2); 879 quit(2);
879 }; 880 };
880 881
OLDNEW
« tools/plot-timer-events.js ('K') | « tools/plot-timer-events.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698