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

Unified Diff: src/cpu-profiler.h

Issue 10871039: Replacing circular queue by single buffer in CPU Profiler. (Closed) Base URL: http://git.chromium.org/external/v8.git@profiling
Patch Set: removed constants that are no longer needed 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 2cef421f5175ab45e4f854802b8eb0fb4dc3edee..56934cc883e6d4f6654caf80756609e09561cfe0 100644
--- a/src/cpu-profiler.h
+++ b/src/cpu-profiler.h
@@ -30,7 +30,6 @@
#include "allocation.h"
#include "atomicops.h"
-#include "circular-queue.h"
#include "unbound-queue.h"
namespace v8 {
@@ -156,11 +155,11 @@ class ProfilerEventsProcessor : public Thread {
// Puts current stack into tick sample events buffer.
void AddCurrentStack();
- // 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());
+ // 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).
Jakob Kummerow 2012/09/04 11:25:18 long line. Also, can you put in an ASSERT that mak
+ INLINE(TickSample* StartTickSampleEvent());
+ INLINE(void FinishTickSampleEvent()) { ticks_buffer_is_empty_ = false; }
private:
union CodeEventsContainer {
@@ -172,7 +171,7 @@ class ProfilerEventsProcessor : public Thread {
// Called from events processing thread (Run() method.)
bool ProcessCodeEvent(unsigned* dequeue_order);
- bool ProcessTicks(int64_t stop_time, unsigned dequeue_order);
+ bool ProcessTicks(unsigned dequeue_order);
void ProcessEventsQueue(int64_t stop_time, unsigned* dequeue_order);
INLINE(static bool FilterOutCodeCreateEvent(Logger::LogEventsAndTags tag));
@@ -183,7 +182,8 @@ class ProfilerEventsProcessor : public Thread {
// Sampling interval in microseconds.
const int interval_in_useconds_;
UnboundQueue<CodeEventsContainer> events_buffer_;
- SamplingCircularQueue ticks_buffer_;
+ TickSampleEventRecord ticks_buffer_;
+ bool ticks_buffer_is_empty_;
UnboundQueue<TickSampleEventRecord> ticks_from_vm_buffer_;
unsigned enqueue_order_;
};
@@ -222,7 +222,9 @@ class CpuProfiler {
static bool HasDetachedProfiles();
// Invoked from stack sampler (thread or signal handler.)
- static TickSample* TickSampleEvent(Isolate* isolate);
+ // Finish should be called only after successful Start (returning non-NULL pointer).
Jakob Kummerow 2012/09/04 11:25:18 long line
+ static TickSample* StartTickSampleEvent(Isolate* isolate);
+ static void FinishTickSampleEvent(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') | src/cpu-profiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698