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

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: + unit test 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
Index: runtime/vm/profiler_service.h
diff --git a/runtime/vm/profiler_service.h b/runtime/vm/profiler_service.h
index 6052736856122400ba9de05e42a7dec465cfc7ee..1586cc0fb2060e1f859d0afc4a4195df222e7e37 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,9 @@ class ProfileTrieNode : public ZoneAllocated {
intptr_t IndexOf(ProfileTrieNode* node);
+ intptr_t frame_id() const { return frame_id_; }
+ void set_frame_id(intptr_t id) { frame_id_ = id; }
Cutch 2015/12/15 21:54:59 Rewrite to be: ASSERT(frame_id_ == -1); frame_id_
rmacnak 2015/12/16 00:14:21 Done.
+
protected:
void SortChildren();
@@ -264,6 +268,7 @@ class ProfileTrieNode : public ZoneAllocated {
intptr_t table_index_;
intptr_t count_;
ZoneGrowableArray<ProfileTrieNode*> children_;
+ intptr_t frame_id_;
friend class ProfileBuilder;
};
@@ -315,10 +320,18 @@ 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 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 +398,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 +408,8 @@ class ProfilerService : public AllStatic {
JSONStream* stream,
Profile::TagOrder tag_order,
intptr_t extra_tags,
- SampleFilter* filter);
+ SampleFilter* filter,
+ bool as_timline);
};
} // namespace dart

Powered by Google App Engine
This is Rietveld 408576698