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

Unified Diff: runtime/vm/profiler.h

Issue 131853007: Add flag to control number of stack frames collected by profiler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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 | runtime/vm/profiler.cc » ('j') | runtime/vm/profiler.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/profiler.h
diff --git a/runtime/vm/profiler.h b/runtime/vm/profiler.h
index 706e64aab973de36abf5729989a9ba211ec42f4f..6c27c2d4bae71f2c6c85bbd6b1a3aaa93cfd750c 100644
--- a/runtime/vm/profiler.h
+++ b/runtime/vm/profiler.h
@@ -18,6 +18,7 @@ class JSONArray;
class JSONStream;
class ProfilerCodeRegionTable;
struct Sample;
+class SampleBuffer;
// Profiler
class Profiler : public AllStatic {
@@ -82,21 +83,26 @@ class IsolateProfilerData {
// Profile sample.
struct Sample {
siva 2014/01/16 23:34:23 why not just make it class Sample ?
Cutch 2014/01/17 16:02:25 Done.
- static const intptr_t kNumStackFrames = 6;
enum SampleType {
- kIsolateStart,
- kIsolateStop,
kIsolateSample,
};
+
int64_t timestamp;
ThreadId tid;
Isolate* isolate;
- uintptr_t pcs[kNumStackFrames];
SampleType type;
uint16_t vm_tags;
uint16_t runtime_tags;
+ uintptr_t pcs[0];
siva 2014/01/16 23:34:23 Document that this needs to be the last field, no
Cutch 2014/01/17 16:02:25 Done.
void Init(SampleType type, Isolate* isolate, int64_t timestamp, ThreadId tid);
+ void CopyInto(Sample* dst) const;
+
+ static Sample* Allocate();
+ static intptr_t InstanceSize();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(Sample);
};
@@ -109,14 +115,9 @@ class SampleBuffer {
~SampleBuffer();
intptr_t capacity() const { return capacity_; }
-
Sample* ReserveSample();
-
- Sample GetSample(intptr_t i) const {
- ASSERT(i >= 0);
- ASSERT(i < capacity_);
- return samples_[i];
- }
+ void CopySample(intptr_t i, Sample* sample) const;
+ Sample* At(intptr_t idx) const;
private:
Sample* samples_;
« no previous file with comments | « no previous file | runtime/vm/profiler.cc » ('j') | runtime/vm/profiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698