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

Unified Diff: runtime/vm/timeline_analysis.h

Issue 1287073006: Correct inclusive time and start tracking maximum exclusive time (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 | runtime/vm/timeline_analysis.cc » ('j') | runtime/vm/timeline_analysis.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/timeline_analysis.h
diff --git a/runtime/vm/timeline_analysis.h b/runtime/vm/timeline_analysis.h
index 184ccd462095bb88b43ac3072386c03762d464ca..5f5049b691674e3b0e8330f2825e58d745e256c4 100644
--- a/runtime/vm/timeline_analysis.h
+++ b/runtime/vm/timeline_analysis.h
@@ -121,17 +121,22 @@ class TimelineLabelPauseInfo : public ZoneAllocated {
return exclusive_micros_;
}
- int64_t max_duration_micros() const {
- return max_duration_micros_;
+ int64_t max_inclusive_micros() const {
+ return max_inclusive_micros_;
+ }
+
+ int64_t max_exclusive_micros() const {
+ return max_exclusive_micros_;
}
private:
// Adjusts |inclusive_micros_| and |exclusive_micros_| by |micros|.
- // Also, may adjust, max_duration_micros_.
- void OnPush(int64_t micros);
+ // Also, may adjust, max_inclusive_micros_.
+ void OnPush(int64_t micros, bool already_on_stack);
- // Subtracts |micros| from |exclusive_micros_|.
- void OnChildPush(int64_t micros);
+ // Adjusts |exclusive_micros_| by |exclusive_micros|.
+ // Also, may adjust |max_exclusive_micros_|.
+ void OnPop(int64_t exclusive_micros);
// Adjust inclusive micros.
void add_inclusive_micros(int64_t delta_micros) {
@@ -148,7 +153,8 @@ class TimelineLabelPauseInfo : public ZoneAllocated {
const char* name_;
int64_t inclusive_micros_;
int64_t exclusive_micros_;
- int64_t max_duration_micros_;
+ int64_t max_inclusive_micros_;
+ int64_t max_exclusive_micros_;
friend class TimelinePauses;
};
@@ -164,21 +170,30 @@ class TimelinePauses : public TimelineAnalysis {
void CalculatePauseTimesForThread(ThreadId tid);
- TimelineLabelPauseInfo* GetLabel(const char* name) const;
+ TimelineLabelPauseInfo* GetLabelPauseInfo(const char* name) const;
int64_t InclusiveTime(const char* name) const;
int64_t ExclusiveTime(const char* name) const;
- int64_t MaxDurationTime(const char* name) const;
+ int64_t MaxInclusiveTime(const char* name) const;
+ int64_t MaxExclusiveTime(const char* name) const;
private:
+ struct StackItem {
+ TimelineEvent* event;
+ TimelineLabelPauseInfo* pause_info;
+ int64_t exclusive_micros;
+ };
+
void ProcessThread(TimelineAnalysisThread* thread);
bool CheckStack(TimelineEvent* event);
void PopFinished(int64_t start);
void Push(TimelineEvent* event);
- TimelineLabelPauseInfo* GetTopLabel();
- TimelineLabelPauseInfo* GetOrAddLabel(const char* name);
+ bool IsLabelOnStack(const char* label);
+ intptr_t StackDepth() const;
+ StackItem& GetStackTop();
+ TimelineLabelPauseInfo* GetOrAddLabelPauseInfo(const char* name);
- ZoneGrowableArray<TimelineEvent*> stack_;
+ ZoneGrowableArray<StackItem> stack_;
ZoneGrowableArray<TimelineLabelPauseInfo*> labels_;
};
« no previous file with comments | « no previous file | runtime/vm/timeline_analysis.cc » ('j') | runtime/vm/timeline_analysis.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698