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

Unified Diff: src/cpu-profiler.h

Issue 1635005: Allow new CPU profiling subsystem to coexist nicely with the old one. (Closed)
Patch Set: Fix TickSampleEvent Created 10 years, 8 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 | « SConstruct ('k') | src/cpu-profiler.cc » ('j') | src/cpu-profiler-inl.h » ('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 5f263d1a9fe2b9799a20040b6249c1b38ea03299..594e44ec685e5f1bbdd57257b773961729f4e42c 100644
--- a/src/cpu-profiler.h
+++ b/src/cpu-profiler.h
@@ -103,18 +103,21 @@ class CodeAliasEventRecord : public CodeEventRecord {
class TickSampleEventRecord BASE_EMBEDDED {
public:
- // In memory, the first machine word of a TickSampleEventRecord will be the
- // first entry of TickSample, that is -- the VM state field.
- // TickSample is put first, because 'order' can become equal to
- // SamplingCircularQueue::kClear, while VM state can't, see
- // the definition of 'enum StateTag'.
- TickSample sample;
+ // The first machine word of a TickSampleEventRecord must not ever
+ // become equal to SamplingCircularQueue::kClear. As both order and
+ // TickSample's first field are not reliable in this sense (order
+ // can overflow, TickSample can have all fields reset), we are
+ // forced to use an artificial filler field.
+ int filler;
unsigned order;
+ TickSample sample;
static TickSampleEventRecord* cast(void* value) {
return reinterpret_cast<TickSampleEventRecord*>(value);
}
+ INLINE(static TickSampleEventRecord* init(void* value));
+
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(TickSampleEventRecord);
};
@@ -256,6 +259,7 @@ class CpuProfiler {
unsigned next_profile_uid_;
ProfileGenerator* generator_;
ProfilerEventsProcessor* processor_;
+ int saved_logging_nesting_;
static CpuProfiler* singleton_;
« no previous file with comments | « SConstruct ('k') | src/cpu-profiler.cc » ('j') | src/cpu-profiler-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698