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

Side by Side Diff: src/sampler.h

Issue 259803002: Add timestamps to CPU profile samples. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix race Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « src/profile-generator.cc ('k') | src/sampler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 top_frame_type(StackFrame::NONE) {} 62 top_frame_type(StackFrame::NONE) {}
63 void Init(Isolate* isolate, const RegisterState& state); 63 void Init(Isolate* isolate, const RegisterState& state);
64 StateTag state; // The state of the VM. 64 StateTag state; // The state of the VM.
65 Address pc; // Instruction pointer. 65 Address pc; // Instruction pointer.
66 union { 66 union {
67 Address tos; // Top stack value (*sp). 67 Address tos; // Top stack value (*sp).
68 Address external_callback; 68 Address external_callback;
69 }; 69 };
70 static const int kMaxFramesCount = 64; 70 static const int kMaxFramesCount = 64;
71 Address stack[kMaxFramesCount]; // Call stack. 71 Address stack[kMaxFramesCount]; // Call stack.
72 TimeTicks timestamp;
72 int frames_count : 8; // Number of captured frames. 73 int frames_count : 8; // Number of captured frames.
73 bool has_external_callback : 1; 74 bool has_external_callback : 1;
74 StackFrame::Type top_frame_type : 4; 75 StackFrame::Type top_frame_type : 4;
75 }; 76 };
76 77
77 class Sampler { 78 class Sampler {
78 public: 79 public:
79 // Initializes the Sampler support. Called once at VM startup. 80 // Initializes the Sampler support. Called once at VM startup.
80 static void SetUp(); 81 static void SetUp();
81 static void TearDown(); 82 static void TearDown();
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 bool is_counting_samples_; 142 bool is_counting_samples_;
142 // Counts stack samples taken in JS VM state. 143 // Counts stack samples taken in JS VM state.
143 unsigned js_and_external_sample_count_; 144 unsigned js_and_external_sample_count_;
144 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); 145 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler);
145 }; 146 };
146 147
147 148
148 } } // namespace v8::internal 149 } } // namespace v8::internal
149 150
150 #endif // V8_SAMPLER_H_ 151 #endif // V8_SAMPLER_H_
OLDNEW
« no previous file with comments | « src/profile-generator.cc ('k') | src/sampler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698