All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v2 0/4] scripts/trace.pl: Re-order calculations and fixups
@ 2018-01-23  6:32 John.C.Harrison
  2018-01-23  6:32 ` [igt-dev] [PATCH i-g-t v2 1/4] scripts/trace.pl: More hash key optimisations John.C.Harrison
                   ` (9 more replies)
  0 siblings, 10 replies; 19+ messages in thread
From: John.C.Harrison @ 2018-01-23  6:32 UTC (permalink / raw)
  To: IGT-Dev

From: John Harrison <John.C.Harrison@Intel.com>

The trace.pl script calculates a bunch of statistics. It also
re-generates some timestamp values to correct issues with the log
being processed. These operations were all mixed up together thus some
were done multiple times (with different results each time). Whereas
some stats were not being re-calculated after the underlying data had
changed and thus were not actually correct at the end. Also, the
ordering of some operations was non-deterministic due to being based
on internal Perl hash ordering.

These patches rationalise all of this processing to ensure that it all
happens in the correct order and in a consistent manner.

v2: Review feedback from Tvrtko Ursulin.

John Harrison (4):
  scripts/trace.pl: More hash key optimisations
  scripts/trace.pl: Sort order
  scripts/trace.pl: Calculate stats only after all munging
  scripts/trace.pl: Simplify 'end' & 'notify' generation

 scripts/trace.pl | 121 ++++++++++++++++++++++++++++++++++---------------------
 1 file changed, 76 insertions(+), 45 deletions(-)

-- 
2.15.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [igt-dev] [PATCH i-g-t v2 1/4] scripts/trace.pl: More hash key optimisations
  2018-01-23  6:32 [igt-dev] [PATCH i-g-t v2 0/4] scripts/trace.pl: Re-order calculations and fixups John.C.Harrison
@ 2018-01-23  6:32 ` John.C.Harrison
  2018-01-24 10:07   ` Tvrtko Ursulin
  2018-01-23  6:32 ` [igt-dev] [PATCH i-g-t v2 2/4] scripts/trace.pl: Sort order John.C.Harrison
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 19+ messages in thread
From: John.C.Harrison @ 2018-01-23  6:32 UTC (permalink / raw)
  To: IGT-Dev; +Cc: Tvrtko Ursulin

From: John Harrison <John.C.Harrison@Intel.com>

Cache the key count value rather than querying the hash every time.
Also assert that the database does not magically change size after the
fixups.

v2: Rename variable according to style guide [Tvrtko]

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

diff --git a/scripts/trace.pl b/scripts/trace.pl
index cb93900d..a73fcf38 100755
--- a/scripts/trace.pl
+++ b/scripts/trace.pl
@@ -508,7 +508,8 @@ foreach my $key (keys %db) {
 }
 
 # Fix up incompletes
-foreach my $key (keys %db) {
+my $key_count = scalar(keys(%db));
+foreach my $key (keys(%db)) {
 	next unless exists $db{$key}->{'incomplete'};
 
 	# End the incomplete batch at the time next one starts
@@ -522,7 +523,7 @@ foreach my $key (keys %db) {
 		$next_key = db_key($ring, $ctx, $seqno + $i);
 		$i++;
 	} until ((exists $db{$next_key} and not exists $db{$next_key}->{'incomplete'})
-		 or $i > scalar(keys(%db)));  # ugly stop hack
+		 or $i > $key_count);  # ugly stop hack
 
 	if (exists $db{$next_key}) {
 		$db{$key}->{'notify'} = $db{$next_key}->{'end'};
@@ -540,6 +541,7 @@ my $first_ts;
 
 my @sorted_keys = sort {$db{$a}->{'start'} <=> $db{$b}->{'start'}} keys %db;
 my $re_sort = 0;
+die "Database changed size?!" unless scalar(@sorted_keys) == $key_count;
 
 foreach my $key (@sorted_keys) {
 	my $ring = $db{$key}->{'ring'};
@@ -565,7 +567,7 @@ foreach my $key (@sorted_keys) {
 		do {
 			$next_key = db_key($ring, $ctx, $seqno + $i);
 			$i++;
-		} until (exists $db{$next_key} or $i > scalar(keys(%db)));  # ugly stop hack
+		} until (exists $db{$next_key} or $i > $key_count);  # ugly stop hack
 
 		# 20us tolerance
 		if (exists $db{$next_key} and $db{$next_key}->{'start'} < $start + 20) {
-- 
2.15.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [igt-dev] [PATCH i-g-t v2 2/4] scripts/trace.pl: Sort order
  2018-01-23  6:32 [igt-dev] [PATCH i-g-t v2 0/4] scripts/trace.pl: Re-order calculations and fixups John.C.Harrison
  2018-01-23  6:32 ` [igt-dev] [PATCH i-g-t v2 1/4] scripts/trace.pl: More hash key optimisations John.C.Harrison
@ 2018-01-23  6:32 ` John.C.Harrison
  2018-01-24 10:10   ` Tvrtko Ursulin
  2018-01-23  6:32 ` [igt-dev] [PATCH i-g-t v2 3/4] scripts/trace.pl: Calculate stats only after all munging John.C.Harrison
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 19+ messages in thread
From: John.C.Harrison @ 2018-01-23  6:32 UTC (permalink / raw)
  To: IGT-Dev; +Cc: Tvrtko Ursulin

From: John Harrison <John.C.Harrison@Intel.com>

Add an extra level to the databse key sort so that the ordering is
deterministic. If the time stamp matches, it now compares the key
itself as well (context/seqno). This makes it much easier to determine
if a change has actually broken anything. Previously back to back runs
with no changes could still produce different output, especially when
adding extra debug output during the calculations.

As the comparison test is now more than a single equation, moved it
out into a separate sort function.

v2: Re-work sort func for readability/performance [Tvrtko]

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

diff --git a/scripts/trace.pl b/scripts/trace.pl
index a73fcf38..b528d482 100755
--- a/scripts/trace.pl
+++ b/scripts/trace.pl
@@ -539,7 +539,29 @@ my (%submit_avg, %execute_avg, %ctxsave_avg);
 my $last_ts = 0;
 my $first_ts;
 
-my @sorted_keys = sort {$db{$a}->{'start'} <=> $db{$b}->{'start'}} keys %db;
+sub sortStart {
+	my $as = $db{$a}->{'start'};
+	my $bs = $db{$b}->{'start'};
+	my $val;
+
+	$val = $as <=> $bs;
+	$val = $a cmp $b if $val == 0;
+
+	return $val;
+}
+
+sub sortQueue {
+	my $as = $db{$a}->{'queue'};
+	my $bs = $db{$b}->{'queue'};
+	my $val;
+
+	$val = $as <=> $bs;
+	$val = $a cmp $b if $val == 0;
+
+	return $val;
+}
+
+my @sorted_keys = sort sortStart keys %db;
 my $re_sort = 0;
 die "Database changed size?!" unless scalar(@sorted_keys) == $key_count;
 
@@ -588,9 +610,9 @@ foreach my $key (@sorted_keys) {
 	$ctxsave_avg{$ring} += $db{$key}->{'end'} - $db{$key}->{'notify'};
 }
 
-@sorted_keys = sort {$db{$a}->{'start'} <=> $db{$b}->{'start'}} keys %db if $re_sort;
+@sorted_keys = sort sortStart keys %db if $re_sort;
 
-foreach my $ring (keys %batch_avg) {
+foreach my $ring (sort keys %batch_avg) {
 	$batch_avg{$ring} /= $batch_count{$ring};
 	$batch_total_avg{$ring} /= $batch_count{$ring};
 	$submit_avg{$ring} /= $batch_count{$ring};
@@ -830,7 +852,7 @@ print <<ENDHTML;
 ENDHTML
 
 my $i = 0;
-foreach my $key (sort {$db{$a}->{'queue'} <=> $db{$b}->{'queue'}} keys %db) {
+foreach my $key (sort sortQueue keys %db) {
 	my ($name, $ctx, $seqno) = ($db{$key}->{'name'}, $db{$key}->{'ctx'}, $db{$key}->{'seqno'});
 	my ($queue, $start, $notify, $end) = ($db{$key}->{'queue'}, $db{$key}->{'start'}, $db{$key}->{'notify'}, $db{$key}->{'end'});
 	my $submit = $queue + $db{$key}->{'submit-delay'};
-- 
2.15.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [igt-dev] [PATCH i-g-t v2 3/4] scripts/trace.pl: Calculate stats only after all munging
  2018-01-23  6:32 [igt-dev] [PATCH i-g-t v2 0/4] scripts/trace.pl: Re-order calculations and fixups John.C.Harrison
  2018-01-23  6:32 ` [igt-dev] [PATCH i-g-t v2 1/4] scripts/trace.pl: More hash key optimisations John.C.Harrison
  2018-01-23  6:32 ` [igt-dev] [PATCH i-g-t v2 2/4] scripts/trace.pl: Sort order John.C.Harrison
@ 2018-01-23  6:32 ` John.C.Harrison
  2018-01-24 10:11   ` Tvrtko Ursulin
  2018-01-25 18:11   ` Tvrtko Ursulin
  2018-01-23  6:32 ` [igt-dev] [PATCH i-g-t v2 4/4] scripts/trace.pl: Simplify 'end' & 'notify' generation John.C.Harrison
                   ` (6 subsequent siblings)
  9 siblings, 2 replies; 19+ messages in thread
From: John.C.Harrison @ 2018-01-23  6:32 UTC (permalink / raw)
  To: IGT-Dev; +Cc: Tvrtko Ursulin

From: John Harrison <John.C.Harrison@Intel.com>

There are various statistics being calculated multiple times in
multiple places while the log file is being read in. Some of these are
then re-calculated when the database is munged to correct various
issues with the logs. This patch consolidates the calculations into a
separate pass after all the reading and munging has been done.

Note that this actually produces a different final output as the
'execute-delay' values were not previously being re-calculated after
all the fixups. Thus were based on an incorrect calculation.

v2: Reduce scope of some local variables [Tvrtko]

Signed-off-by: John Harrison <John.C.Harrison@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 scripts/trace.pl | 54 ++++++++++++++++++++++++++++--------------------------
 1 file changed, 28 insertions(+), 26 deletions(-)

diff --git a/scripts/trace.pl b/scripts/trace.pl
index b528d482..c984cef6 100755
--- a/scripts/trace.pl
+++ b/scripts/trace.pl
@@ -437,8 +437,7 @@ while (<>) {
 		$req{'global'} = $tp{'global'};
 		$req{'port'} = $tp{'port'};
 		$req{'queue'} = $queue{$key};
-		$req{'submit-delay'} = $submit{$key} - $queue{$key};
-		$req{'execute-delay'} = $req{'start'} - $submit{$key};
+		$req{'submit'} = $submit{$key};
 		$rings{$ring} = $gid++ unless exists $rings{$ring};
 		$ringmap{$rings{$ring}} = $ring;
 		$db{$key} = \%req;
@@ -458,8 +457,6 @@ while (<>) {
 			$db{$key}->{'notify'} = $db{$key}->{'end'};
 			$db{$key}->{'no-notify'} = 1;
 		}
-		$db{$key}->{'duration'} = $db{$key}->{'notify'} - $db{$key}->{'start'};
-		$db{$key}->{'context-complete-delay'} = $db{$key}->{'end'} - $db{$key}->{'notify'};
 	} elsif ($tp_name eq 'i915:intel_engine_notify:') {
 		$notify{global_key($ring, $seqno)} = $time;
 	} elsif ($tp_name eq 'i915:intel_gpu_freq_change:') {
@@ -493,16 +490,11 @@ foreach my $key (keys %db) {
 			$db{$key}->{'notify'} = $db{$key}->{'end'};
 			$db{$key}->{'incomplete'} = 1;
 		}
-
-		$db{$key}->{'duration'} = $db{$key}->{'notify'} - $db{$key}->{'start'};
-		$db{$key}->{'context-complete-delay'} = $db{$key}->{'end'} - $db{$key}->{'notify'};
 	} else {
 		# Notify arrived after context complete.
 		if (exists $db{$key}->{'no-notify'} and exists $notify{$gkey}) {
 			delete $db{$key}->{'no-notify'};
 			$db{$key}->{'notify'} = $notify{$gkey};
-			$db{$key}->{'duration'} = $db{$key}->{'notify'} - $db{$key}->{'start'};
-			$db{$key}->{'context-complete-delay'} = $db{$key}->{'end'} - $db{$key}->{'notify'};
 		}
 	}
 }
@@ -528,8 +520,6 @@ foreach my $key (keys(%db)) {
 	if (exists $db{$next_key}) {
 		$db{$key}->{'notify'} = $db{$next_key}->{'end'};
 		$db{$key}->{'end'} = $db{$key}->{'notify'};
-		$db{$key}->{'duration'} = $db{$key}->{'notify'} - $db{$key}->{'start'};
-		$db{$key}->{'context-complete-delay'} = $db{$key}->{'end'} - $db{$key}->{'notify'};
 	}
 }
 
@@ -572,17 +562,11 @@ foreach my $key (@sorted_keys) {
 	$first_ts = $db{$key}->{'queue'} if not defined $first_ts or $db{$key}->{'queue'} < $first_ts;
 	$last_ts = $end if $end > $last_ts;
 
-	$running{$ring} += $end - $db{$key}->{'start'} unless exists $db{$key}->{'no-end'};
-	$runnable{$ring} += $db{$key}->{'execute-delay'};
-	$queued{$ring} += $db{$key}->{'start'} - $db{$key}->{'execute-delay'} - $db{$key}->{'queue'};
-
-	$batch_count{$ring}++;
-
 	# correct duration of merged batches
 	if ($correct_durations and exists $db{$key}->{'no-end'}) {
-		my $start = $db{$key}->{'start'};
 		my $ctx = $db{$key}->{'ctx'};
 		my $seqno = $db{$key}->{'seqno'};
+		my $start = $db{$key}->{'start'};
 		my $next_key;
 		my $i = 1;
 
@@ -593,25 +577,43 @@ foreach my $key (@sorted_keys) {
 
 		# 20us tolerance
 		if (exists $db{$next_key} and $db{$next_key}->{'start'} < $start + 20) {
+			my $notify = $db{$key}->{'notify'};
 			$re_sort = 1;
-			$db{$next_key}->{'start'} = $start + $db{$key}->{'duration'};
+			$db{$next_key}->{'start'} = $notify;
 			$db{$next_key}->{'start'} = $db{$next_key}->{'end'} if $db{$next_key}->{'start'} > $db{$next_key}->{'end'};
-			$db{$next_key}->{'duration'} = $db{$next_key}->{'notify'} - $db{$next_key}->{'start'};
-			$end = $db{$key}->{'notify'};
 			die if $db{$next_key}->{'start'} > $db{$next_key}->{'end'};
 		}
-		die if $db{$key}->{'start'} > $db{$key}->{'end'};
+		die if $start > $end;
 	}
+}
+
+@sorted_keys = sort sortStart keys %db if $re_sort;
+
+foreach my $key (@sorted_keys) {
+	my $ring = $db{$key}->{'ring'};
+	my $end = $db{$key}->{'end'};
+	my $start = $db{$key}->{'start'};
+	my $notify = $db{$key}->{'notify'};
+
+	$db{$key}->{'context-complete-delay'} = $end - $notify;
+	$db{$key}->{'execute-delay'} = $start - $db{$key}->{'submit'};
+	$db{$key}->{'submit-delay'} = $db{$key}->{'submit'} - $db{$key}->{'queue'};
+	$db{$key}->{'duration'} = $notify - $start;
+
+	$running{$ring} += $end - $start unless exists $db{$key}->{'no-end'};
+	$runnable{$ring} += $db{$key}->{'execute-delay'};
+	$queued{$ring} += $start - $db{$key}->{'execute-delay'} - $db{$key}->{'queue'};
+
+	$batch_count{$ring}++;
+
 	$batch_avg{$ring} += $db{$key}->{'duration'};
-	$batch_total_avg{$ring} += $end - $db{$key}->{'start'};
+	$batch_total_avg{$ring} += $end - $start;
 
 	$submit_avg{$ring} += $db{$key}->{'submit-delay'};
 	$execute_avg{$ring} += $db{$key}->{'execute-delay'};
-	$ctxsave_avg{$ring} += $db{$key}->{'end'} - $db{$key}->{'notify'};
+	$ctxsave_avg{$ring} += $end - $notify;
 }
 
-@sorted_keys = sort sortStart keys %db if $re_sort;
-
 foreach my $ring (sort keys %batch_avg) {
 	$batch_avg{$ring} /= $batch_count{$ring};
 	$batch_total_avg{$ring} /= $batch_count{$ring};
-- 
2.15.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [igt-dev] [PATCH i-g-t v2 4/4] scripts/trace.pl: Simplify 'end' & 'notify' generation
  2018-01-23  6:32 [igt-dev] [PATCH i-g-t v2 0/4] scripts/trace.pl: Re-order calculations and fixups John.C.Harrison
                   ` (2 preceding siblings ...)
  2018-01-23  6:32 ` [igt-dev] [PATCH i-g-t v2 3/4] scripts/trace.pl: Calculate stats only after all munging John.C.Harrison
@ 2018-01-23  6:32 ` John.C.Harrison
  2018-01-24 10:12   ` Tvrtko Ursulin
  2018-01-23  6:53 ` [igt-dev] ✓ Fi.CI.BAT: success for scripts/trace.pl: Re-order calculations and fixups Patchwork
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 19+ messages in thread
From: John.C.Harrison @ 2018-01-23  6:32 UTC (permalink / raw)
  To: IGT-Dev; +Cc: Tvrtko Ursulin

From: John Harrison <John.C.Harrison@Intel.com>

Delay the auto-generation of end/notify values until the point where
everything is known. As opposed to potentially generating them
multiple times with differing values (in the case of 'incomplete'
entries).

v2: More complete description. [Tvrtko]

Signed-off-by: John Harrison <John.C.Harrison@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 scripts/trace.pl | 31 ++++++++++++++++++-------------
 1 file changed, 18 insertions(+), 13 deletions(-)

diff --git a/scripts/trace.pl b/scripts/trace.pl
index c984cef6..ba969d2c 100755
--- a/scripts/trace.pl
+++ b/scripts/trace.pl
@@ -467,10 +467,11 @@ while (<>) {
 }
 
 # Sanitation pass to fixup up out of order notify and context complete, and to
-# fine the largest seqno to be used for timeline sorting purposes.
+# find the largest seqno to be used for timeline sorting purposes.
 my $max_seqno = 0;
 foreach my $key (keys %db) {
 	my $gkey = global_key($db{$key}->{'ring'}, $db{$key}->{'global'});
+	my $notify = $notify{$gkey};
 
 	die unless exists $db{$key}->{'start'};
 
@@ -478,23 +479,21 @@ foreach my $key (keys %db) {
 
 	unless (exists $db{$key}->{'end'}) {
 		# Context complete not received.
-		if (exists $notify{$gkey}) {
+		$db{$key}->{'no-end'} = 1;
+
+		if (defined($notify)) {
 			# No context complete due req merging - use notify.
-			$db{$key}->{'notify'} = $notify{$gkey};
-			$db{$key}->{'end'} = $db{$key}->{'notify'};
-			$db{$key}->{'no-end'} = 1;
+			$db{$key}->{'notify'} = $notify;
+			$db{$key}->{'end'} = $notify;
 		} else {
-			# No notify and no context complete - mark it.
-			$db{$key}->{'no-end'} = 1;
-			$db{$key}->{'end'} = $db{$key}->{'start'} + 999;
-			$db{$key}->{'notify'} = $db{$key}->{'end'};
+			# No notify and no context complete - give up for now.
 			$db{$key}->{'incomplete'} = 1;
 		}
 	} else {
 		# Notify arrived after context complete.
-		if (exists $db{$key}->{'no-notify'} and exists $notify{$gkey}) {
+		if (exists $db{$key}->{'no-notify'} and defined($notify)) {
 			delete $db{$key}->{'no-notify'};
-			$db{$key}->{'notify'} = $notify{$gkey};
+			$db{$key}->{'notify'} = $notify;
 		}
 	}
 }
@@ -510,6 +509,7 @@ foreach my $key (keys(%db)) {
 	my $seqno = $db{$key}->{'seqno'};
 	my $next_key;
 	my $i = 1;
+	my $end;
 
 	do {
 		$next_key = db_key($ring, $ctx, $seqno + $i);
@@ -518,9 +518,14 @@ foreach my $key (keys(%db)) {
 		 or $i > $key_count);  # ugly stop hack
 
 	if (exists $db{$next_key}) {
-		$db{$key}->{'notify'} = $db{$next_key}->{'end'};
-		$db{$key}->{'end'} = $db{$key}->{'notify'};
+		$end = $db{$next_key}->{'end'};
+	} else {
+		# No info at all, fake it:
+		$end = $db{$key}->{'start'} + 999;
 	}
+
+	$db{$key}->{'notify'} = $end;
+	$db{$key}->{'end'} = $end;
 }
 
 # GPU time accounting
-- 
2.15.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for scripts/trace.pl: Re-order calculations and fixups
  2018-01-23  6:32 [igt-dev] [PATCH i-g-t v2 0/4] scripts/trace.pl: Re-order calculations and fixups John.C.Harrison
                   ` (3 preceding siblings ...)
  2018-01-23  6:32 ` [igt-dev] [PATCH i-g-t v2 4/4] scripts/trace.pl: Simplify 'end' & 'notify' generation John.C.Harrison
@ 2018-01-23  6:53 ` Patchwork
  2018-01-23 10:20 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 19+ messages in thread
From: Patchwork @ 2018-01-23  6:53 UTC (permalink / raw)
  To: John.C.Harrison; +Cc: igt-dev

== Series Details ==

Series: scripts/trace.pl: Re-order calculations and fixups
URL   : https://patchwork.freedesktop.org/series/36947/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
f1290e3c55ecd3665a5d77cffeaf3562f3b6b700 igt/pm_rps: Include related kernel RPS info

with latest DRM-Tip kernel build CI_DRM_3671
06c8efda323a drm-tip: 2018y-01m-22d-17h-43m-26s UTC integration manifest

No testlist changes.

Test debugfs_test:
        Subgroup read_all_entries:
                dmesg-fail -> DMESG-WARN (fi-elk-e7500) fdo#103989
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                incomplete -> PASS       (fi-snb-2520m) fdo#103713

fdo#103989 https://bugs.freedesktop.org/show_bug.cgi?id=103989
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:423s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:426s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:373s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:497s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:282s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:487s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:488s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:474s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:459s
fi-elk-e7500     total:224  pass:168  dwarn:10  dfail:0   fail:0   skip:45 
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:279s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:515s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:400s
fi-hsw-4770r     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:401s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:415s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:453s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:411s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:462s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:497s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:452s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:501s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:591s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:433s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:510s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:526s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:494s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:482s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:423s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:434s
fi-snb-2520m     total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:526s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:398s
Blacklisted hosts:
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:569s
fi-glk-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:477s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_812/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [igt-dev] ✓ Fi.CI.IGT: success for scripts/trace.pl: Re-order calculations and fixups
  2018-01-23  6:32 [igt-dev] [PATCH i-g-t v2 0/4] scripts/trace.pl: Re-order calculations and fixups John.C.Harrison
                   ` (4 preceding siblings ...)
  2018-01-23  6:53 ` [igt-dev] ✓ Fi.CI.BAT: success for scripts/trace.pl: Re-order calculations and fixups Patchwork
@ 2018-01-23 10:20 ` Patchwork
  2018-01-25 16:40 ` [igt-dev] ✓ Fi.CI.BAT: success for scripts/trace.pl: Re-order calculations and fixups (rev2) Patchwork
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 19+ messages in thread
From: Patchwork @ 2018-01-23 10:20 UTC (permalink / raw)
  To: John.C.Harrison; +Cc: igt-dev

== Series Details ==

Series: scripts/trace.pl: Re-order calculations and fixups
URL   : https://patchwork.freedesktop.org/series/36947/
State : success

== Summary ==

Test kms_sysfs_edid_timing:
                pass       -> WARN       (shard-apl) fdo#100047
Test gem_eio:
        Subgroup in-flight-external:
                fail       -> PASS       (shard-hsw) fdo#104676 +2
Test kms_cursor_legacy:
        Subgroup cursor-vs-flip-legacy:
                fail       -> PASS       (shard-apl) fdo#103355
Test kms_frontbuffer_tracking:
        Subgroup fbc-tilingchange:
                fail       -> PASS       (shard-apl) fdo#103167
        Subgroup fbc-1p-offscren-pri-shrfb-draw-blt:
                pass       -> FAIL       (shard-snb) fdo#101623 +1
Test kms_flip:
        Subgroup flip-vs-panning-vs-hang-interruptible:
                dmesg-warn -> PASS       (shard-snb) fdo#103821
        Subgroup modeset-vs-vblank-race:
                fail       -> PASS       (shard-apl) fdo#103060
        Subgroup flip-vs-blocking-wf-vblank:
                pass       -> DMESG-FAIL (shard-hsw) fdo#100368
        Subgroup 2x-blt-wf_vblank-vs-dpms:
                pass       -> DMESG-WARN (shard-hsw) fdo#102614
Test perf:
        Subgroup enable-disable:
                pass       -> FAIL       (shard-apl) fdo#103715

fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
fdo#104676 https://bugs.freedesktop.org/show_bug.cgi?id=104676
fdo#103355 https://bugs.freedesktop.org/show_bug.cgi?id=103355
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#103821 https://bugs.freedesktop.org/show_bug.cgi?id=103821
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
fdo#103715 https://bugs.freedesktop.org/show_bug.cgi?id=103715

shard-apl        total:2753 pass:1714 dwarn:1   dfail:0   fail:24  skip:1013 time:14117s
shard-hsw        total:2753 pass:1722 dwarn:2   dfail:1   fail:12  skip:1015 time:15350s
shard-snb        total:2753 pass:1318 dwarn:1   dfail:0   fail:11  skip:1423 time:7896s
Blacklisted hosts:
shard-kbl        total:2735 pass:1818 dwarn:1   dfail:1   fail:25  skip:889 time:10541s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_812/shards.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v2 1/4] scripts/trace.pl: More hash key optimisations
  2018-01-23  6:32 ` [igt-dev] [PATCH i-g-t v2 1/4] scripts/trace.pl: More hash key optimisations John.C.Harrison
@ 2018-01-24 10:07   ` Tvrtko Ursulin
  2018-01-25 16:18     ` John.C.Harrison
  2018-01-25 16:24     ` John.C.Harrison
  0 siblings, 2 replies; 19+ messages in thread
From: Tvrtko Ursulin @ 2018-01-24 10:07 UTC (permalink / raw)
  To: John.C.Harrison, IGT-Dev; +Cc: Tvrtko Ursulin


On 23/01/2018 06:32, John.C.Harrison@Intel.com wrote:
> From: John Harrison <John.C.Harrison@Intel.com>
> 
> Cache the key count value rather than querying the hash every time.
> Also assert that the database does not magically change size after the
> fixups.
> 
> v2: Rename variable according to style guide [Tvrtko]
> 
> Signed-off-by: John Harrison <John.C.Harrison@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   scripts/trace.pl | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/scripts/trace.pl b/scripts/trace.pl
> index cb93900d..a73fcf38 100755
> --- a/scripts/trace.pl
> +++ b/scripts/trace.pl
> @@ -508,7 +508,8 @@ foreach my $key (keys %db) {
>   }
>   
>   # Fix up incompletes
> -foreach my $key (keys %db) {
> +my $key_count = scalar(keys(%db));
> +foreach my $key (keys(%db)) {

Could have not changed formatting on this line.

>   	next unless exists $db{$key}->{'incomplete'};
>   
>   	# End the incomplete batch at the time next one starts
> @@ -522,7 +523,7 @@ foreach my $key (keys %db) {
>   		$next_key = db_key($ring, $ctx, $seqno + $i);
>   		$i++;
>   	} until ((exists $db{$next_key} and not exists $db{$next_key}->{'incomplete'})
> -		 or $i > scalar(keys(%db)));  # ugly stop hack
> +		 or $i > $key_count);  # ugly stop hack
>   
>   	if (exists $db{$next_key}) {
>   		$db{$key}->{'notify'} = $db{$next_key}->{'end'};
> @@ -540,6 +541,7 @@ my $first_ts;
>   
>   my @sorted_keys = sort {$db{$a}->{'start'} <=> $db{$b}->{'start'}} keys %db;
>   my $re_sort = 0;

A blank line between declarations and code would be better.

> +die "Database changed size?!" unless scalar(@sorted_keys) == $key_count;
>   
>   foreach my $key (@sorted_keys) {
>   	my $ring = $db{$key}->{'ring'};
> @@ -565,7 +567,7 @@ foreach my $key (@sorted_keys) {
>   		do {
>   			$next_key = db_key($ring, $ctx, $seqno + $i);
>   			$i++;
> -		} until (exists $db{$next_key} or $i > scalar(keys(%db)));  # ugly stop hack
> +		} until (exists $db{$next_key} or $i > $key_count);  # ugly stop hack
>   
>   		# 20us tolerance
>   		if (exists $db{$next_key} and $db{$next_key}->{'start'} < $start + 20) {
> 

With the two tiny tweaks,

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v2 2/4] scripts/trace.pl: Sort order
  2018-01-23  6:32 ` [igt-dev] [PATCH i-g-t v2 2/4] scripts/trace.pl: Sort order John.C.Harrison
@ 2018-01-24 10:10   ` Tvrtko Ursulin
  0 siblings, 0 replies; 19+ messages in thread
From: Tvrtko Ursulin @ 2018-01-24 10:10 UTC (permalink / raw)
  To: John.C.Harrison, IGT-Dev; +Cc: Tvrtko Ursulin


On 23/01/2018 06:32, John.C.Harrison@Intel.com wrote:
> From: John Harrison <John.C.Harrison@Intel.com>
> 
> Add an extra level to the databse key sort so that the ordering is
> deterministic. If the time stamp matches, it now compares the key
> itself as well (context/seqno). This makes it much easier to determine
> if a change has actually broken anything. Previously back to back runs
> with no changes could still produce different output, especially when
> adding extra debug output during the calculations.
> 
> As the comparison test is now more than a single equation, moved it
> out into a separate sort function.
> 
> v2: Re-work sort func for readability/performance [Tvrtko]
> 
> Signed-off-by: John Harrison <John.C.Harrison@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   scripts/trace.pl | 30 ++++++++++++++++++++++++++----
>   1 file changed, 26 insertions(+), 4 deletions(-)
> 
> diff --git a/scripts/trace.pl b/scripts/trace.pl
> index a73fcf38..b528d482 100755
> --- a/scripts/trace.pl
> +++ b/scripts/trace.pl
> @@ -539,7 +539,29 @@ my (%submit_avg, %execute_avg, %ctxsave_avg);
>   my $last_ts = 0;
>   my $first_ts;
>   
> -my @sorted_keys = sort {$db{$a}->{'start'} <=> $db{$b}->{'start'}} keys %db;
> +sub sortStart {
> +	my $as = $db{$a}->{'start'};
> +	my $bs = $db{$b}->{'start'};
> +	my $val;
> +
> +	$val = $as <=> $bs;
> +	$val = $a cmp $b if $val == 0;
> +
> +	return $val;
> +}
> +
> +sub sortQueue {
> +	my $as = $db{$a}->{'queue'};
> +	my $bs = $db{$b}->{'queue'};
> +	my $val;
> +
> +	$val = $as <=> $bs;
> +	$val = $a cmp $b if $val == 0;
> +
> +	return $val;
> +}
> +
> +my @sorted_keys = sort sortStart keys %db;
>   my $re_sort = 0;
>   die "Database changed size?!" unless scalar(@sorted_keys) == $key_count;
>   
> @@ -588,9 +610,9 @@ foreach my $key (@sorted_keys) {
>   	$ctxsave_avg{$ring} += $db{$key}->{'end'} - $db{$key}->{'notify'};
>   }
>   
> -@sorted_keys = sort {$db{$a}->{'start'} <=> $db{$b}->{'start'}} keys %db if $re_sort;
> +@sorted_keys = sort sortStart keys %db if $re_sort;
>   
> -foreach my $ring (keys %batch_avg) {
> +foreach my $ring (sort keys %batch_avg) {
>   	$batch_avg{$ring} /= $batch_count{$ring};
>   	$batch_total_avg{$ring} /= $batch_count{$ring};
>   	$submit_avg{$ring} /= $batch_count{$ring};
> @@ -830,7 +852,7 @@ print <<ENDHTML;
>   ENDHTML
>   
>   my $i = 0;
> -foreach my $key (sort {$db{$a}->{'queue'} <=> $db{$b}->{'queue'}} keys %db) {
> +foreach my $key (sort sortQueue keys %db) {
>   	my ($name, $ctx, $seqno) = ($db{$key}->{'name'}, $db{$key}->{'ctx'}, $db{$key}->{'seqno'});
>   	my ($queue, $start, $notify, $end) = ($db{$key}->{'queue'}, $db{$key}->{'start'}, $db{$key}->{'notify'}, $db{$key}->{'end'});
>   	my $submit = $queue + $db{$key}->{'submit-delay'};
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v2 3/4] scripts/trace.pl: Calculate stats only after all munging
  2018-01-23  6:32 ` [igt-dev] [PATCH i-g-t v2 3/4] scripts/trace.pl: Calculate stats only after all munging John.C.Harrison
@ 2018-01-24 10:11   ` Tvrtko Ursulin
  2018-01-25 18:11   ` Tvrtko Ursulin
  1 sibling, 0 replies; 19+ messages in thread
From: Tvrtko Ursulin @ 2018-01-24 10:11 UTC (permalink / raw)
  To: John.C.Harrison, IGT-Dev; +Cc: Tvrtko Ursulin


On 23/01/2018 06:32, John.C.Harrison@Intel.com wrote:
> From: John Harrison <John.C.Harrison@Intel.com>
> 
> There are various statistics being calculated multiple times in
> multiple places while the log file is being read in. Some of these are
> then re-calculated when the database is munged to correct various
> issues with the logs. This patch consolidates the calculations into a
> separate pass after all the reading and munging has been done.
> 
> Note that this actually produces a different final output as the
> 'execute-delay' values were not previously being re-calculated after
> all the fixups. Thus were based on an incorrect calculation.
> 
> v2: Reduce scope of some local variables [Tvrtko]
> 
> Signed-off-by: John Harrison <John.C.Harrison@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   scripts/trace.pl | 54 ++++++++++++++++++++++++++++--------------------------
>   1 file changed, 28 insertions(+), 26 deletions(-)
> 
> diff --git a/scripts/trace.pl b/scripts/trace.pl
> index b528d482..c984cef6 100755
> --- a/scripts/trace.pl
> +++ b/scripts/trace.pl
> @@ -437,8 +437,7 @@ while (<>) {
>   		$req{'global'} = $tp{'global'};
>   		$req{'port'} = $tp{'port'};
>   		$req{'queue'} = $queue{$key};
> -		$req{'submit-delay'} = $submit{$key} - $queue{$key};
> -		$req{'execute-delay'} = $req{'start'} - $submit{$key};
> +		$req{'submit'} = $submit{$key};
>   		$rings{$ring} = $gid++ unless exists $rings{$ring};
>   		$ringmap{$rings{$ring}} = $ring;
>   		$db{$key} = \%req;
> @@ -458,8 +457,6 @@ while (<>) {
>   			$db{$key}->{'notify'} = $db{$key}->{'end'};
>   			$db{$key}->{'no-notify'} = 1;
>   		}
> -		$db{$key}->{'duration'} = $db{$key}->{'notify'} - $db{$key}->{'start'};
> -		$db{$key}->{'context-complete-delay'} = $db{$key}->{'end'} - $db{$key}->{'notify'};
>   	} elsif ($tp_name eq 'i915:intel_engine_notify:') {
>   		$notify{global_key($ring, $seqno)} = $time;
>   	} elsif ($tp_name eq 'i915:intel_gpu_freq_change:') {
> @@ -493,16 +490,11 @@ foreach my $key (keys %db) {
>   			$db{$key}->{'notify'} = $db{$key}->{'end'};
>   			$db{$key}->{'incomplete'} = 1;
>   		}
> -
> -		$db{$key}->{'duration'} = $db{$key}->{'notify'} - $db{$key}->{'start'};
> -		$db{$key}->{'context-complete-delay'} = $db{$key}->{'end'} - $db{$key}->{'notify'};
>   	} else {
>   		# Notify arrived after context complete.
>   		if (exists $db{$key}->{'no-notify'} and exists $notify{$gkey}) {
>   			delete $db{$key}->{'no-notify'};
>   			$db{$key}->{'notify'} = $notify{$gkey};
> -			$db{$key}->{'duration'} = $db{$key}->{'notify'} - $db{$key}->{'start'};
> -			$db{$key}->{'context-complete-delay'} = $db{$key}->{'end'} - $db{$key}->{'notify'};
>   		}
>   	}
>   }
> @@ -528,8 +520,6 @@ foreach my $key (keys(%db)) {
>   	if (exists $db{$next_key}) {
>   		$db{$key}->{'notify'} = $db{$next_key}->{'end'};
>   		$db{$key}->{'end'} = $db{$key}->{'notify'};
> -		$db{$key}->{'duration'} = $db{$key}->{'notify'} - $db{$key}->{'start'};
> -		$db{$key}->{'context-complete-delay'} = $db{$key}->{'end'} - $db{$key}->{'notify'};
>   	}
>   }
>   
> @@ -572,17 +562,11 @@ foreach my $key (@sorted_keys) {
>   	$first_ts = $db{$key}->{'queue'} if not defined $first_ts or $db{$key}->{'queue'} < $first_ts;
>   	$last_ts = $end if $end > $last_ts;
>   
> -	$running{$ring} += $end - $db{$key}->{'start'} unless exists $db{$key}->{'no-end'};
> -	$runnable{$ring} += $db{$key}->{'execute-delay'};
> -	$queued{$ring} += $db{$key}->{'start'} - $db{$key}->{'execute-delay'} - $db{$key}->{'queue'};
> -
> -	$batch_count{$ring}++;
> -
>   	# correct duration of merged batches
>   	if ($correct_durations and exists $db{$key}->{'no-end'}) {
> -		my $start = $db{$key}->{'start'};
>   		my $ctx = $db{$key}->{'ctx'};
>   		my $seqno = $db{$key}->{'seqno'};
> +		my $start = $db{$key}->{'start'};
>   		my $next_key;
>   		my $i = 1;
>   
> @@ -593,25 +577,43 @@ foreach my $key (@sorted_keys) {
>   
>   		# 20us tolerance
>   		if (exists $db{$next_key} and $db{$next_key}->{'start'} < $start + 20) {
> +			my $notify = $db{$key}->{'notify'};
>   			$re_sort = 1;
> -			$db{$next_key}->{'start'} = $start + $db{$key}->{'duration'};
> +			$db{$next_key}->{'start'} = $notify;
>   			$db{$next_key}->{'start'} = $db{$next_key}->{'end'} if $db{$next_key}->{'start'} > $db{$next_key}->{'end'};
> -			$db{$next_key}->{'duration'} = $db{$next_key}->{'notify'} - $db{$next_key}->{'start'};
> -			$end = $db{$key}->{'notify'};
>   			die if $db{$next_key}->{'start'} > $db{$next_key}->{'end'};
>   		}
> -		die if $db{$key}->{'start'} > $db{$key}->{'end'};
> +		die if $start > $end;
>   	}
> +}
> +
> +@sorted_keys = sort sortStart keys %db if $re_sort;
> +
> +foreach my $key (@sorted_keys) {
> +	my $ring = $db{$key}->{'ring'};
> +	my $end = $db{$key}->{'end'};
> +	my $start = $db{$key}->{'start'};
> +	my $notify = $db{$key}->{'notify'};
> +
> +	$db{$key}->{'context-complete-delay'} = $end - $notify;
> +	$db{$key}->{'execute-delay'} = $start - $db{$key}->{'submit'};
> +	$db{$key}->{'submit-delay'} = $db{$key}->{'submit'} - $db{$key}->{'queue'};
> +	$db{$key}->{'duration'} = $notify - $start;
> +
> +	$running{$ring} += $end - $start unless exists $db{$key}->{'no-end'};
> +	$runnable{$ring} += $db{$key}->{'execute-delay'};
> +	$queued{$ring} += $start - $db{$key}->{'execute-delay'} - $db{$key}->{'queue'};
> +
> +	$batch_count{$ring}++;
> +
>   	$batch_avg{$ring} += $db{$key}->{'duration'};
> -	$batch_total_avg{$ring} += $end - $db{$key}->{'start'};
> +	$batch_total_avg{$ring} += $end - $start;
>   
>   	$submit_avg{$ring} += $db{$key}->{'submit-delay'};
>   	$execute_avg{$ring} += $db{$key}->{'execute-delay'};
> -	$ctxsave_avg{$ring} += $db{$key}->{'end'} - $db{$key}->{'notify'};
> +	$ctxsave_avg{$ring} += $end - $notify;
>   }
>   
> -@sorted_keys = sort sortStart keys %db if $re_sort;
> -
>   foreach my $ring (sort keys %batch_avg) {
>   	$batch_avg{$ring} /= $batch_count{$ring};
>   	$batch_total_avg{$ring} /= $batch_count{$ring};
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v2 4/4] scripts/trace.pl: Simplify 'end' & 'notify' generation
  2018-01-23  6:32 ` [igt-dev] [PATCH i-g-t v2 4/4] scripts/trace.pl: Simplify 'end' & 'notify' generation John.C.Harrison
@ 2018-01-24 10:12   ` Tvrtko Ursulin
  0 siblings, 0 replies; 19+ messages in thread
From: Tvrtko Ursulin @ 2018-01-24 10:12 UTC (permalink / raw)
  To: John.C.Harrison, IGT-Dev; +Cc: Tvrtko Ursulin


On 23/01/2018 06:32, John.C.Harrison@Intel.com wrote:
> From: John Harrison <John.C.Harrison@Intel.com>
> 
> Delay the auto-generation of end/notify values until the point where
> everything is known. As opposed to potentially generating them
> multiple times with differing values (in the case of 'incomplete'
> entries).
> 
> v2: More complete description. [Tvrtko]
> 
> Signed-off-by: John Harrison <John.C.Harrison@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   scripts/trace.pl | 31 ++++++++++++++++++-------------
>   1 file changed, 18 insertions(+), 13 deletions(-)
> 
> diff --git a/scripts/trace.pl b/scripts/trace.pl
> index c984cef6..ba969d2c 100755
> --- a/scripts/trace.pl
> +++ b/scripts/trace.pl
> @@ -467,10 +467,11 @@ while (<>) {
>   }
>   
>   # Sanitation pass to fixup up out of order notify and context complete, and to
> -# fine the largest seqno to be used for timeline sorting purposes.
> +# find the largest seqno to be used for timeline sorting purposes.
>   my $max_seqno = 0;
>   foreach my $key (keys %db) {
>   	my $gkey = global_key($db{$key}->{'ring'}, $db{$key}->{'global'});
> +	my $notify = $notify{$gkey};
>   
>   	die unless exists $db{$key}->{'start'};
>   
> @@ -478,23 +479,21 @@ foreach my $key (keys %db) {
>   
>   	unless (exists $db{$key}->{'end'}) {
>   		# Context complete not received.
> -		if (exists $notify{$gkey}) {
> +		$db{$key}->{'no-end'} = 1;
> +
> +		if (defined($notify)) {
>   			# No context complete due req merging - use notify.
> -			$db{$key}->{'notify'} = $notify{$gkey};
> -			$db{$key}->{'end'} = $db{$key}->{'notify'};
> -			$db{$key}->{'no-end'} = 1;
> +			$db{$key}->{'notify'} = $notify;
> +			$db{$key}->{'end'} = $notify;
>   		} else {
> -			# No notify and no context complete - mark it.
> -			$db{$key}->{'no-end'} = 1;
> -			$db{$key}->{'end'} = $db{$key}->{'start'} + 999;
> -			$db{$key}->{'notify'} = $db{$key}->{'end'};
> +			# No notify and no context complete - give up for now.
>   			$db{$key}->{'incomplete'} = 1;
>   		}
>   	} else {
>   		# Notify arrived after context complete.
> -		if (exists $db{$key}->{'no-notify'} and exists $notify{$gkey}) {
> +		if (exists $db{$key}->{'no-notify'} and defined($notify)) {
>   			delete $db{$key}->{'no-notify'};
> -			$db{$key}->{'notify'} = $notify{$gkey};
> +			$db{$key}->{'notify'} = $notify;
>   		}
>   	}
>   }
> @@ -510,6 +509,7 @@ foreach my $key (keys(%db)) {
>   	my $seqno = $db{$key}->{'seqno'};
>   	my $next_key;
>   	my $i = 1;
> +	my $end;
>   
>   	do {
>   		$next_key = db_key($ring, $ctx, $seqno + $i);
> @@ -518,9 +518,14 @@ foreach my $key (keys(%db)) {
>   		 or $i > $key_count);  # ugly stop hack
>   
>   	if (exists $db{$next_key}) {
> -		$db{$key}->{'notify'} = $db{$next_key}->{'end'};
> -		$db{$key}->{'end'} = $db{$key}->{'notify'};
> +		$end = $db{$next_key}->{'end'};
> +	} else {
> +		# No info at all, fake it:
> +		$end = $db{$key}->{'start'} + 999;
>   	}
> +
> +	$db{$key}->{'notify'} = $end;
> +	$db{$key}->{'end'} = $end;
>   }
>   
>   # GPU time accounting
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [igt-dev] [PATCH i-g-t v2 1/4] scripts/trace.pl: More hash key optimisations
  2018-01-24 10:07   ` Tvrtko Ursulin
@ 2018-01-25 16:18     ` John.C.Harrison
  2018-01-25 16:24     ` John.C.Harrison
  1 sibling, 0 replies; 19+ messages in thread
From: John.C.Harrison @ 2018-01-25 16:18 UTC (permalink / raw)
  To: IGT-Dev; +Cc: Tvrtko Ursulin

From: John Harrison <John.C.Harrison@Intel.com>

Cache the key count value rather than querying the hash every time.
Also assert that the database does not magically change size after the
fixups.

v2: Rename variable according to style guide [Tvrtko]

v3: Reverted accidental style change [Tvrtko]

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

diff --git a/scripts/trace.pl b/scripts/trace.pl
index cb93900d..72adbc03 100755
--- a/scripts/trace.pl
+++ b/scripts/trace.pl
@@ -508,6 +508,7 @@ foreach my $key (keys %db) {
 }
 
 # Fix up incompletes
+my $key_count = scalar(keys %db);
 foreach my $key (keys %db) {
 	next unless exists $db{$key}->{'incomplete'};
 
@@ -522,7 +523,7 @@ foreach my $key (keys %db) {
 		$next_key = db_key($ring, $ctx, $seqno + $i);
 		$i++;
 	} until ((exists $db{$next_key} and not exists $db{$next_key}->{'incomplete'})
-		 or $i > scalar(keys(%db)));  # ugly stop hack
+		 or $i > $key_count);  # ugly stop hack
 
 	if (exists $db{$next_key}) {
 		$db{$key}->{'notify'} = $db{$next_key}->{'end'};
@@ -540,6 +541,7 @@ my $first_ts;
 
 my @sorted_keys = sort {$db{$a}->{'start'} <=> $db{$b}->{'start'}} keys %db;
 my $re_sort = 0;
+die "Database changed size?!" unless scalar(@sorted_keys) == $key_count;
 
 foreach my $key (@sorted_keys) {
 	my $ring = $db{$key}->{'ring'};
@@ -565,7 +567,7 @@ foreach my $key (@sorted_keys) {
 		do {
 			$next_key = db_key($ring, $ctx, $seqno + $i);
 			$i++;
-		} until (exists $db{$next_key} or $i > scalar(keys(%db)));  # ugly stop hack
+		} until (exists $db{$next_key} or $i > $key_count);  # ugly stop hack
 
 		# 20us tolerance
 		if (exists $db{$next_key} and $db{$next_key}->{'start'} < $start + 20) {
-- 
2.15.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [igt-dev] [PATCH i-g-t v2 1/4] scripts/trace.pl: More hash key optimisations
  2018-01-24 10:07   ` Tvrtko Ursulin
  2018-01-25 16:18     ` John.C.Harrison
@ 2018-01-25 16:24     ` John.C.Harrison
  2018-01-25 16:36       ` Tvrtko Ursulin
  1 sibling, 1 reply; 19+ messages in thread
From: John.C.Harrison @ 2018-01-25 16:24 UTC (permalink / raw)
  To: IGT-Dev; +Cc: Tvrtko Ursulin

From: John Harrison <John.C.Harrison@Intel.com>

Cache the key count value rather than querying the hash every time.
Also assert that the database does not magically change size after the
fixups.

v2: Rename variable according to style guide [Tvrtko]

v3: Reverted accidental style change and added a blank line. [Tvrtko]

Signed-off-by: John Harrison <John.C.Harrison@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 scripts/trace.pl | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/scripts/trace.pl b/scripts/trace.pl
index cb93900d..783a4d89 100755
--- a/scripts/trace.pl
+++ b/scripts/trace.pl
@@ -508,6 +508,7 @@ foreach my $key (keys %db) {
 }
 
 # Fix up incompletes
+my $key_count = scalar(keys %db);
 foreach my $key (keys %db) {
 	next unless exists $db{$key}->{'incomplete'};
 
@@ -522,7 +523,7 @@ foreach my $key (keys %db) {
 		$next_key = db_key($ring, $ctx, $seqno + $i);
 		$i++;
 	} until ((exists $db{$next_key} and not exists $db{$next_key}->{'incomplete'})
-		 or $i > scalar(keys(%db)));  # ugly stop hack
+		 or $i > $key_count);  # ugly stop hack
 
 	if (exists $db{$next_key}) {
 		$db{$key}->{'notify'} = $db{$next_key}->{'end'};
@@ -541,6 +542,8 @@ my $first_ts;
 my @sorted_keys = sort {$db{$a}->{'start'} <=> $db{$b}->{'start'}} keys %db;
 my $re_sort = 0;
 
+die "Database changed size?!" unless scalar(@sorted_keys) == $key_count;
+
 foreach my $key (@sorted_keys) {
 	my $ring = $db{$key}->{'ring'};
 	my $end = $db{$key}->{'end'};
@@ -565,7 +568,7 @@ foreach my $key (@sorted_keys) {
 		do {
 			$next_key = db_key($ring, $ctx, $seqno + $i);
 			$i++;
-		} until (exists $db{$next_key} or $i > scalar(keys(%db)));  # ugly stop hack
+		} until (exists $db{$next_key} or $i > $key_count);  # ugly stop hack
 
 		# 20us tolerance
 		if (exists $db{$next_key} and $db{$next_key}->{'start'} < $start + 20) {
-- 
2.15.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v2 1/4] scripts/trace.pl: More hash key optimisations
  2018-01-25 16:24     ` John.C.Harrison
@ 2018-01-25 16:36       ` Tvrtko Ursulin
  0 siblings, 0 replies; 19+ messages in thread
From: Tvrtko Ursulin @ 2018-01-25 16:36 UTC (permalink / raw)
  To: John.C.Harrison, IGT-Dev; +Cc: Tvrtko Ursulin


On 25/01/2018 16:24, John.C.Harrison@Intel.com wrote:
> From: John Harrison <John.C.Harrison@Intel.com>
> 
> Cache the key count value rather than querying the hash every time.
> Also assert that the database does not magically change size after the
> fixups.
> 
> v2: Rename variable according to style guide [Tvrtko]
> 
> v3: Reverted accidental style change and added a blank line. [Tvrtko]
> 
> Signed-off-by: John Harrison <John.C.Harrison@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   scripts/trace.pl | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/trace.pl b/scripts/trace.pl
> index cb93900d..783a4d89 100755
> --- a/scripts/trace.pl
> +++ b/scripts/trace.pl
> @@ -508,6 +508,7 @@ foreach my $key (keys %db) {
>   }
>   
>   # Fix up incompletes
> +my $key_count = scalar(keys %db);
>   foreach my $key (keys %db) {
>   	next unless exists $db{$key}->{'incomplete'};
>   
> @@ -522,7 +523,7 @@ foreach my $key (keys %db) {
>   		$next_key = db_key($ring, $ctx, $seqno + $i);
>   		$i++;
>   	} until ((exists $db{$next_key} and not exists $db{$next_key}->{'incomplete'})
> -		 or $i > scalar(keys(%db)));  # ugly stop hack
> +		 or $i > $key_count);  # ugly stop hack
>   
>   	if (exists $db{$next_key}) {
>   		$db{$key}->{'notify'} = $db{$next_key}->{'end'};
> @@ -541,6 +542,8 @@ my $first_ts;
>   my @sorted_keys = sort {$db{$a}->{'start'} <=> $db{$b}->{'start'}} keys %db;
>   my $re_sort = 0;
>   
> +die "Database changed size?!" unless scalar(@sorted_keys) == $key_count;
> +
>   foreach my $key (@sorted_keys) {
>   	my $ring = $db{$key}->{'ring'};
>   	my $end = $db{$key}->{'end'};
> @@ -565,7 +568,7 @@ foreach my $key (@sorted_keys) {
>   		do {
>   			$next_key = db_key($ring, $ctx, $seqno + $i);
>   			$i++;
> -		} until (exists $db{$next_key} or $i > scalar(keys(%db)));  # ugly stop hack
> +		} until (exists $db{$next_key} or $i > $key_count);  # ugly stop hack
>   
>   		# 20us tolerance
>   		if (exists $db{$next_key} and $db{$next_key}->{'start'} < $start + 20) {
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for scripts/trace.pl: Re-order calculations and fixups (rev2)
  2018-01-23  6:32 [igt-dev] [PATCH i-g-t v2 0/4] scripts/trace.pl: Re-order calculations and fixups John.C.Harrison
                   ` (5 preceding siblings ...)
  2018-01-23 10:20 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
@ 2018-01-25 16:40 ` Patchwork
  2018-01-25 16:57 ` [igt-dev] ✓ Fi.CI.BAT: success for scripts/trace.pl: Re-order calculations and fixups (rev3) Patchwork
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 19+ messages in thread
From: Patchwork @ 2018-01-25 16:40 UTC (permalink / raw)
  To: John.C.Harrison; +Cc: igt-dev

== Series Details ==

Series: scripts/trace.pl: Re-order calculations and fixups (rev2)
URL   : https://patchwork.freedesktop.org/series/36947/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
872fd8f21e22a3ca49739b67c47c6665da450dbf tests/kms_ccs: Grab the CRC when the plane is actually enabled

with latest DRM-Tip kernel build CI_DRM_3683
9d8467fe5626 drm-tip: 2018y-01m-24d-19h-59m-41s UTC integration manifest

No testlist changes.

Test debugfs_test:
        Subgroup read_all_entries:
                dmesg-warn -> DMESG-FAIL (fi-elk-e7500) fdo#103989
Test gem_exec_suspend:
        Subgroup basic-s3:
                pass       -> DMESG-WARN (fi-skl-6700k2) fdo#104108

fdo#103989 https://bugs.freedesktop.org/show_bug.cgi?id=103989
fdo#104108 https://bugs.freedesktop.org/show_bug.cgi?id=104108

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:422s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:430s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:372s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:493s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:284s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:490s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:487s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:469s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:459s
fi-elk-e7500     total:224  pass:168  dwarn:9   dfail:1   fail:0   skip:45 
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:280s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:514s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:395s
fi-hsw-4770r     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:401s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:418s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:458s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:418s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:467s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:502s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:456s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:505s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:431s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:513s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:531s
fi-skl-6700k2    total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:490s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:475s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:423s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:433s
fi-snb-2520m     total:245  pass:211  dwarn:0   dfail:0   fail:0   skip:33 
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:401s
Blacklisted hosts:
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:569s
fi-glk-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:471s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_824/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for scripts/trace.pl: Re-order calculations and fixups (rev3)
  2018-01-23  6:32 [igt-dev] [PATCH i-g-t v2 0/4] scripts/trace.pl: Re-order calculations and fixups John.C.Harrison
                   ` (6 preceding siblings ...)
  2018-01-25 16:40 ` [igt-dev] ✓ Fi.CI.BAT: success for scripts/trace.pl: Re-order calculations and fixups (rev2) Patchwork
@ 2018-01-25 16:57 ` Patchwork
  2018-01-25 18:04 ` [igt-dev] ✗ Fi.CI.IGT: warning for scripts/trace.pl: Re-order calculations and fixups (rev2) Patchwork
  2018-01-25 18:49 ` [igt-dev] ✗ Fi.CI.IGT: failure for scripts/trace.pl: Re-order calculations and fixups (rev3) Patchwork
  9 siblings, 0 replies; 19+ messages in thread
From: Patchwork @ 2018-01-25 16:57 UTC (permalink / raw)
  To: John.C.Harrison; +Cc: igt-dev

== Series Details ==

Series: scripts/trace.pl: Re-order calculations and fixups (rev3)
URL   : https://patchwork.freedesktop.org/series/36947/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
872fd8f21e22a3ca49739b67c47c6665da450dbf tests/kms_ccs: Grab the CRC when the plane is actually enabled

with latest DRM-Tip kernel build CI_DRM_3683
9d8467fe5626 drm-tip: 2018y-01m-24d-19h-59m-41s UTC integration manifest

No testlist changes.

Test debugfs_test:
        Subgroup read_all_entries:
                dmesg-warn -> DMESG-FAIL (fi-elk-e7500) fdo#103989
                pass       -> INCOMPLETE (fi-snb-2520m) fdo#103713

fdo#103989 https://bugs.freedesktop.org/show_bug.cgi?id=103989
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:427s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:432s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:374s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:490s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:282s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:490s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:492s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:478s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:458s
fi-elk-e7500     total:224  pass:168  dwarn:9   dfail:1   fail:0   skip:45 
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:280s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:516s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:392s
fi-hsw-4770r     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:400s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:423s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:458s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:418s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:461s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:500s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:456s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:504s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:437s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:520s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:529s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:488s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:483s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:414s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:432s
fi-snb-2520m     total:3    pass:2    dwarn:0   dfail:0   fail:0   skip:0  
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:400s
Blacklisted hosts:
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:568s
fi-glk-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:470s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_825/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [igt-dev] ✗ Fi.CI.IGT: warning for scripts/trace.pl: Re-order calculations and fixups (rev2)
  2018-01-23  6:32 [igt-dev] [PATCH i-g-t v2 0/4] scripts/trace.pl: Re-order calculations and fixups John.C.Harrison
                   ` (7 preceding siblings ...)
  2018-01-25 16:57 ` [igt-dev] ✓ Fi.CI.BAT: success for scripts/trace.pl: Re-order calculations and fixups (rev3) Patchwork
@ 2018-01-25 18:04 ` Patchwork
  2018-01-25 18:49 ` [igt-dev] ✗ Fi.CI.IGT: failure for scripts/trace.pl: Re-order calculations and fixups (rev3) Patchwork
  9 siblings, 0 replies; 19+ messages in thread
From: Patchwork @ 2018-01-25 18:04 UTC (permalink / raw)
  To: John.C.Harrison; +Cc: igt-dev

== Series Details ==

Series: scripts/trace.pl: Re-order calculations and fixups (rev2)
URL   : https://patchwork.freedesktop.org/series/36947/
State : warning

== Summary ==

Test kms_ccs:
        Subgroup pipe-a-crc-sprite-planes-basic:
                fail       -> SKIP       (shard-apl) fdo#104724 +1
Test kms_cursor_legacy:
        Subgroup flip-vs-cursor-crc-atomic:
                fail       -> PASS       (shard-apl) fdo#102670
Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-offscren-pri-shrfb-draw-blt:
                pass       -> FAIL       (shard-snb) fdo#101623
Test kms_flip:
        Subgroup 2x-flip-vs-expired-vblank:
                pass       -> FAIL       (shard-hsw) fdo#102887
        Subgroup 2x-flip-vs-modeset-interruptible:
                dmesg-warn -> PASS       (shard-hsw) fdo#102614
        Subgroup 2x-plain-flip-ts-check-interruptible:
                pass       -> FAIL       (shard-hsw) fdo#100368 +1
Test gem_pwrite:
        Subgroup big-cpu-backwards:
                pass       -> SKIP       (shard-apl)
Test gem_eio:
        Subgroup in-flight-contexts:
                fail       -> PASS       (shard-hsw) fdo#104676
        Subgroup in-flight:
                pass       -> DMESG-WARN (shard-snb) fdo#104058

fdo#104724 https://bugs.freedesktop.org/show_bug.cgi?id=104724
fdo#102670 https://bugs.freedesktop.org/show_bug.cgi?id=102670
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#104676 https://bugs.freedesktop.org/show_bug.cgi?id=104676
fdo#104058 https://bugs.freedesktop.org/show_bug.cgi?id=104058

shard-apl        total:2838 pass:1752 dwarn:1   dfail:0   fail:20  skip:1065 time:12635s
shard-hsw        total:2838 pass:1734 dwarn:1   dfail:0   fail:12  skip:1090 time:12003s
shard-snb        total:2838 pass:1328 dwarn:2   dfail:0   fail:11  skip:1497 time:6605s
Blacklisted hosts:
shard-kbl        total:2758 pass:1818 dwarn:1   dfail:0   fail:22  skip:917 time:9503s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_824/shards.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v2 3/4] scripts/trace.pl: Calculate stats only after all munging
  2018-01-23  6:32 ` [igt-dev] [PATCH i-g-t v2 3/4] scripts/trace.pl: Calculate stats only after all munging John.C.Harrison
  2018-01-24 10:11   ` Tvrtko Ursulin
@ 2018-01-25 18:11   ` Tvrtko Ursulin
  1 sibling, 0 replies; 19+ messages in thread
From: Tvrtko Ursulin @ 2018-01-25 18:11 UTC (permalink / raw)
  To: John.C.Harrison, IGT-Dev; +Cc: Tvrtko Ursulin


On 23/01/2018 06:32, John.C.Harrison@Intel.com wrote:
> From: John Harrison <John.C.Harrison@Intel.com>
> 
> There are various statistics being calculated multiple times in
> multiple places while the log file is being read in. Some of these are
> then re-calculated when the database is munged to correct various
> issues with the logs. This patch consolidates the calculations into a
> separate pass after all the reading and munging has been done.
> 
> Note that this actually produces a different final output as the
> 'execute-delay' values were not previously being re-calculated after
> all the fixups. Thus were based on an incorrect calculation.
> 
> v2: Reduce scope of some local variables [Tvrtko]
> 
> Signed-off-by: John Harrison <John.C.Harrison@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   scripts/trace.pl | 54 ++++++++++++++++++++++++++++--------------------------
>   1 file changed, 28 insertions(+), 26 deletions(-)
> 
> diff --git a/scripts/trace.pl b/scripts/trace.pl
> index b528d482..c984cef6 100755
> --- a/scripts/trace.pl
> +++ b/scripts/trace.pl
> @@ -437,8 +437,7 @@ while (<>) {
>   		$req{'global'} = $tp{'global'};
>   		$req{'port'} = $tp{'port'};
>   		$req{'queue'} = $queue{$key};
> -		$req{'submit-delay'} = $submit{$key} - $queue{$key};
> -		$req{'execute-delay'} = $req{'start'} - $submit{$key};
> +		$req{'submit'} = $submit{$key};
>   		$rings{$ring} = $gid++ unless exists $rings{$ring};
>   		$ringmap{$rings{$ring}} = $ring;
>   		$db{$key} = \%req;
> @@ -458,8 +457,6 @@ while (<>) {
>   			$db{$key}->{'notify'} = $db{$key}->{'end'};
>   			$db{$key}->{'no-notify'} = 1;
>   		}
> -		$db{$key}->{'duration'} = $db{$key}->{'notify'} - $db{$key}->{'start'};
> -		$db{$key}->{'context-complete-delay'} = $db{$key}->{'end'} - $db{$key}->{'notify'};
>   	} elsif ($tp_name eq 'i915:intel_engine_notify:') {
>   		$notify{global_key($ring, $seqno)} = $time;
>   	} elsif ($tp_name eq 'i915:intel_gpu_freq_change:') {
> @@ -493,16 +490,11 @@ foreach my $key (keys %db) {
>   			$db{$key}->{'notify'} = $db{$key}->{'end'};
>   			$db{$key}->{'incomplete'} = 1;
>   		}
> -
> -		$db{$key}->{'duration'} = $db{$key}->{'notify'} - $db{$key}->{'start'};
> -		$db{$key}->{'context-complete-delay'} = $db{$key}->{'end'} - $db{$key}->{'notify'};
>   	} else {
>   		# Notify arrived after context complete.
>   		if (exists $db{$key}->{'no-notify'} and exists $notify{$gkey}) {
>   			delete $db{$key}->{'no-notify'};
>   			$db{$key}->{'notify'} = $notify{$gkey};
> -			$db{$key}->{'duration'} = $db{$key}->{'notify'} - $db{$key}->{'start'};
> -			$db{$key}->{'context-complete-delay'} = $db{$key}->{'end'} - $db{$key}->{'notify'};
>   		}
>   	}
>   }
> @@ -528,8 +520,6 @@ foreach my $key (keys(%db)) {
>   	if (exists $db{$next_key}) {
>   		$db{$key}->{'notify'} = $db{$next_key}->{'end'};
>   		$db{$key}->{'end'} = $db{$key}->{'notify'};
> -		$db{$key}->{'duration'} = $db{$key}->{'notify'} - $db{$key}->{'start'};
> -		$db{$key}->{'context-complete-delay'} = $db{$key}->{'end'} - $db{$key}->{'notify'};
>   	}
>   }
>   
> @@ -572,17 +562,11 @@ foreach my $key (@sorted_keys) {
>   	$first_ts = $db{$key}->{'queue'} if not defined $first_ts or $db{$key}->{'queue'} < $first_ts;
>   	$last_ts = $end if $end > $last_ts;
>   
> -	$running{$ring} += $end - $db{$key}->{'start'} unless exists $db{$key}->{'no-end'};
> -	$runnable{$ring} += $db{$key}->{'execute-delay'};
> -	$queued{$ring} += $db{$key}->{'start'} - $db{$key}->{'execute-delay'} - $db{$key}->{'queue'};
> -
> -	$batch_count{$ring}++;
> -
>   	# correct duration of merged batches
>   	if ($correct_durations and exists $db{$key}->{'no-end'}) {
> -		my $start = $db{$key}->{'start'};
>   		my $ctx = $db{$key}->{'ctx'};
>   		my $seqno = $db{$key}->{'seqno'};
> +		my $start = $db{$key}->{'start'};
>   		my $next_key;
>   		my $i = 1;
>   
> @@ -593,25 +577,43 @@ foreach my $key (@sorted_keys) {
>   
>   		# 20us tolerance
>   		if (exists $db{$next_key} and $db{$next_key}->{'start'} < $start + 20) {
> +			my $notify = $db{$key}->{'notify'};
>   			$re_sort = 1;
> -			$db{$next_key}->{'start'} = $start + $db{$key}->{'duration'};
> +			$db{$next_key}->{'start'} = $notify;
>   			$db{$next_key}->{'start'} = $db{$next_key}->{'end'} if $db{$next_key}->{'start'} > $db{$next_key}->{'end'};
> -			$db{$next_key}->{'duration'} = $db{$next_key}->{'notify'} - $db{$next_key}->{'start'};
> -			$end = $db{$key}->{'notify'};
>   			die if $db{$next_key}->{'start'} > $db{$next_key}->{'end'};
>   		}

There is something going wrong with processing, well untangling, of 
merged batches after your changes. At least one trace shows a completely 
bad decision here, where a fully known batch gets adjusted needlessly 
and in a wrong way. I have to study this in more detail so merging the 
series will have to wait.

Regards,

Tvrtko


> -		die if $db{$key}->{'start'} > $db{$key}->{'end'};
> +		die if $start > $end;
>   	}
> +}
> +
> +@sorted_keys = sort sortStart keys %db if $re_sort;
> +
> +foreach my $key (@sorted_keys) {
> +	my $ring = $db{$key}->{'ring'};
> +	my $end = $db{$key}->{'end'};
> +	my $start = $db{$key}->{'start'};
> +	my $notify = $db{$key}->{'notify'};
> +
> +	$db{$key}->{'context-complete-delay'} = $end - $notify;
> +	$db{$key}->{'execute-delay'} = $start - $db{$key}->{'submit'};
> +	$db{$key}->{'submit-delay'} = $db{$key}->{'submit'} - $db{$key}->{'queue'};
> +	$db{$key}->{'duration'} = $notify - $start;
> +
> +	$running{$ring} += $end - $start unless exists $db{$key}->{'no-end'};
> +	$runnable{$ring} += $db{$key}->{'execute-delay'};
> +	$queued{$ring} += $start - $db{$key}->{'execute-delay'} - $db{$key}->{'queue'};
> +
> +	$batch_count{$ring}++;
> +
>   	$batch_avg{$ring} += $db{$key}->{'duration'};
> -	$batch_total_avg{$ring} += $end - $db{$key}->{'start'};
> +	$batch_total_avg{$ring} += $end - $start;
>   
>   	$submit_avg{$ring} += $db{$key}->{'submit-delay'};
>   	$execute_avg{$ring} += $db{$key}->{'execute-delay'};
> -	$ctxsave_avg{$ring} += $db{$key}->{'end'} - $db{$key}->{'notify'};
> +	$ctxsave_avg{$ring} += $end - $notify;
>   }
>   
> -@sorted_keys = sort sortStart keys %db if $re_sort;
> -
>   foreach my $ring (sort keys %batch_avg) {
>   	$batch_avg{$ring} /= $batch_count{$ring};
>   	$batch_total_avg{$ring} /= $batch_count{$ring};
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [igt-dev] ✗ Fi.CI.IGT: failure for scripts/trace.pl: Re-order calculations and fixups (rev3)
  2018-01-23  6:32 [igt-dev] [PATCH i-g-t v2 0/4] scripts/trace.pl: Re-order calculations and fixups John.C.Harrison
                   ` (8 preceding siblings ...)
  2018-01-25 18:04 ` [igt-dev] ✗ Fi.CI.IGT: warning for scripts/trace.pl: Re-order calculations and fixups (rev2) Patchwork
@ 2018-01-25 18:49 ` Patchwork
  9 siblings, 0 replies; 19+ messages in thread
From: Patchwork @ 2018-01-25 18:49 UTC (permalink / raw)
  To: John.C.Harrison; +Cc: igt-dev

== Series Details ==

Series: scripts/trace.pl: Re-order calculations and fixups (rev3)
URL   : https://patchwork.freedesktop.org/series/36947/
State : failure

== Summary ==

Test gem_eio:
        Subgroup in-flight:
                pass       -> FAIL       (shard-hsw) fdo#104676 +1
Test kms_cursor_legacy:
        Subgroup flip-vs-cursor-crc-atomic:
                fail       -> PASS       (shard-apl) fdo#102670
Test kms_chv_cursor_fail:
        Subgroup pipe-a-256x256-left-edge:
                pass       -> FAIL       (shard-apl)
Test kms_ccs:
        Subgroup pipe-a-crc-sprite-planes-basic:
                fail       -> SKIP       (shard-apl) fdo#104724 +1
Test kms_flip:
        Subgroup flip-vs-blocking-wf-vblank:
                pass       -> FAIL       (shard-hsw) fdo#100368 +1
        Subgroup 2x-flip-vs-modeset-interruptible:
                dmesg-warn -> PASS       (shard-hsw) fdo#102614
Test gem_pwrite:
        Subgroup big-gtt-backwards:
                pass       -> SKIP       (shard-apl)

fdo#104676 https://bugs.freedesktop.org/show_bug.cgi?id=104676
fdo#102670 https://bugs.freedesktop.org/show_bug.cgi?id=102670
fdo#104724 https://bugs.freedesktop.org/show_bug.cgi?id=104724
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614

shard-apl        total:2838 pass:1751 dwarn:1   dfail:0   fail:21  skip:1065 time:12585s
shard-hsw        total:2838 pass:1734 dwarn:1   dfail:0   fail:12  skip:1090 time:11879s
shard-snb        total:2838 pass:1330 dwarn:1   dfail:0   fail:10  skip:1497 time:6611s
Blacklisted hosts:
shard-kbl        total:2830 pass:1856 dwarn:9   dfail:0   fail:24  skip:940 time:9441s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_825/shards.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2018-01-25 18:49 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-23  6:32 [igt-dev] [PATCH i-g-t v2 0/4] scripts/trace.pl: Re-order calculations and fixups John.C.Harrison
2018-01-23  6:32 ` [igt-dev] [PATCH i-g-t v2 1/4] scripts/trace.pl: More hash key optimisations John.C.Harrison
2018-01-24 10:07   ` Tvrtko Ursulin
2018-01-25 16:18     ` John.C.Harrison
2018-01-25 16:24     ` John.C.Harrison
2018-01-25 16:36       ` Tvrtko Ursulin
2018-01-23  6:32 ` [igt-dev] [PATCH i-g-t v2 2/4] scripts/trace.pl: Sort order John.C.Harrison
2018-01-24 10:10   ` Tvrtko Ursulin
2018-01-23  6:32 ` [igt-dev] [PATCH i-g-t v2 3/4] scripts/trace.pl: Calculate stats only after all munging John.C.Harrison
2018-01-24 10:11   ` Tvrtko Ursulin
2018-01-25 18:11   ` Tvrtko Ursulin
2018-01-23  6:32 ` [igt-dev] [PATCH i-g-t v2 4/4] scripts/trace.pl: Simplify 'end' & 'notify' generation John.C.Harrison
2018-01-24 10:12   ` Tvrtko Ursulin
2018-01-23  6:53 ` [igt-dev] ✓ Fi.CI.BAT: success for scripts/trace.pl: Re-order calculations and fixups Patchwork
2018-01-23 10:20 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-01-25 16:40 ` [igt-dev] ✓ Fi.CI.BAT: success for scripts/trace.pl: Re-order calculations and fixups (rev2) Patchwork
2018-01-25 16:57 ` [igt-dev] ✓ Fi.CI.BAT: success for scripts/trace.pl: Re-order calculations and fixups (rev3) Patchwork
2018-01-25 18:04 ` [igt-dev] ✗ Fi.CI.IGT: warning for scripts/trace.pl: Re-order calculations and fixups (rev2) Patchwork
2018-01-25 18:49 ` [igt-dev] ✗ Fi.CI.IGT: failure for scripts/trace.pl: Re-order calculations and fixups (rev3) Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.