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

Side by Side Diff: src/cpu-profiler.h

Issue 23011029: Do not start sampler thread when CpuProfiler is active (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase Created 7 years, 3 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 | « no previous file | src/cpu-profiler.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 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 // next record of the buffer. 156 // next record of the buffer.
157 inline TickSample* StartTickSample(); 157 inline TickSample* StartTickSample();
158 inline void FinishTickSample(); 158 inline void FinishTickSample();
159 159
160 private: 160 private:
161 // Called from events processing thread (Run() method.) 161 // Called from events processing thread (Run() method.)
162 bool ProcessCodeEvent(); 162 bool ProcessCodeEvent();
163 bool ProcessTicks(); 163 bool ProcessTicks();
164 164
165 void ProcessEventsAndDoSample(); 165 void ProcessEventsAndDoSample();
166 void ProcessEventsAndYield();
167 166
168 ProfileGenerator* generator_; 167 ProfileGenerator* generator_;
169 Sampler* sampler_; 168 Sampler* sampler_;
170 bool running_; 169 bool running_;
171 // Sampling period in microseconds. 170 // Sampling period in microseconds.
172 const TimeDelta period_; 171 const TimeDelta period_;
173 UnboundQueue<CodeEventsContainer> events_buffer_; 172 UnboundQueue<CodeEventsContainer> events_buffer_;
174 static const size_t kTickSampleBufferSize = 1 * MB; 173 static const size_t kTickSampleBufferSize = 1 * MB;
175 static const size_t kTickSampleQueueLength = 174 static const size_t kTickSampleQueueLength =
176 kTickSampleBufferSize / sizeof(TickSampleEventRecord); 175 kTickSampleBufferSize / sizeof(TickSampleEventRecord);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 void StopProcessor(); 258 void StopProcessor();
260 void ResetProfiles(); 259 void ResetProfiles();
261 void LogBuiltins(); 260 void LogBuiltins();
262 261
263 Isolate* isolate_; 262 Isolate* isolate_;
264 CpuProfilesCollection* profiles_; 263 CpuProfilesCollection* profiles_;
265 unsigned next_profile_uid_; 264 unsigned next_profile_uid_;
266 ProfileGenerator* generator_; 265 ProfileGenerator* generator_;
267 ProfilerEventsProcessor* processor_; 266 ProfilerEventsProcessor* processor_;
268 bool saved_is_logging_; 267 bool saved_is_logging_;
269 bool need_to_stop_sampler_;
270 bool is_profiling_; 268 bool is_profiling_;
271 269
272 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); 270 DISALLOW_COPY_AND_ASSIGN(CpuProfiler);
273 }; 271 };
274 272
275 } } // namespace v8::internal 273 } } // namespace v8::internal
276 274
277 275
278 #endif // V8_CPU_PROFILER_H_ 276 #endif // V8_CPU_PROFILER_H_
OLDNEW
« no previous file with comments | « no previous file | src/cpu-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698