All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/perf_pmu: Use perf timestamps when calculating average frequency
@ 2018-02-07 12:24 Tvrtko Ursulin
  2018-02-07 12:34 ` Chris Wilson
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Tvrtko Ursulin @ 2018-02-07 12:24 UTC (permalink / raw)
  To: Intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

We can use perf reported timestamps to potentially get a more accurate
frequency average.

Lets see if this improves the situation for sporadic failures like on APL:

 Frequency: min=100, max=750, boost=750 MHz
 Min frequency: requested 90.0, actual 90.0
 Max frequency: requested 749.8, actual 647.9

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tests/perf_pmu.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index 681d4a55d006..14041ee686e8 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -107,7 +107,7 @@ static uint64_t pmu_read_single(int fd)
 	return __pmu_read_single(fd, NULL);
 }
 
-static void pmu_read_multi(int fd, unsigned int num, uint64_t *val)
+static uint64_t pmu_read_multi(int fd, unsigned int num, uint64_t *val)
 {
 	uint64_t buf[2 + num];
 	unsigned int i;
@@ -116,6 +116,8 @@ static void pmu_read_multi(int fd, unsigned int num, uint64_t *val)
 
 	for (i = 0; i < num; i++)
 		val[i] = buf[2 + i];
+
+	return buf[1];
 }
 
 #define assert_within_epsilon(x, ref, tolerance) \
@@ -1167,9 +1169,8 @@ static void
 test_frequency(int gem_fd)
 {
 	uint32_t min_freq, max_freq, boost_freq;
-	uint64_t val[2], start[2];
+	uint64_t val[2], start[2], slept;
 	double min[2], max[2];
-	unsigned long slept;
 	igt_spin_t *spin;
 	int fd, sysfs;
 
@@ -1200,11 +1201,11 @@ test_frequency(int gem_fd)
 
 	gem_quiescent_gpu(gem_fd); /* Idle to be sure the change takes effect */
 	spin = igt_spin_batch_new(gem_fd, 0, I915_EXEC_RENDER, 0);
-	pmu_read_multi(fd, 2, start);
 
-	slept = measured_usleep(batch_duration_ns / 1000);
+	slept = pmu_read_multi(fd, 2, start);
+	measured_usleep(batch_duration_ns / 1000);
+	slept = pmu_read_multi(fd, 2, val) - slept;
 
-	pmu_read_multi(fd, 2, val);
 	min[0] = 1e9*(val[0] - start[0]) / slept;
 	min[1] = 1e9*(val[1] - start[1]) / slept;
 
@@ -1226,11 +1227,11 @@ test_frequency(int gem_fd)
 
 	gem_quiescent_gpu(gem_fd);
 	spin = igt_spin_batch_new(gem_fd, 0, I915_EXEC_RENDER, 0);
-	pmu_read_multi(fd, 2, start);
 
-	slept = measured_usleep(batch_duration_ns / 1000);
+	slept = pmu_read_multi(fd, 2, start);
+	measured_usleep(batch_duration_ns / 1000);
+	slept = pmu_read_multi(fd, 2, val) - slept;
 
-	pmu_read_multi(fd, 2, val);
 	max[0] = 1e9*(val[0] - start[0]) / slept;
 	max[1] = 1e9*(val[1] - start[1]) / slept;
 
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH i-g-t] tests/perf_pmu: Use perf timestamps when calculating average frequency
  2018-02-07 12:24 [PATCH i-g-t] tests/perf_pmu: Use perf timestamps when calculating average frequency Tvrtko Ursulin
@ 2018-02-07 12:34 ` Chris Wilson
  2018-02-07 12:54   ` Tvrtko Ursulin
  2018-02-07 14:36 ` ✓ Fi.CI.BAT: success for " Patchwork
  2018-02-07 18:32 ` ✗ Fi.CI.IGT: warning " Patchwork
  2 siblings, 1 reply; 6+ messages in thread
From: Chris Wilson @ 2018-02-07 12:34 UTC (permalink / raw)
  To: Tvrtko Ursulin, Intel-gfx

Quoting Tvrtko Ursulin (2018-02-07 12:24:24)
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> We can use perf reported timestamps to potentially get a more accurate
> frequency average.
> 
> Lets see if this improves the situation for sporadic failures like on APL:
> 
>  Frequency: min=100, max=750, boost=750 MHz
>  Min frequency: requested 90.0, actual 90.0
>  Max frequency: requested 749.8, actual 647.9
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Even if it doesn't using the embedded timestamp makes a lot more sense,
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH i-g-t] tests/perf_pmu: Use perf timestamps when calculating average frequency
  2018-02-07 12:34 ` Chris Wilson
@ 2018-02-07 12:54   ` Tvrtko Ursulin
  2018-02-07 13:04     ` Chris Wilson
  0 siblings, 1 reply; 6+ messages in thread
From: Tvrtko Ursulin @ 2018-02-07 12:54 UTC (permalink / raw)
  To: Chris Wilson, Tvrtko Ursulin, Intel-gfx


On 07/02/2018 12:34, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2018-02-07 12:24:24)
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> We can use perf reported timestamps to potentially get a more accurate
>> frequency average.
>>
>> Lets see if this improves the situation for sporadic failures like on APL:
>>
>>   Frequency: min=100, max=750, boost=750 MHz
>>   Min frequency: requested 90.0, actual 90.0
>>   Max frequency: requested 749.8, actual 647.9
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Even if it doesn't using the embedded timestamp makes a lot more sense,
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

Thanks.

It will definitely not fix everything. For instance I think that on one 
SKL GT2 I see max frequency being reported as 1000 MHz while in 
actuality it can only reach 950 Mhz. What to do one machine like that 
one is the question.

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH i-g-t] tests/perf_pmu: Use perf timestamps when calculating average frequency
  2018-02-07 12:54   ` Tvrtko Ursulin
@ 2018-02-07 13:04     ` Chris Wilson
  0 siblings, 0 replies; 6+ messages in thread
From: Chris Wilson @ 2018-02-07 13:04 UTC (permalink / raw)
  To: Tvrtko Ursulin, Tvrtko Ursulin, Intel-gfx

Quoting Tvrtko Ursulin (2018-02-07 12:54:47)
> 
> On 07/02/2018 12:34, Chris Wilson wrote:
> > Quoting Tvrtko Ursulin (2018-02-07 12:24:24)
> >> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> >>
> >> We can use perf reported timestamps to potentially get a more accurate
> >> frequency average.
> >>
> >> Lets see if this improves the situation for sporadic failures like on APL:
> >>
> >>   Frequency: min=100, max=750, boost=750 MHz
> >>   Min frequency: requested 90.0, actual 90.0
> >>   Max frequency: requested 749.8, actual 647.9
> >>
> >> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > 
> > Even if it doesn't using the embedded timestamp makes a lot more sense,
> > Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> 
> Thanks.
> 
> It will definitely not fix everything. For instance I think that on one 
> SKL GT2 I see max frequency being reported as 1000 MHz while in 
> actuality it can only reach 950 Mhz. What to do one machine like that 
> one is the question.

The lies the CPU tells. We will have to assume that it isn't clamped by
more than a bin or so, and may be just assert a one-sided tolerance
i.e. can't be greater than max, but is allowed ~100MHz less?
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.BAT: success for tests/perf_pmu: Use perf timestamps when calculating average frequency
  2018-02-07 12:24 [PATCH i-g-t] tests/perf_pmu: Use perf timestamps when calculating average frequency Tvrtko Ursulin
  2018-02-07 12:34 ` Chris Wilson
@ 2018-02-07 14:36 ` Patchwork
  2018-02-07 18:32 ` ✗ Fi.CI.IGT: warning " Patchwork
  2 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-02-07 14:36 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: intel-gfx

== Series Details ==

Series: tests/perf_pmu: Use perf timestamps when calculating average frequency
URL   : https://patchwork.freedesktop.org/series/37812/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
2baf7ece5b6d2faccedc56527ec91623f41a85e4 lib: Move __gem_context_create to common ioctl wrapper library.

with latest DRM-Tip kernel build CI_DRM_3735
94ca1ebb0652 drm-tip: 2018y-02m-07d-13h-38m-30s UTC integration manifest

No testlist changes.

Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                pass       -> INCOMPLETE (fi-snb-2520m) fdo#103713

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:420s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:427s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:377s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:498s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:288s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:482s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:488s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:460s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:572s
fi-cnl-y3        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:578s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:417s
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:286s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:513s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:391s
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:460s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:417s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:454s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:498s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:453s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:500s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:597s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:430s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:509s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:527s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:487s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:497s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:419s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:429s
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-glk-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:469s

== Logs ==

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

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

* ✗ Fi.CI.IGT: warning for tests/perf_pmu: Use perf timestamps when calculating average frequency
  2018-02-07 12:24 [PATCH i-g-t] tests/perf_pmu: Use perf timestamps when calculating average frequency Tvrtko Ursulin
  2018-02-07 12:34 ` Chris Wilson
  2018-02-07 14:36 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2018-02-07 18:32 ` Patchwork
  2 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-02-07 18:32 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: intel-gfx

== Series Details ==

Series: tests/perf_pmu: Use perf timestamps when calculating average frequency
URL   : https://patchwork.freedesktop.org/series/37812/
State : warning

== Summary ==

Test kms_flip:
        Subgroup flip-vs-blocking-wf-vblank:
                fail       -> PASS       (shard-apl) fdo#100368
        Subgroup flip-vs-modeset-vs-hang-interruptible:
                pass       -> DMESG-WARN (shard-snb) fdo#104311
        Subgroup modeset-vs-vblank-race-interruptible:
                fail       -> PASS       (shard-hsw) fdo#103060
        Subgroup 2x-flip-vs-expired-vblank:
                fail       -> PASS       (shard-hsw) fdo#102887
Test kms_vblank:
        Subgroup pipe-b-ts-continuation-suspend:
                pass       -> SKIP       (shard-snb)
Test kms_cursor_crc:
        Subgroup cursor-128x128-suspend:
                skip       -> PASS       (shard-snb) fdo#103880
Test perf:
        Subgroup buffer-fill:
                fail       -> PASS       (shard-apl) fdo#103755
        Subgroup enable-disable:
                fail       -> PASS       (shard-apl) fdo#103715
Test kms_sysfs_edid_timing:
                pass       -> WARN       (shard-apl) fdo#100047

fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#104311 https://bugs.freedesktop.org/show_bug.cgi?id=104311
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#103880 https://bugs.freedesktop.org/show_bug.cgi?id=103880
fdo#103755 https://bugs.freedesktop.org/show_bug.cgi?id=103755
fdo#103715 https://bugs.freedesktop.org/show_bug.cgi?id=103715
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047

shard-apl        total:3437 pass:1780 dwarn:1   dfail:0   fail:20  skip:1634 time:12568s
shard-hsw        total:3442 pass:1759 dwarn:1   dfail:0   fail:10  skip:1671 time:11752s
shard-snb        total:3442 pass:1348 dwarn:3   dfail:0   fail:10  skip:2081 time:6655s

== Logs ==

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

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

end of thread, other threads:[~2018-02-07 18:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-07 12:24 [PATCH i-g-t] tests/perf_pmu: Use perf timestamps when calculating average frequency Tvrtko Ursulin
2018-02-07 12:34 ` Chris Wilson
2018-02-07 12:54   ` Tvrtko Ursulin
2018-02-07 13:04     ` Chris Wilson
2018-02-07 14:36 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-02-07 18:32 ` ✗ Fi.CI.IGT: warning " 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.