Skip to contentSkip to conversation

scripts/trace.pl: Rudimentary preemption support

PATCH New Tvrtko Ursulin 2 participants 2 messages Dec 20, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts/trace.pl: Rudimentary preemption support

From: Tvrtko Ursulin <[email protected]>

Make the script survive preemption by simply forgetting the previous request_in event happened.

Downside of the trivial approach is that the timeline will not show the preemption event, but it will be as if the request only got submitted to the hardware for the first time when it was submitted the final time, the time it actually ran to completion.

Runnable time accounting will also be over-accounted.

To solve this properly heavier refactoring is needed, and some design thought, but for the moment this at least makes the script not die.

---
 scripts/trace.pl | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
scripts/trace.pl +5 -2
index 2628a41abfc4..879e02365f34 100755
@@ -423,7 +423,9 @@ while (<>) {
 	} elsif ($tp_name eq 'i915:i915_gem_request_in:') {
 		my %req;
 
-		die if exists $db{$key};
+		# Duplicated req in is a sign of preemption - just forget it
+		# happened before.
+		delete $db{$key} if exists $db{$key};
 		die unless exists $queue{$key};
 		die unless exists $submit{$key};
 
@@ -443,7 +445,8 @@ while (<>) {
 	} elsif ($tp_name eq 'i915:i915_gem_request_out:') {
 		my $gkey = global_key($ring, $tp{'global'});
 
-		die unless exists $db{$key};
+# 		# Probable incomplete trace, not gathered with trace.pl --trace.
+		next unless exists $db{$key};
 		die unless exists $db{$key}->{'start'};
 		die if exists $db{$key}->{'end'};
 
Signature · 6 lines
2.14.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

✗ Fi.CI.BAT: failure for scripts/trace.pl: Rudimentary preemption support

== Series Details ==

== Series Details ==

Series: scripts/trace.pl: Rudimentary preemption support
URL : https://patchwork.freedesktop.org/series/35618/
State : failure

== Summary ==

Applying: scripts/trace.pl: Rudimentary preemption support Using index info to reconstruct a base tree...
M scripts/trace.pl
Falling back to patching base and 3-way merge... Auto-merging scripts/trace.pl
CONFLICT (content): Merge conflict in scripts/trace.pl
Patch failed at 0001 scripts/trace.pl: Rudimentary preemption support The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx