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

Unified Diff: src/cpu-profiler.h

Issue 11428103: Revert "Perform CPU sampling by CPU sampling thread only iff processing thread is not running." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 1 month 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') | no next file with comments »
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 f4bc0c7c74c704d08831d113be99f574af0679ff..9cd44842095ccabe25d0ef74f0c0f0b53dde958d 100644
--- a/src/cpu-profiler.h
+++ b/src/cpu-profiler.h
@@ -124,9 +124,7 @@ class TickSampleEventRecord {
// methods called by event producers: VM and stack sampler threads.
class ProfilerEventsProcessor : public Thread {
public:
- explicit ProfilerEventsProcessor(ProfileGenerator* generator,
- Sampler* sampler,
- int period_in_useconds);
+ explicit ProfilerEventsProcessor(ProfileGenerator* generator);
virtual ~ProfilerEventsProcessor() {}
// Thread control.
@@ -158,12 +156,11 @@ class ProfilerEventsProcessor : public Thread {
// Puts current stack into tick sample events buffer.
void AddCurrentStack();
- // StartTickSampleEvent returns a pointer only if the ticks_buffer_ is empty,
- // FinishTickSampleEvent marks the ticks_buffer_ as filled.
- // Finish should be called only after successful Start (returning non-NULL
- // pointer).
- INLINE(TickSample* StartTickSampleEvent());
- INLINE(void FinishTickSampleEvent());
+ // Tick sample events are filled directly in the buffer of the circular
+ // queue (because the structure is of fixed width, but usually not all
+ // stack frame entries are filled.) This method returns a pointer to the
+ // next record of the buffer.
+ INLINE(TickSample* TickSampleEvent());
private:
union CodeEventsContainer {
@@ -176,19 +173,13 @@ class ProfilerEventsProcessor : public Thread {
// Called from events processing thread (Run() method.)
bool ProcessCodeEvent(unsigned* dequeue_order);
bool ProcessTicks(unsigned dequeue_order);
- void ProcessEventsQueue(int64_t stop_time, unsigned* dequeue_order);
INLINE(static bool FilterOutCodeCreateEvent(Logger::LogEventsAndTags tag));
ProfileGenerator* generator_;
- Sampler* sampler_;
bool running_;
- // Sampling period in microseconds.
- const int period_in_useconds_;
UnboundQueue<CodeEventsContainer> events_buffer_;
- TickSampleEventRecord ticks_buffer_;
- bool ticks_buffer_is_empty_;
- bool ticks_buffer_is_initialized_;
+ SamplingCircularQueue ticks_buffer_;
UnboundQueue<TickSampleEventRecord> ticks_from_vm_buffer_;
unsigned enqueue_order_;
};
@@ -227,10 +218,7 @@ class CpuProfiler {
static bool HasDetachedProfiles();
// Invoked from stack sampler (thread or signal handler.)
- // Finish should be called only after successful Start (returning non-NULL
- // pointer).
- static TickSample* StartTickSampleEvent(Isolate* isolate);
- static void FinishTickSampleEvent(Isolate* isolate);
+ static TickSample* TickSampleEvent(Isolate* isolate);
// Must be called via PROFILE macro, otherwise will crash when
// profiling is not enabled.
« 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