diff mbox

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

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

Commit Message

Tvrtko Ursulin July 19, 2018, 9:35 a.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 | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Comments

John Harrison July 27, 2018, 9:37 p.m. UTC | #1
On 7/19/2018 2:35 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(-)
>
>
Not sure if you are not getting some of my replies? I have definitely 
sent an R-B to this patch at least twice already. Maybe they are getting 
caught by some kind of mailing list filter? I know your patches appear 
randomly in one of three mailboxes for me - inbox, IGT or IntelGFX 
according to which rule happens to take precedence on any given second 
:(. Anyway...

Reviewed-by: John Harrison <John.C.Harrison@Intel.com>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    On 7/19/2018 2:35 AM, Tvrtko Ursulin wrote:<br>
    <blockquote type="cite"
      cite="mid:20180719093601.11788-2-tvrtko.ursulin@linux.intel.com">
      <pre wrap="">From: Tvrtko Ursulin <a class="moz-txt-link-rfc2396E" href="mailto:tvrtko.ursulin@intel.com">&lt;tvrtko.ursulin@intel.com&gt;</a>

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 <a class="moz-txt-link-rfc2396E" href="mailto:tvrtko.ursulin@intel.com">&lt;tvrtko.ursulin@intel.com&gt;</a>
---
 scripts/trace.pl | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)


</pre>
    </blockquote>
    Not sure if you are not getting some of my replies? I have
    definitely sent an R-B to this patch at least twice already. Maybe
    they are getting caught by some kind of mailing list filter? I know
    your patches appear randomly in one of three mailboxes for me -
    inbox, IGT or IntelGFX according to which rule happens to take
    precedence on any given second :(. Anyway...<br>
    <br>
    Reviewed-by: John Harrison <a class="moz-txt-link-rfc2396E"
      href="mailto:John.C.Harrison@Intel.com">&lt;John.C.Harrison@Intel.com&gt;</a><br>
    <br>
  </body>
</html>
Tvrtko Ursulin Aug. 2, 2018, 10:29 a.m. UTC | #2
On 27/07/2018 22:37, John Harrison wrote:
> On 7/19/2018 2:35 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(-)
>>
>>
> Not sure if you are not getting some of my replies? I have definitely 
> sent an R-B to this patch at least twice already. Maybe they are getting 
> caught by some kind of mailing list filter? I know your patches appear 
> randomly in one of three mailboxes for me - inbox, IGT or IntelGFX 
> according to which rule happens to take precedence on any given second 
> :(. Anyway...
> 
> Reviewed-by: John Harrison <John.C.Harrison@Intel.com>

Thanks!

I looked backwards a bit and it seems (from my end at least!) that on 
previous two occasions you did a reply instead of reply to all so I 
missed it.

Regards,

Tvrtko
diff mbox

Patch

diff --git a/scripts/trace.pl b/scripts/trace.pl
index 5ae53fc0b68b..41bedeefb776 100755
--- a/scripts/trace.pl
+++ b/scripts/trace.pl
@@ -628,7 +628,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'};
 	unless (exists $db{$key}->{'no-notify'}) {
@@ -649,7 +653,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) {
@@ -1100,7 +1104,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'};