Chromium Code Reviews| 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)); |
| + } |
| + } |
| } |
| }; |