Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 73A636EC67 for ; Wed, 18 Jul 2018 20:11:11 +0000 (UTC) References: <20180718094514.5903-1-tvrtko.ursulin@linux.intel.com> <20180718094514.5903-6-tvrtko.ursulin@linux.intel.com> From: John Harrison Message-ID: Date: Wed, 18 Jul 2018 13:11:10 -0700 MIME-Version: 1.0 In-Reply-To: <20180718094514.5903-6-tvrtko.ursulin@linux.intel.com> Content-Language: en-US Subject: Re: [igt-dev] [PATCH i-g-t 5/8] trace.pl: Context save only applies to last request of a bunch List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============1657546574==" Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: igt-dev@lists.freedesktop.org List-ID: This is a multi-part message in MIME format. --===============1657546574== Content-Type: multipart/alternative; boundary="------------C25D29AEC868A292216ECB4D" Content-Language: en-US This is a multi-part message in MIME format. --------------C25D29AEC868A292216ECB4D Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 7/18/2018 2:45 AM, Tvrtko Ursulin wrote: > From: Tvrtko Ursulin > > 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 > --- > scripts/trace.pl | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/scripts/trace.pl b/scripts/trace.pl > index 575fe83d8550..deb17e4a1816 100755 > --- a/scripts/trace.pl > +++ b/scripts/trace.pl > @@ -577,7 +577,11 @@ foreach my $key (@sorted_keys) { > $min_ctx = $db{$key}->{'ctx'} if not defined $min_ctx or > $db{$key}->{'ctx'} < $min_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; > @@ -594,7 +598,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) { > @@ -1045,7 +1049,7 @@ foreach my $key (sort sortQueue keys %db) { > } > > # user interrupt to context complete > - unless (exists $skip_box{'ctxsave'}) { > + unless (exists $skip_box{'ctxsave'} or exists $db{$key}->{'no-end'}) { > $skey = -2 * $max_seqno * $ctx - 2 * $seqno; > $style = box_style($ctx, 'ctxsave'); > my $ctxsave = $db{$key}->{'end'} - $db{$key}->{'notify'}; Dunno if you missed it but I definitely sent an r-b to this patch in the last series. And I can't see any changes since, so... Reviewed-by: John Harrison --------------C25D29AEC868A292216ECB4D Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit On 7/18/2018 2:45 AM, Tvrtko Ursulin wrote:
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 | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/scripts/trace.pl b/scripts/trace.pl
index 575fe83d8550..deb17e4a1816 100755
--- a/scripts/trace.pl
+++ b/scripts/trace.pl
@@ -577,7 +577,11 @@ foreach my $key (@sorted_keys) {
 	$min_ctx = $db{$key}->{'ctx'} if not defined $min_ctx or
 					 $db{$key}->{'ctx'} < $min_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;
@@ -594,7 +598,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) {
@@ -1045,7 +1049,7 @@ foreach my $key (sort sortQueue keys %db) {
 	}
 
 	# user interrupt to context complete
-	unless (exists $skip_box{'ctxsave'}) {
+	unless (exists $skip_box{'ctxsave'} or exists $db{$key}->{'no-end'}) {
 		$skey = -2 * $max_seqno * $ctx - 2 * $seqno;
 		$style = box_style($ctx, 'ctxsave');
 		my $ctxsave = $db{$key}->{'end'} - $db{$key}->{'notify'};

Dunno if you missed it but I definitely sent an r-b to this patch in the last series. And I can't see any changes since, so...

Reviewed-by: John Harrison <John.C.Harrison@Intel.com>

--------------C25D29AEC868A292216ECB4D-- --===============1657546574== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KaWd0LWRldiBt YWlsaW5nIGxpc3QKaWd0LWRldkBsaXN0cy5mcmVlZGVza3RvcC5vcmcKaHR0cHM6Ly9saXN0cy5m cmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9pZ3QtZGV2Cg== --===============1657546574==--