tests/gem_reset_stats: Fix retrieval of hangcheck stats expectation
PATCH v2 1/1 tests/gem_reset_stats: Fix retrieval of hangcheck stats expectation
The test expected IOCTL 'I915_GET_RESET_STATS' would return an error when not root. That is no longer true in the driver since commit 4c9c0d09741d ("drm/i915: Fix retrieval of hangcheck stats") and therefore the test was incorrectly failing.
v2:
- Add the commit that changed the behaviour in the Driver to the commit message (Michel)
--- tests/gem_reset_stats.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-)
tests/gem_reset_stats.c +17 -8
@@ -605,10 +605,7 @@ static void test_reset_count(const struct intel_execution_engine *e, c2 =get_reset_count (fd, ctx); -if (ctx ==0 ) -igt_assert (c2 == -EPERM ); -else -igt_assert (c2 ==0 ); +igt_assert (c2 ==0 ); }igt_waitchildren ();
@@ -619,6 +616,11 @@ static void test_reset_count(const struct intel_execution_engine *e,close (fd); } +static int __get_reset_stats (int fd,struct local_drm_i915_reset_stats *rs) +{ +return drmIoctl (fd,GET_RESET_STATS_IOCTL , &rs); +} +static int _test_params (int fd,int ctx,uint32_t flags,uint32_t pad) {struct local_drm_i915_reset_stats rs;
@@ -644,10 +646,17 @@ static void _check_param_ctx(const int fd, const int ctx, const cap_t cap)const uint32_t bad =rand () +1 ;if (ctx ==0 ) { -if (cap == root) -igt_assert_eq (_test_params (fd, ctx,0 ,0 ),0 ); -else -igt_assert_eq (_test_params (fd, ctx,0 ,0 ), -EPERM ); +igt_assert_eq (_test_params (fd, ctx,0 ,0 ),0 ); + +if (cap != root) { +struct local_drm_i915_reset_stats rs; + rs.ctx_id = ctx; + rs.reset_count =rand (); + rs.batch_active =rand (); + rs.batch_pending =rand (); +igt_assert (__get_reset_stats (fd, &rs)); +igt_assert (rs.reset_count !=0 ); + } }igt_assert_eq (_test_params (fd, ctx,0 , bad), -EINVAL );
Signature · 6 lines
2.14.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for tests/gem_reset_stats: Fix retrieval of hangcheck stats expectation (rev2)
== Series Details ==
== Series Details ==
Series: tests/gem_reset_stats: Fix retrieval of hangcheck stats expectation (rev2)
URL : https://patchwork.freedesktop.org/series/35101/
State : success
== Summary ==
IGT patchset tested on top of latest successful build ea7015f1fabbdfdd52a145162c658d2e90161ec5 lib/core: Don't leak dummyloads between subtests
with latest DRM-Tip kernel build CI_DRM_3512ad17a7aa7ae2 drm-tip: 2017y-12m-13d-21h-59m-15s UTC integration manifest
No testlist changes.
Test gem_mmap_gtt:
Subgroup basic-small-bo-tiledx:
fail -> PASS (fi-gdg-551) fdo#102575
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-a:
pass -> DMESG-WARN (fi-kbl-r) fdo#104172 +1fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#104172 https://bugs.freedesktop.org/show_bug.cgi?id=104172
fi-bdw-5557u total:288 pass:267 dwarn:0 dfail:0 fail:0 skip:21 time:445s fi-bdw-gvtdvm total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:438s fi-blb-e6850 total:288 pass:223 dwarn:1 dfail:0 fail:0 skip:64 time:386s fi-bsw-n3050 total:288 pass:242 dwarn:0 dfail:0 fail:0 skip:46 time:512s fi-bwr-2160 total:288 pass:183 dwarn:0 dfail:0 fail:0 skip:105 time:280s fi-bxt-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:503s fi-bxt-j4205 total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:509s fi-byt-j1900 total:288 pass:253 dwarn:0 dfail:0 fail:0 skip:35 time:488s fi-byt-n2820 total:288 pass:249 dwarn:0 dfail:0 fail:0 skip:39 time:475s fi-elk-e7500 total:224 pass:163 dwarn:15 dfail:0 fail:0 skip:45 fi-gdg-551 total:288 pass:179 dwarn:1 dfail:0 fail:0 skip:108 time:268s fi-glk-1 total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:540s fi-hsw-4770 total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:405s fi-hsw-4770r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:416s fi-ilk-650 total:288 pass:228 dwarn:0 dfail:0 fail:0 skip:60 time:395s fi-ivb-3520m total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:481s fi-ivb-3770 total:288 pass:255 dwarn:0 dfail:0 fail:0 skip:33 time:430s fi-kbl-7500u total:288 pass:263 dwarn:1 dfail:0 fail:0 skip:24 time:483s fi-kbl-7560u total:288 pass:269 dwarn:0 dfail:0 fail:0 skip:19 time:527s fi-kbl-7567u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:475s fi-kbl-r total:288 pass:260 dwarn:1 dfail:0 fail:0 skip:27 time:536s fi-pnv-d510 total:288 pass:222 dwarn:1 dfail:0 fail:0 skip:65 time:592s fi-skl-6260u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:450s fi-skl-6600u total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:539s fi-skl-6700hq total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:569s fi-skl-6770hq total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:492s fi-skl-gvtdvm total:288 pass:265 dwarn:0 dfail:0 fail:0 skip:23 time:452s fi-snb-2520m total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:554s fi-snb-2600 total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:416s Blacklisted hosts: fi-cfl-s2 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:601s fi-cnl-y total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:628s fi-glk-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:488s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_667/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.IGT: warning for tests/gem_reset_stats: Fix retrieval of hangcheck stats expectation (rev2)
In reply to Antonio Argenziano== Series Details ==
== Series Details ==
Series: tests/gem_reset_stats: Fix retrieval of hangcheck stats expectation (rev2)
URL : https://patchwork.freedesktop.org/series/35101/
State : warning
== Summary ==
Test kms_draw_crc:
Subgroup draw-method-rgb565-mmap-wc-untiled:
skip -> PASS (shard-snb)
Test kms_frontbuffer_tracking:
Subgroup fbc-1p-offscren-pri-shrfb-draw-render:
fail -> PASS (shard-snb) fdo#101623
Test kms_cursor_legacy:
Subgroup flip-vs-cursor-busy-crc-atomic:
skip -> PASS (shard-hsw)
Subgroup flip-vs-cursor-varying-size:
skip -> PASS (shard-hsw) fdo#102670
Test pm_rc6_residency:
Subgroup rc6-accuracy:
pass -> SKIP (shard-snb)fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#102670 https://bugs.freedesktop.org/show_bug.cgi?id=102670
shard-hsw total:2712 pass:1537 dwarn:1 dfail:0 fail:10 skip:1164 time:9538s shard-snb total:2712 pass:1309 dwarn:1 dfail:0 fail:11 skip:1391 time:8107s Blacklisted hosts: shard-apl total:2694 pass:1668 dwarn:1 dfail:0 fail:22 skip:1001 time:13518s shard-kbl total:2712 pass:1774 dwarn:32 dfail:0 fail:25 skip:881 time:11285s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_667/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 5 lines · Antonio Argenziano
The test expected IOCTL '
I915_GET_RESET_STATS' would return an error when not root. That is no longer true in the driver since commit4c9c0d09741d("drm/i915: Fix retrieval of hangcheck stats") and therefore the test was incorrectly failing.
Quoted 8 lines
v2:
- Add the commit that changed the behaviour in the Driver to the commit message (Michel)Cc Michel Thierry <[email protected]>Cc Arkadiusz Hiler <[email protected]>Cc Chris Wilson <[email protected]>Signed-off-by Antonio Argenziano <[email protected]>
Ping.
Quoted 45 lines
--- tests/gem_reset_stats.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-)tests/gem_reset_stats.c +10
-8@@ -605,10 +605,7 @@ static void test_reset_count(const struct intel_execution_engine *e, c2 =get_reset_count (fd, ctx); -if (ctx ==0 ) -igt_assert (c2 == -EPERM ); -else -igt_assert (c2 ==0 ); +igt_assert (c2 ==0 ); }igt_waitchildren ();@@ -619,6 +616,11 @@ static void test_reset_count(const struct intel_execution_engine *e,close (fd); } +static int __get_reset_stats (int fd,struct local_drm_i915_reset_stats *rs) +{ +return drmIoctl (fd,GET_RESET_STATS_IOCTL , &rs); +} +static int _test_params (int fd,int ctx,uint32_t flags,uint32_t pad) {struct local_drm_i915_reset_stats rs;@@ -644,10 +646,17 @@ static void _check_param_ctx(const int fd, const int ctx, const cap_t cap)const uint32_t bad =rand () +1 ;if (ctx ==0 ) { -if (cap == root) -igt_assert_eq (_test_params (fd, ctx,0 ,0 ),0 ); -else -igt_assert_eq (_test_params (fd, ctx,0 ,0 ), -EPERM ); +igt_assert_eq (_test_params (fd, ctx,0 ,0 ),0 ); + +if (cap != root) { +struct local_drm_i915_reset_stats rs;
tests/gem_reset_stats.c static void _check_param_ctx(const int fd, const int ctx, const cap_t cap) · line 662
Quoted 10 lines
tests/gem_reset_stats.c +7
-0+ rs.ctx_id = ctx; + rs.reset_count =rand (); + rs.batch_active =rand (); + rs.batch_pending =rand (); +igt_assert (__get_reset_stats (fd, &rs)); +igt_assert (rs.reset_count !=0 ); + } }igt_assert_eq (_test_params (fd, ctx,0 , bad), -EINVAL );
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 59 lines · Antonio Argenziano
Quoted 5 lines · Antonio Argenziano
The test expected IOCTL '
I915_GET_RESET_STATS' would return an error when not root. That is no longer true in the driver since commit4c9c0d09741d("drm/i915: Fix retrieval of hangcheck stats") and therefore the test was incorrectly failing.Quoted 8 lines
v2:
- Add the commit that changed the behaviour in the Driver to the commit message (Michel)Cc Michel Thierry <[email protected]>Cc Arkadiusz Hiler <[email protected]>Cc Chris Wilson <[email protected]>Signed-off-by Antonio Argenziano <[email protected]>Ping.
Quoted 42 lines
---
tests/gem_reset_stats.c| 25 +++++++++++++++++--------1 file changed, 17 insertions(+), 8 deletions(-)tests/gem_reset_stats.c +6
-4@@ -605,10 +605,7 @@ static void test_reset_count(const structintel_execution_engine *e, c2 = get_reset_count(fd, ctx); - if (ctx == 0) - igt_assert(c2 == -EPERM); - else - igt_assert(c2 == 0); + igt_assert(c2 == 0); } igt_waitchildren();@@ -619,6 +616,11 @@ static void test_reset_count(const structintel_execution_engine *e, close(fd); } +static int __get_reset_stats (int fd,struct local_drm_i915_reset_stats *rs) +{ + return drmIoctl(fd, GET_RESET_STATS_IOCTL, &rs); +} + static int _test_params(int fd, int ctx, uint32_t flags, uint32_t pad) {struct
local_drm_i915_reset_statsrs;tests/gem_reset_stats.c +3
-4@@ -644,10 +646,17 @@ static void _check_param_ctx(const int fd, const int ctx, const cap_t cap) const uint32_t bad = rand() + 1; if (ctx == 0) { - if (cap == root) - igt_assert_eq(_test_params(fd, ctx, 0, 0), 0); - else - igt_assert_eq(_test_params(fd, ctx, 0, 0), -EPERM); + igt_assert_eq(_test_params(fd, ctx, 0, 0), 0); + + if (cap != root) {
Quoted 8 lines
tests/gem_reset_stats.c static void _check_param_ctx(const int fd, const int ctx, const cap_t cap) · line 659
Quoted 8 lines
tests/gem_reset_stats.c +8
-0+ struct local_drm_i915_reset_stats rs; + rs.ctx_id = ctx; + rs.reset_count = rand(); + rs.batch_active = rand(); + rs.batch_pending = rand(); + igt_assert(__get_reset_stats(fd, &rs)); + igt_assert(rs.reset_count != 0); + }
Probably you only care about reset_count == 0, so I would just reuse existing code like this:
if (cap != root) igt_assert(get_reset_count(fd, cxt) == 0);
Quoted 3 lines
tests/gem_reset_stats.c static void _check_param_ctx(const int fd, const int ctx, const cap_t cap)
Quoted 3 lines
tests/gem_reset_stats.c +0
-0} igt_assert_eq(_test_params(fd, ctx, 0, bad), -EINVAL);
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx