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

Unified Diff: src/cpu-profiler.h

Issue 10857035: Moving cpu profiling into its own thread. (Closed) Base URL: http://git.chromium.org/external/v8.git@master
Patch Set: added a flag to switch between old and new versions Created 8 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
« no previous file with comments | « no previous file | src/cpu-profiler.cc » ('j') | src/cpu-profiler.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cpu-profiler.h
diff --git a/src/cpu-profiler.h b/src/cpu-profiler.h
index 6e2e771a41fbfa3c8e59d3066d02cbb559896a1e..f72593c190658650920290b9d7b759fd6adc2102 100644
--- a/src/cpu-profiler.h
+++ b/src/cpu-profiler.h
@@ -122,9 +122,9 @@ class TickSampleEventRecord {
// This class implements both the profile events processor thread and
// methods called by event producers: VM and stack sampler threads.
-class ProfilerEventsProcessor : public Thread {
+class ProfilerEventsProcessor : public CpuProfilerThread {
public:
- explicit ProfilerEventsProcessor(ProfileGenerator* generator);
+ explicit ProfilerEventsProcessor(ProfileGenerator* generator, Sampler* sampler, int interval);
virtual ~ProfilerEventsProcessor() {}
// Thread control.
@@ -171,13 +171,16 @@ class ProfilerEventsProcessor : public Thread {
};
// Called from events processing thread (Run() method.)
- bool ProcessCodeEvent(unsigned* dequeue_order);
- bool ProcessTicks(unsigned dequeue_order);
+ bool ProcessCodeEvent(unsigned& dequeue_order);
+ bool ProcessTicks(unsigned dequeue_order, int64_t start, int64_t time_limit);
+ void ProcessEventsQueue(unsigned& dequeue_order, int64_t start, int64_t time_limit);
INLINE(static bool FilterOutCodeCreateEvent(Logger::LogEventsAndTags tag));
ProfileGenerator* generator_;
bool running_;
+ // Sampling interval in microseconds.
+ const int interval_;
UnboundQueue<CodeEventsContainer> events_buffer_;
SamplingCircularQueue ticks_buffer_;
UnboundQueue<TickSampleEventRecord> ticks_from_vm_buffer_;
« no previous file with comments | « no previous file | src/cpu-profiler.cc » ('j') | src/cpu-profiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698