Skip to contentSkip to conversation

tools/intel_gpu_top: Restore user friendly error message

PATCH In review Tvrtko Ursulin 3 participants 5 messages Sep 29, 2023 – Oct 2, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/intel_gpu_top: Restore user friendly error message

From: Tvrtko Ursulin <[email protected]>

We have a nice error message displayed when an user with insufficient permissions tries to run the tool, but that got lost while Meteorlake support was added. Bring it back in.

v2:
* Propagate unexpected errno on multi-tile systems too. (Umesh)

Cc Umesh Nerlige Ramappa <[email protected]>
---
 tools/intel_gpu_top.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
tools/intel_gpu_top.c +5 -3
index 87e9681e53b4..10601e66b18e 100644
@@ -554,9 +554,9 @@ static int get_num_gts(uint64_t type)
 
 		close(fd);
 	}
-	assert(!errno || errno == ENOENT);
-	assert(cnt > 0);
-	errno = 0;
+
+	if (!cnt || (errno && errno != ENOENT))
+		cnt = -errno;
 
 	return cnt;
 }
@@ -590,6 +590,8 @@ static int pmu_init(struct engines *engines)
 	engines->fd = -1;
 	engines->num_counters = 0;
 	engines->num_gts = get_num_gts(type);
+	if (engines->num_gts <= 0)
+		return -1;
 
 	engines->irq.config = I915_PMU_INTERRUPTS;
 	fd = _open_pmu(type, engines->num_counters, &engines->irq, engines->fd);
Signature · 1 line
2.39.2
#1 lore raw

[igt-dev] ✓ CI.xeBAT: success for tools/intel_gpu_top: Restore user friendly error message

== Series Details ==

== Series Details ==

Series: tools/intel_gpu_top: Restore user friendly error message
URL : https://patchwork.freedesktop.org/series/124448/
State : success

== Summary ==

CI Bug Log - changes from XEIGT_7506_BAT -> XEIGTPW_9895_BAT
====================================================

Summary
-------

**SUCCESS**

No regressions found.

Participating hosts (3 -> 4)
------------------------------

Additional (1): bat-pvc-2

Known issues
------------

Here are the changes found in XEIGTPW_9895_BAT that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@kms_addfb_basic@addfb25-x-tiled-legacy:
- bat-pvc-2: NOTRUN -> [SKIP][1] ([Intel XE#538]) +33 other tests skip
[1]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9895/bat-pvc-2/igt@[email protected]

* igt@kms_cursor_legacy@basic-flip-after-cursor-atomic:
- bat-pvc-2: NOTRUN -> [SKIP][2] ([Intel XE#539]) +7 other tests skip
[2]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9895/bat-pvc-2/igt@[email protected]

* igt@kms_flip@basic-flip-vs-wf_vblank:
- bat-pvc-2: NOTRUN -> [SKIP][3] ([Intel XE#275] / [Intel XE#541]) +3 other tests skip
[3]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9895/bat-pvc-2/igt@kms_flip@basic-flip-vs-wf_vblank.html

* igt@kms_force_connector_basic@force-connector-state:
- bat-pvc-2: NOTRUN -> [SKIP][4] ([Intel XE#540]) +3 other tests skip
[4]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9895/bat-pvc-2/igt@[email protected]

* igt@kms_pipe_crc_basic@nonblocking-crc:
- bat-pvc-2: NOTRUN -> [SKIP][5] ([Intel XE#537]) +6 other tests skip
[5]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9895/bat-pvc-2/igt@[email protected]

* igt@kms_prop_blob@basic:
- bat-pvc-2: NOTRUN -> [SKIP][6] ([Intel XE#536])
[6]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9895/bat-pvc-2/igt@[email protected]

* igt@kms_psr@primary_page_flip:
- bat-pvc-2: NOTRUN -> [SKIP][7] ([Intel XE#535]) +2 other tests skip
[7]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9895/bat-pvc-2/igt@kms_psr@primary_page_flip.html

* igt@xe_evict@evict-beng-small-external:
- bat-pvc-2: NOTRUN -> [FAIL][8] ([Intel XE#389]) +3 other tests fail
[8]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9895/bat-pvc-2/igt@[email protected]

* igt@xe_evict@evict-small-external-cm:
- bat-pvc-2: NOTRUN -> [DMESG-FAIL][9] ([Intel XE#482]) +3 other tests dmesg-fail
[9]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9895/bat-pvc-2/igt@[email protected]

* igt@xe_exec_reset@virtual-close-fd-no-exec:
- bat-pvc-2: NOTRUN -> [DMESG-WARN][10] ([Intel XE#696])
[10]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9895/bat-pvc-2/igt@[email protected]

* igt@xe_guc_pc@freq_fixed_idle:
- bat-pvc-2: NOTRUN -> [SKIP][11] ([Intel XE#533]) +1 other test skip
[11]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9895/bat-pvc-2/igt@xe_guc_pc@freq_fixed_idle.html

* igt@xe_huc_copy@huc_copy:
- bat-pvc-2: NOTRUN -> [SKIP][12] ([Intel XE#255])
[12]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9895/bat-pvc-2/igt@xe_huc_copy@huc_copy.html

* igt@xe_intel_bb@render:
- bat-pvc-2: NOTRUN -> [SKIP][13] ([Intel XE#532])
[13]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9895/bat-pvc-2/igt@[email protected]

* igt@xe_module_load@load:
- bat-pvc-2: NOTRUN -> [SKIP][14] ([Intel XE#378])
[14]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9895/bat-pvc-2/igt@[email protected]

* igt@xe_pm_residency@gt-c6-on-idle:
- bat-pvc-2: NOTRUN -> [SKIP][15] ([Intel XE#531])
[15]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9895/bat-pvc-2/igt@[email protected]

#### Possible fixes ####

* igt@kms_flip@basic-flip-vs-wf_vblank@b-edp1:
- bat-adlp-7: [FAIL][16] ([Intel XE#480]) -> [PASS][17] +1 other test pass
[16]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_7506/bat-adlp-7/igt@kms_flip@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9895/bat-adlp-7/igt@kms_flip@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[Intel XE#255]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/255
[Intel XE#275]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/275
[Intel XE#378]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/378
[Intel XE#389]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/389
[Intel XE#480]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/480
[Intel XE#482]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/482
[Intel XE#524]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/524
[Intel XE#531]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/531
[Intel XE#532]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/532
[Intel XE#533]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/533
[Intel XE#535]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/535
[Intel XE#536]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/536
[Intel XE#537]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/537
[Intel XE#538]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/538
[Intel XE#539]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/539
[Intel XE#540]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/540
[Intel XE#541]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/541
[Intel XE#696]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/696

Build changes
-------------

* IGT: IGT_7506 -> IGTPW_9895
* Linux: xe-397-bce60b0ff2937cb2ea51841a479bc1a2da65052b -> xe-402-9a795b4f0ebe6bf70b1c873e323c3e0e7e113c64

IGTPW_9895: 9895
IGT_7506: 4fdf544bd0a38c5a100ef43c30171827e1c8c442 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
xe-397-bce60b0ff2937cb2ea51841a479bc1a2da65052b: bce60b0ff2937cb2ea51841a479bc1a2da65052b xe-402-9a795b4f0ebe6bf70b1c873e323c3e0e7e113c64: 9a795b4f0ebe6bf70b1c873e323c3e0e7e113c64

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9895/index.html

#2 lore raw

[igt-dev] ✗ Fi.CI.BAT: failure for tools/intel_gpu_top: Restore user friendly error message

In reply to Tvrtko Ursulin
== Series Details ==

== Series Details ==

Series: tools/intel_gpu_top: Restore user friendly error message
URL : https://patchwork.freedesktop.org/series/124448/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_13693 -> IGTPW_9895
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with IGTPW_9895 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in IGTPW_9895, please notify your bug team ([email protected]) to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9895/index.html

Participating hosts (38 -> 37)
------------------------------

Missing (1): fi-snb-2520m

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in IGTPW_9895:

### IGT changes ###

#### Possible regressions ####

* igt@i915_selftest@live@workarounds:
- bat-rpls-1: [PASS][1] -> [DMESG-WARN][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13693/bat-rpls-1/igt@i915_selftest@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9895/bat-rpls-1/igt@i915_selftest@[email protected]

Known issues
------------

Here are the changes found in IGTPW_9895 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@kms_addfb_basic@addfb25-y-tiled-small-legacy:
- fi-hsw-4770: NOTRUN -> [SKIP][3] ([fdo#109271]) +13 other tests skip
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9895/fi-hsw-4770/igt@[email protected]

* igt@kms_flip@basic-plain-flip@a-dp5:
- bat-adlp-11: [PASS][4] -> [DMESG-WARN][5] ([i915#6868])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13693/bat-adlp-11/igt@kms_flip@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9895/bat-adlp-11/igt@kms_flip@[email protected]

* igt@kms_flip@basic-plain-flip@b-dp6:
- bat-adlp-11: [PASS][6] -> [FAIL][7] ([i915#6121]) +6 other tests fail
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13693/bat-adlp-11/igt@kms_flip@[email protected]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9895/bat-adlp-11/igt@kms_flip@[email protected]

* igt@kms_frontbuffer_tracking@basic:
- fi-bsw-nick: [PASS][8] -> [FAIL][9] ([i915#9276])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13693/fi-bsw-nick/igt@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9895/fi-bsw-nick/igt@[email protected]

* igt@kms_pipe_crc_basic@hang-read-crc@pipe-d-dp-5:
- bat-adlp-11: [PASS][10] -> [DMESG-FAIL][11] ([i915#6868])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13693/bat-adlp-11/igt@kms_pipe_crc_basic@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9895/bat-adlp-11/igt@kms_pipe_crc_basic@[email protected]

* igt@kms_pipe_crc_basic@read-crc@pipe-d-dp-5:
- bat-adlp-11: NOTRUN -> [ABORT][12] ([i915#8668])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9895/bat-adlp-11/igt@kms_pipe_crc_basic@[email protected]

* igt@kms_pipe_crc_basic@suspend-read-crc@pipe-c-vga-1:
- fi-hsw-4770: NOTRUN -> [DMESG-WARN][13] ([i915#8841]) +6 other tests dmesg-warn
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9895/fi-hsw-4770/igt@kms_pipe_crc_basic@[email protected]

* igt@kms_psr@sprite_plane_onoff:
- fi-hsw-4770: NOTRUN -> [SKIP][14] ([fdo#109271] / [i915#1072]) +3 other tests skip
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9895/fi-hsw-4770/igt@kms_psr@sprite_plane_onoff.html

#### Possible fixes ####

* igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence@pipe-a-dp-5:
- bat-adlp-11: [DMESG-FAIL][15] ([i915#6868]) -> [PASS][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13693/bat-adlp-11/igt@kms_pipe_crc_basic@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9895/bat-adlp-11/igt@kms_pipe_crc_basic@[email protected]

* igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence@pipe-c-dp-5:
- bat-adlp-11: [FAIL][17] ([i915#9047]) -> [PASS][18] +2 other tests pass
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13693/bat-adlp-11/igt@kms_pipe_crc_basic@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9895/bat-adlp-11/igt@kms_pipe_crc_basic@[email protected]

#### Warnings ####

* igt@kms_force_connector_basic@force-edid:
- bat-adlp-11: [SKIP][19] ([i915#4093]) -> [FAIL][20] ([i915#8803])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13693/bat-adlp-11/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9895/bat-adlp-11/igt@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#4093]: https://gitlab.freedesktop.org/drm/intel/issues/4093
[i915#6121]: https://gitlab.freedesktop.org/drm/intel/issues/6121
[i915#6868]: https://gitlab.freedesktop.org/drm/intel/issues/6868
[i915#8668]: https://gitlab.freedesktop.org/drm/intel/issues/8668
[i915#8803]: https://gitlab.freedesktop.org/drm/intel/issues/8803
[i915#8841]: https://gitlab.freedesktop.org/drm/intel/issues/8841
[i915#9047]: https://gitlab.freedesktop.org/drm/intel/issues/9047
[i915#9276]: https://gitlab.freedesktop.org/drm/intel/issues/9276

Build changes
-------------

* CI: CI-20190529 -> None
* IGT: IGT_7506 -> IGTPW_9895

CI-20190529: 20190529
CI_DRM_13693: bb46e837b7e59c22a567ae6913ff4d6bf0e9211a @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_9895: 9895
IGT_7506: 4fdf544bd0a38c5a100ef43c30171827e1c8c442 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git

Testlist changes
----------------

-igt@xe_pm@d3-mmap-system
-igt@xe_pm@d3-mmap-vram

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9895/index.html

Reviewed-by on v1 1/1
#3 lore raw
In reply to Tvrtko Ursulin
Quoted 20 lines · Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

We have a nice error message displayed when an user with insufficient permissions tries to run the tool, but that got lost while Meteorlake support was added. Bring it back in.

v2:
* Propagate unexpected errno on multi-tile systems too. (Umesh)

Cc Umesh Nerlige Ramappa <[email protected]>

---
tools/intel_gpu_top.c | 8 +++++---

1 file changed, 5 insertions(+), 3 deletions(-)
tools/intel_gpu_top.c +0 -0
index 87e9681e53b4..10601e66b18e 100644

tools/intel_gpu_top.c static int get_num_gts(uint64_t type) · line 559

Quoted 9 lines
tools/intel_gpu_top.c +3 -3
@@ -554,9 +554,9 @@ static int get_num_gts(uint64_t type)
 
 		close(fd);
 	}
-	assert(!errno || errno == ENOENT);
-	assert(cnt > 0);
-	errno = 0;
+
+	if (!cnt || (errno && errno != ENOENT))
+		cnt = -errno;

Thanks,
Umesh

Quoted 15 lines
tools/intel_gpu_top.c +2 -0
 	return cnt;
 }
@@ -590,6 +590,8 @@ static int pmu_init(struct engines *engines)
 	engines->fd = -1;
 	engines->num_counters = 0;
 	engines->num_gts = get_num_gts(type);
+	if (engines->num_gts <= 0)
+		return -1;
 
 	engines->irq.config = I915_PMU_INTERRUPTS;
 	fd = _open_pmu(type, engines->num_counters, &engines->irq, engines->fd);
Signature · 1 line
2.39.2
#4 lore raw
Quoted 22 lines · Umesh Nerlige Ramappa
Quoted 21 lines · Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

We have a nice error message displayed when an user with insufficient permissions tries to run the tool, but that got lost while Meteorlake support was added. Bring it back in.

v2:
* Propagate unexpected errno on multi-tile systems too. (Umesh)

Cc Umesh Nerlige Ramappa <[email protected]>

---
tools/intel_gpu_top.c | 8 +++++---

1 file changed, 5 insertions(+), 3 deletions(-)
tools/intel_gpu_top.c +0 -0
index 87e9681e53b4..10601e66b18e 100644
@@ -554,9 +554,9 @@ static int get_num_gts(uint64_t type)
 
Quoted 10 lines

tools/intel_gpu_top.c static int get_num_gts(uint64_t type) · line 559

Quoted 8 lines
tools/intel_gpu_top.c +3 -3
         close(fd);
     }
-    assert(!errno || errno == ENOENT);
-    assert(cnt > 0);
-    errno = 0;
+
+    if (!cnt || (errno && errno != ENOENT))
+        cnt = -errno;

Pushed, thanks!

Regards,

Tvrtko