diff mbox

[i-g-t,5/8] trace.pl: Context save only applies to last request of a bunch

Message ID 20180605175050.29850-5-tvrtko.ursulin@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tvrtko Ursulin June 5, 2018, 5:50 p.m. UTC
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Skip accounting the context save time for anything but the last request of
the coalesced bunch, and also skip drawing those boxes on the timeline.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 scripts/trace.pl | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/scripts/trace.pl b/scripts/trace.pl
index 96ff80ab46a9..c2f1df5afa9e 100755
--- a/scripts/trace.pl
+++ b/scripts/trace.pl
@@ -599,7 +599,11 @@  foreach my $key (@sorted_keys) {
 	$max_ctx = $db{$key}->{'ctx'} if not defined $max_ctx or
 					 $db{$key}->{'ctx'} > $max_ctx;
 
-	$db{$key}->{'context-complete-delay'} = $end - $notify;
+	unless (exists $db{$key}->{'no-end'}) {
+		$db{$key}->{'context-complete-delay'} = $end - $notify;
+	} else {
+		$db{$key}->{'context-complete-delay'} = 0;
+	}
 	$db{$key}->{'execute-delay'} = $start - $db{$key}->{'submit'};
 	$db{$key}->{'submit-delay'} = $db{$key}->{'submit'} - $db{$key}->{'queue'};
 	$db{$key}->{'duration'} = $notify - $start;
@@ -616,7 +620,7 @@  foreach my $key (@sorted_keys) {
 
 	$submit_avg{$ring} += $db{$key}->{'submit-delay'};
 	$execute_avg{$ring} += $db{$key}->{'execute-delay'};
-	$ctxsave_avg{$ring} += $end - $notify;
+	$ctxsave_avg{$ring} += $db{$key}->{'context-complete-delay'};
 }
 
 foreach my $ring (sort keys %batch_avg) {
@@ -988,7 +992,8 @@  foreach my $key (sort sortQueue keys %db) {
 
 	# user interrupt to context complete
 	$duration = $end - $notify;
-	unless (exists $skip_box{'ctxsave'} or $duration < $min_duration) {
+	unless (exists $skip_box{'ctxsave'} or $duration < $min_duration or
+		exists $db{$key}->{'no-end'}) {
 		$skey = -2 * $max_seqno * $ctx - 2 * $seqno;
 		$style = 'color: black; background-color: orange;';
 		my $ctxsave = $db{$key}->{'end'} - $db{$key}->{'notify'};