From: John Harrison Subject: Re: [PATCH i-g-t 4/4] trace.pl: Fix frequency timeline Date: Fri, 27 Jul 2018 15:17:27 -0700 Message-ID: <7609f8be-7252-be6d-a3a3-9bac668ebc86@Intel.com> References: <20180719093601.11788-1-tvrtko.ursulin@linux.intel.com> <20180719093601.11788-5-tvrtko.ursulin@linux.intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0781741034==" Return-path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5E90C6E05A for ; Fri, 27 Jul 2018 22:17:28 +0000 (UTC) In-Reply-To: <20180719093601.11788-5-tvrtko.ursulin@linux.intel.com> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org This is a multi-part message in MIME format. --===============0781741034== Content-Type: multipart/alternative; boundary="------------6861F967CC25E84251FE8471" Content-Language: en-US This is a multi-part message in MIME format. --------------6861F967CC25E84251FE8471 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 7/19/2018 2:36 AM, Tvrtko Ursulin wrote: > From: Tvrtko Ursulin > > Frequency timeline needs to be finished with an entry spanning to the end > of known time so that the last known frequency is displayed. > > Signed-off-by: Tvrtko Ursulin > --- > scripts/trace.pl | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/scripts/trace.pl b/scripts/trace.pl > index 1924333e12b6..2976cfdf585a 100755 > --- a/scripts/trace.pl > +++ b/scripts/trace.pl > @@ -1201,6 +1201,8 @@ foreach my $key (sort sortQueue keys %db) { > last if $i > $max_items; > } > > +push @freqs, [$prev_freq_ts, $last_ts, $prev_freq] if $prev_freq; > + > foreach my $item (@freqs) { > my ($start, $end, $freq) = @$item; > my $startend; This does not appear to do anything for me. At least not with any of my trace files. I get exactly the same output with or without the change. What situation is it meant to fix? Note that I get the frequency line abbreviated to the size of the request trace. Not sure if that is intentional or not. E.g. with the following trace data the frequency bar starts with 300 at a time of 728us not 706us. Likewise, it ends at 389838us not 392227us: gem_exec_trace 1316 [002] 856981.389706: i915:intel_gpu_freq_change: new_freq=300 gem_exec_trace 1316 [002] 856981.389728: i915:i915_request_add: dev=0, engine=0:0, hw_id=2, ctx=847, seqno=1, global=0 gem_exec_trace 1316 [002] 856981.389732: i915:i915_request_submit: dev=0, engine=0:0, hw_id=2, ctx=847, seqno=1, global=0 gem_exec_trace 1316 [002] 856981.389739: i915:i915_request_in: dev=0, engine=0:0, hw_id=2, ctx=847, seqno=1, prio=0, global=1, port=0 swapper 0 [002] 856981.389838: i915:i915_request_out: dev=0, engine=0:0, hw_id=2, ctx=847, seqno=1, global=1, completed?=1 kworker/u8:1 1246 [001] 856981.392227: i915:intel_gpu_freq_change: new_freq=300 --------------6861F967CC25E84251FE8471 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit On 7/19/2018 2:36 AM, Tvrtko Ursulin wrote:
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Frequency timeline needs to be finished with an entry spanning to the end
of known time so that the last known frequency is displayed.

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

diff --git a/scripts/trace.pl b/scripts/trace.pl
index 1924333e12b6..2976cfdf585a 100755
--- a/scripts/trace.pl
+++ b/scripts/trace.pl
@@ -1201,6 +1201,8 @@ foreach my $key (sort sortQueue keys %db) {
 	last if $i > $max_items;
 }
 
+push @freqs, [$prev_freq_ts, $last_ts, $prev_freq] if $prev_freq;
+
 foreach my $item (@freqs) {
 	my ($start, $end, $freq) = @$item;
 	my $startend;

This does not appear to do anything for me. At least not with any of my trace files. I get exactly the same output with or without the change. What situation is it meant to fix?

Note that I get the frequency line abbreviated to the size of the request trace. Not sure if that is intentional or not. E.g. with the following trace data the frequency bar starts with 300 at a time of 728us not 706us. Likewise, it ends at 389838us not 392227us:
  gem_exec_trace  1316 [002] 856981.389706:   i915:intel_gpu_freq_change: new_freq=300
  gem_exec_trace  1316 [002] 856981.389728:        i915:i915_request_add: dev=0, engine=0:0, hw_id=2, ctx=847, seqno=1, global=0
  gem_exec_trace  1316 [002] 856981.389732:     i915:i915_request_submit: dev=0, engine=0:0, hw_id=2, ctx=847, seqno=1, global=0
  gem_exec_trace  1316 [002] 856981.389739:         i915:i915_request_in: dev=0, engine=0:0, hw_id=2, ctx=847, seqno=1, prio=0, global=1, port=0
         swapper     0 [002] 856981.389838:        i915:i915_request_out: dev=0, engine=0:0, hw_id=2, ctx=847, seqno=1, global=1, completed?=1
    kworker/u8:1  1246 [001] 856981.392227:   i915:intel_gpu_freq_change: new_freq=300



--------------6861F967CC25E84251FE8471-- --===============0781741034== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4Cg== --===============0781741034==--