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

Unified Diff: runtime/vm/profiler_service.h

Issue 1525913002: Observatory: Include profiler samples in the timeline view. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 | « runtime/vm/profiler.cc ('k') | runtime/vm/profiler_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/profiler_service.h
diff --git a/runtime/vm/profiler_service.h b/runtime/vm/profiler_service.h
index 6052736856122400ba9de05e42a7dec465cfc7ee..e9315984db08cf8233dd53048d46f0cc00ae341f 100644
--- a/runtime/vm/profiler_service.h
+++ b/runtime/vm/profiler_service.h
@@ -28,6 +28,7 @@ class ProfileCodeTable;
class RawCode;
class RawFunction;
class SampleFilter;
+class ProcessedSampleBuffer;
// Profile data related to a |Function|.
class ProfileFunction : public ZoneAllocated {
@@ -250,6 +251,12 @@ class ProfileTrieNode : public ZoneAllocated {
intptr_t IndexOf(ProfileTrieNode* node);
+ intptr_t frame_id() const { return frame_id_; }
+ void set_frame_id(intptr_t id) {
+ ASSERT(frame_id_ == -1);
+ frame_id_ = id;
+ }
+
protected:
void SortChildren();
@@ -264,6 +271,7 @@ class ProfileTrieNode : public ZoneAllocated {
intptr_t table_index_;
intptr_t count_;
ZoneGrowableArray<ProfileTrieNode*> children_;
+ intptr_t frame_id_;
friend class ProfileBuilder;
};
@@ -315,10 +323,19 @@ class Profile : public ValueObject {
ProfileCode* GetCode(intptr_t index);
ProfileTrieNode* GetTrieRoot(TrieKind trie_kind);
- void PrintJSON(JSONStream* stream);
+ void PrintProfileJSON(JSONStream* stream);
+ void PrintTimelineJSON(JSONStream* stream);
private:
+ void PrintHeaderJSON(JSONObject* obj);
+ void PrintTimelineFrameJSON(JSONObject* frames,
+ ProfileTrieNode* current,
+ ProfileTrieNode* parent,
+ intptr_t* next_id);
+
Isolate* isolate_;
+ Zone* zone_;
+ ProcessedSampleBuffer* samples_;
ProfileCodeTable* live_code_;
ProfileCodeTable* dead_code_;
ProfileCodeTable* tag_code_;
@@ -385,6 +402,9 @@ class ProfilerService : public AllStatic {
Profile::TagOrder tag_order,
const Class& cls);
+ static void PrintTimelineJSON(JSONStream* stream,
+ Profile::TagOrder tag_order);
+
static void ClearSamples();
private:
@@ -392,7 +412,8 @@ class ProfilerService : public AllStatic {
JSONStream* stream,
Profile::TagOrder tag_order,
intptr_t extra_tags,
- SampleFilter* filter);
+ SampleFilter* filter,
+ bool as_timline);
};
} // namespace dart
« no previous file with comments | « runtime/vm/profiler.cc ('k') | runtime/vm/profiler_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698