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

Unified Diff: tracing/tracing/ui/tracks/process_track_base.html

Issue 2450073002: Include scheduling-only threads in tracks (Closed)
Patch Set: Include scheduling-only threads in tracks Created 4 years, 2 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
Index: tracing/tracing/ui/tracks/process_track_base.html
diff --git a/tracing/tracing/ui/tracks/process_track_base.html b/tracing/tracing/ui/tracks/process_track_base.html
index b56b2cf30029e270679a41392ee3a75f3d5cd538..cce46c86b540355e9e82510d1923f2d1c92e6763 100644
--- a/tracing/tracing/ui/tracks/process_track_base.html
+++ b/tracing/tracing/ui/tracks/process_track_base.html
@@ -16,6 +16,7 @@ found in the LICENSE file.
<link rel="import" href="/tracing/ui/tracks/frame_track.html">
<link rel="import" href="/tracing/ui/tracks/object_instance_group_track.html">
<link rel="import" href="/tracing/ui/tracks/process_summary_track.html">
+<link rel="import" href="/tracing/ui/tracks/sched_group_track.html">
<link rel="import" href="/tracing/ui/tracks/spacing_track.html">
<link rel="import" href="/tracing/ui/tracks/thread_track.html">
@@ -137,12 +138,6 @@ tr.exportTo('tr.ui.tracks', function() {
this.didAppendTracks_();
},
- addEventsToTrackMap: function(eventToTrackMap) {
- this.tracks_.forEach(function(track) {
- track.addEventsToTrackMap(eventToTrackMap);
- });
- },
-
willAppendTracks_: function() {
},
@@ -256,14 +251,41 @@ tr.exportTo('tr.ui.tracks', function() {
threads.sort(tr.model.Thread.compare);
// Create the threads.
+ var schedThreads = [];
+ var hasVisibleThreads = false;
threads.forEach(function(thread) {
var track = new tr.ui.tracks.ThreadTrack(this.viewport);
track.thread = thread;
if (!track.hasVisibleContent)
return;
- Polymer.dom(this).appendChild(track);
- Polymer.dom(this).appendChild(new SpacingTrack(this.viewport));
+ if (track.hasSlices) {
+ hasVisibleThreads = true;
+ Polymer.dom(this).appendChild(track);
+ Polymer.dom(this).appendChild(new SpacingTrack(this.viewport));
+ } else if (track.hasTimeSlices) {
+ schedThreads.push(thread);
+ }
}.bind(this));
+
+ if (schedThreads.length > 0) {
+ // If there's only 1 thread with scheduling-only information don't
+ // bother making a group, just display it directly
+ // Similarly if we are a process with only scheduling-only threads
+ // don't bother making a group as the process itself serves
+ // as the collapsable group
+ if (schedThreads.length > 1 && hasVisibleThreads) {
charliea (OOO until 10-5) 2016/10/26 21:23:37 I think that we probably want to always add these
John Reck 2016/10/26 21:55:47 Done.
+ var track = new tr.ui.tracks.SchedGroupTrack(this.viewport);
+ track.threads = schedThreads;
+ Polymer.dom(this).appendChild(track);
+ } else {
+ schedThreads.forEach(function(thread) {
+ var track = new tr.ui.tracks.ThreadTrack(this.viewport);
+ track.thread = thread;
+ Polymer.dom(this).appendChild(track);
+ Polymer.dom(this).appendChild(new SpacingTrack(this.viewport));
+ }.bind(this));
+ }
+ }
}
};

Powered by Google App Engine
This is Rietveld 408576698