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

Unified Diff: tracing/tracing/extras/importer/trace_event_importer_test.html

Issue 1276003004: Process v8 sampling data into the trace model. (Closed) Base URL: git@github.com:catapult-project/catapult.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: tracing/tracing/extras/importer/trace_event_importer_test.html
diff --git a/tracing/tracing/extras/importer/trace_event_importer_test.html b/tracing/tracing/extras/importer/trace_event_importer_test.html
index fe6044cf7130f63b7e9b562573d91c6a021256e8..dc2638c409c3eec6dfc5638a91c43a64d97c8285 100644
--- a/tracing/tracing/extras/importer/trace_event_importer_test.html
+++ b/tracing/tracing/extras/importer/trace_event_importer_test.html
@@ -12,7 +12,7 @@ found in the LICENSE file.
<script>
'use strict';
-tr.b.unittest.testSuite(function() { // @suppress longLineCheck
+tr.b.unittest.testSuite(function() {
var findSliceNamed = tr.c.test_utils.findSliceNamed;
var makeModel = function(events, opt_shift, opt_prune) {
@@ -1901,6 +1901,33 @@ tr.b.unittest.testSuite(function() { // @suppress longLineCheck
assert.isFalse(m.hasImportWarnings);
});
+ test('importV8Samples', function() {
+ var eventData = {
+ traceEvents: [
+ { name: 'JitCodeAdded', args: {data: {code_len: 2, name: 'LazyCompile:~foo http://example.com/bar.js:23', code_start: '0x123'}}, pid: 1, ts: 0, cat: 'test', tid: 2, ph: 'I' }, // @suppress longLineCheck
+ { name: 'JitCodeAdded', args: {data: {code_len: 20, name: 'bar', code_start: '0x223'}}, pid: 1, ts: 0, cat: 'test', tid: 2, ph: 'I' }, // @suppress longLineCheck
+ { name: 'JitCodeMoved', args: {data: {code_len: 2, old_code_start: '0x226', new_code_start: '0x224'}}, pid: 1, ts: 0, cat: 'test', tid: 2, ph: 'I' }, // @suppress longLineCheck
+ { name: 'V8Sample', args: {data: {stack: ['0x124', '0x224']}}, pid: 1, ts: 0, cat: 'test', tid: 2, ph: 'P' }, // @suppress longLineCheck
+ { name: 'V8Sample', args: {data: {stack: [], vm_state: 'gc'}}, pid: 1, ts: 10, cat: 'test', tid: 2, ph: 'P' } // @suppress longLineCheck
+ ]
+ };
+
+ var m = makeModel(eventData);
+ var p = m.processes[1];
+ var t = p.threads[2];
+
+ assert.isFalse(m.hasImportWarnings);
+ assert.equal(t.samples.length, 2);
+
+ var sample = t.samples_[0];
+ assert.equal(sample.leafStackFrame.title,
+ 'foo http://example.com/bar.js:23');
+ assert.equal(sample.leafStackFrame.parentFrame.title, 'bar');
+
+ var sample = t.samples_[1];
+ assert.equal(sample.leafStackFrame.title, 'gc');
+ });
+
test('importSimpleObject', function() {
var events = [
{ts: 10000, pid: 1, tid: 1, ph: 'N', cat: 'c', id: '0x1000', name: 'a', args: {}}, // @suppress longLineCheck

Powered by Google App Engine
This is Rietveld 408576698