diff mbox series

[i-g-t,04/21] trace.pl: Virtual engine preemption support

Message ID 20190508121058.27038-5-tvrtko.ursulin@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series Media scalability tooling | expand

Commit Message

Tvrtko Ursulin May 8, 2019, 12:10 p.m. UTC
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Use the 'completed?' tracepoint field to detect more robustly when a
request has been preempted and remove it from the engine database if so.

Otherwise the script can hit a scenario where the same global seqno will
be mentioned multiple times (on an engine seqno) which aborts processing.

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

Comments

Chris Wilson May 10, 2019, 12:55 p.m. UTC | #1
Quoting Tvrtko Ursulin (2019-05-08 13:10:41)
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Use the 'completed?' tracepoint field to detect more robustly when a
> request has been preempted and remove it from the engine database if so.
> 
> Otherwise the script can hit a scenario where the same global seqno will
> be mentioned multiple times (on an engine seqno) which aborts processing.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>  scripts/trace.pl | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/scripts/trace.pl b/scripts/trace.pl
> index 6cc332bb6e2a..cb7cc46df22e 100755
> --- a/scripts/trace.pl
> +++ b/scripts/trace.pl
> @@ -483,17 +483,17 @@ while (<>) {
>                 $ringmap{$rings{$ring}} = $ring;
>                 $db{$key} = \%req;
>         } elsif ($tp_name eq 'i915:i915_request_out:') {
> -               my $gkey;
> -
>                 die unless exists $ctxengines{$ctx};
>  
> -               $gkey = db_key($ctxengines{$ctx}, $ctx, $seqno);
> -
>                 if ($tp{'completed?'}) {
> +                       my $gkey;
> +
>                         die unless exists $db{$key};
>                         die unless exists $db{$key}->{'start'};
>                         die if exists $db{$key}->{'end'};
>  
> +                       $gkey = db_key($ctxengines{$ctx}, $ctx, $seqno);

I'm lost, how does do the commit message? I thought db_key() just gave
the hash value and not alter the db?
-Chris
Tvrtko Ursulin May 13, 2019, 12:38 p.m. UTC | #2
On 10/05/2019 13:55, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2019-05-08 13:10:41)
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> Use the 'completed?' tracepoint field to detect more robustly when a
>> request has been preempted and remove it from the engine database if so.
>>
>> Otherwise the script can hit a scenario where the same global seqno will
>> be mentioned multiple times (on an engine seqno) which aborts processing.
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> ---
>>   scripts/trace.pl | 8 ++++----
>>   1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/scripts/trace.pl b/scripts/trace.pl
>> index 6cc332bb6e2a..cb7cc46df22e 100755
>> --- a/scripts/trace.pl
>> +++ b/scripts/trace.pl
>> @@ -483,17 +483,17 @@ while (<>) {
>>                  $ringmap{$rings{$ring}} = $ring;
>>                  $db{$key} = \%req;
>>          } elsif ($tp_name eq 'i915:i915_request_out:') {
>> -               my $gkey;
>> -
>>                  die unless exists $ctxengines{$ctx};
>>   
>> -               $gkey = db_key($ctxengines{$ctx}, $ctx, $seqno);
>> -
>>                  if ($tp{'completed?'}) {
>> +                       my $gkey;
>> +
>>                          die unless exists $db{$key};
>>                          die unless exists $db{$key}->{'start'};
>>                          die if exists $db{$key}->{'end'};
>>   
>> +                       $gkey = db_key($ctxengines{$ctx}, $ctx, $seqno);
> 
> I'm lost, how does do the commit message? I thought db_key() just gave
> the hash value and not alter the db?

This seems to be a rebasing fail. I need to squash this with 
"scripts/trace.pl: Fix after intel_engine_notify removal". Or maybe 
better move this hunk back from that patch to this one.

Regards,

Tvrtko
diff mbox series

Patch

diff --git a/scripts/trace.pl b/scripts/trace.pl
index 6cc332bb6e2a..cb7cc46df22e 100755
--- a/scripts/trace.pl
+++ b/scripts/trace.pl
@@ -483,17 +483,17 @@  while (<>) {
 		$ringmap{$rings{$ring}} = $ring;
 		$db{$key} = \%req;
 	} elsif ($tp_name eq 'i915:i915_request_out:') {
-		my $gkey;
-
 		die unless exists $ctxengines{$ctx};
 
-		$gkey = db_key($ctxengines{$ctx}, $ctx, $seqno);
-
 		if ($tp{'completed?'}) {
+			my $gkey;
+
 			die unless exists $db{$key};
 			die unless exists $db{$key}->{'start'};
 			die if exists $db{$key}->{'end'};
 
+			$gkey = db_key($ctxengines{$ctx}, $ctx, $seqno);
+
 			$db{$key}->{'end'} = $time;
 			$db{$key}->{'notify'} = $notify{$gkey}
 						if exists $notify{$gkey};