diff mbox

[i-g-t,4/8] trace.pl: Skip drawing very short boxes

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

Commit Message

Tvrtko Ursulin June 5, 2018, 5:50 p.m. UTC
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Few micro-second long boxes cannot be displayed by the visualizer in a
meaningful way so just burden the browser and the human looking at the
noise. Sp skip drawing anything shorter and 10us.

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

Patch

diff --git a/scripts/trace.pl b/scripts/trace.pl
index 8f118d8665cf..96ff80ab46a9 100755
--- a/scripts/trace.pl
+++ b/scripts/trace.pl
@@ -40,6 +40,7 @@  my $trace = 0;
 my $avg_delay_stats = 0;
 my $gpu_timeline = 0;
 my $colour_contexts = 0;
+my $min_duration = 10; # us
 
 my @args;
 
@@ -938,14 +939,15 @@  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'};
-	my ($content, $style);
+	my ($content, $style, $duration);
 	my $group = $engine_start_id + $rings{$db{$key}->{'ring'}};
 	my $type = ' type: \'range\',';
 	my $startend;
 	my $skey;
 
 	# submit to execute
-	unless (exists $skip_box{'queue'}) {
+	$duration = $submit - $queue;
+	unless (exists $skip_box{'queue'} or $duration < $min_duration) {
 		$skey = 2 * $max_seqno * $ctx + 2 * $seqno;
 		$style = box_style($ctx, 'queue');
 		$content = "$name<br>$db{$key}->{'submit-delay'}us <small>($db{$key}->{'execute-delay'}us)</small>";
@@ -955,7 +957,8 @@  foreach my $key (sort sortQueue keys %db) {
 	}
 
 	# execute to start
-	unless (exists $skip_box{'ready'}) {
+	$duration = $start - $submit;
+	unless (exists $skip_box{'ready'} or $duration < $min_duration) {
 		$skey = 2 * $max_seqno * $ctx + 2 * $seqno + 1;
 		$style = box_style($ctx, 'ready');
 		$content = "<small>$name<br>$db{$key}->{'execute-delay'}us</small>";
@@ -965,7 +968,8 @@  foreach my $key (sort sortQueue keys %db) {
 	}
 
 	# start to user interrupt
-	unless (exists $skip_box{'execute'}) {
+	$duration = $notify - $start;
+	unless (exists $skip_box{'execute'} or $duration < $min_duration) {
 		$skey = -2 * $max_seqno * $ctx - 2 * $seqno - 1;
 		if (exists $db{$key}->{'incomplete'}) {
 			$style = 'color: white; background-color: red;';
@@ -983,7 +987,8 @@  foreach my $key (sort sortQueue keys %db) {
 	}
 
 	# user interrupt to context complete
-	unless (exists $skip_box{'ctxsave'}) {
+	$duration = $end - $notify;
+	unless (exists $skip_box{'ctxsave'} or $duration < $min_duration) {
 		$skey = -2 * $max_seqno * $ctx - 2 * $seqno;
 		$style = 'color: black; background-color: orange;';
 		my $ctxsave = $db{$key}->{'end'} - $db{$key}->{'notify'};