* [igt-dev] [PATCH i-g-t 0/3] Assorted intel_gpu_top tweaks
@ 2023-03-28 12:54 Tvrtko Ursulin
2023-03-28 12:54 ` [igt-dev] [PATCH i-g-t 1/3] intel_gpu_top: Display large pids nicely in interactive mode Tvrtko Ursulin
` (5 more replies)
0 siblings, 6 replies; 11+ messages in thread
From: Tvrtko Ursulin @ 2023-03-28 12:54 UTC (permalink / raw)
To: igt-dev, Intel-gfx; +Cc: Tvrtko Ursulin
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Just some display formatting and display tweaks and fixes.
Tvrtko Ursulin (3):
intel_gpu_top: Display large pids nicely in interactive mode
intel_gpu_top: Use full console width for global metrics
intel_gpu_top: Show non-normalized client usage in numeric mode
tools/intel_gpu_top.c | 90 +++++++++++++++++++++++++++++++++----------
1 file changed, 70 insertions(+), 20 deletions(-)
--
2.37.2
^ permalink raw reply [flat|nested] 11+ messages in thread
* [igt-dev] [PATCH i-g-t 1/3] intel_gpu_top: Display large pids nicely in interactive mode
2023-03-28 12:54 [igt-dev] [PATCH i-g-t 0/3] Assorted intel_gpu_top tweaks Tvrtko Ursulin
@ 2023-03-28 12:54 ` Tvrtko Ursulin
2023-04-14 15:24 ` [igt-dev] [Intel-gfx] " Kamil Konieczny
2023-03-28 12:54 ` [igt-dev] [PATCH i-g-t 2/3] intel_gpu_top: Use full console width for global metrics Tvrtko Ursulin
` (4 subsequent siblings)
5 siblings, 1 reply; 11+ messages in thread
From: Tvrtko Ursulin @ 2023-03-28 12:54 UTC (permalink / raw)
To: igt-dev, Intel-gfx; +Cc: Tvrtko Ursulin
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
So far the width of the PID column was hardcoded to six characters which
is not enough on systems with high uptime, where PID numbers can grow
large, and results in broken line formatting.
Fix it by tracking the largest width for both the pid and name fields and
use them dynamically.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
tools/intel_gpu_top.c | 66 +++++++++++++++++++++++++++++++++++++------
1 file changed, 58 insertions(+), 8 deletions(-)
diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
index a4302aa389b4..39be916297e4 100644
--- a/tools/intel_gpu_top.c
+++ b/tools/intel_gpu_top.c
@@ -1,5 +1,5 @@
/*
- * Copyright © 2007-2021 Intel Corporation
+ * Copyright © 2007-2023 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -693,6 +693,7 @@ struct client {
enum client_status status;
unsigned int id;
unsigned int pid;
+ char pid_str[10];
char name[24];
char print_name[24];
unsigned int samples;
@@ -709,6 +710,9 @@ struct clients {
unsigned int num_classes;
struct engine_class *class;
+ int max_pid_len;
+ int max_name_len;
+
char pci_slot[64];
struct client *client;
@@ -758,9 +762,14 @@ update_client(struct client *c, unsigned int pid, char *name,
const struct drm_client_fdinfo *info)
{
unsigned int i;
+ int len;
- if (c->pid != pid)
+ if (c->pid != pid) {
c->pid = pid;
+ len = snprintf(c->pid_str, sizeof(c->pid_str) - 1, "%u", pid);
+ if (len > c->clients->max_pid_len)
+ c->clients->max_pid_len = len;
+ }
if (strcmp(c->name, name)) {
char *p;
@@ -774,6 +783,10 @@ update_client(struct client *c, unsigned int pid, char *name,
*p = '*';
p++;
}
+
+ len = strlen(c->print_name);
+ if (len > c->clients->max_name_len)
+ c->clients->max_name_len = len;
}
c->last_runtime = 0;
@@ -990,6 +1003,7 @@ static struct clients *display_clients(struct clients *clients)
ac->id = -c->pid;
ac->pid = c->pid;
strcpy(ac->name, c->name);
+ strcpy(ac->pid_str, c->pid_str);
strcpy(ac->print_name, c->print_name);
ac->val = calloc(clients->num_classes,
sizeof(ac->val[0]));
@@ -1013,6 +1027,9 @@ static struct clients *display_clients(struct clients *clients)
aggregated->num_clients = num;
aggregated->active_clients = num;
+ aggregated->max_pid_len = clients->max_pid_len;
+ aggregated->max_name_len = clients->max_name_len;
+
clients = aggregated;
out:
@@ -1104,9 +1121,34 @@ static size_t readat2buf(int at, const char *name, char *buf, const size_t sz)
}
}
+static void clients_update_max_lengths(struct clients *clients)
+{
+ struct client *c;
+ int tmp;
+
+ clients->max_name_len = 0;
+ clients->max_pid_len = 0;
+
+ for_each_client(clients, c, tmp) {
+ int len;
+
+ if (c->status != ALIVE)
+ continue; /* Array not yet sorted by the caller. */
+
+ len = strlen(c->print_name);
+ if (len > clients->max_name_len)
+ clients->max_name_len = len;
+
+ len = strlen(c->pid_str);
+ if (len > clients->max_pid_len)
+ clients->max_pid_len = len;
+ }
+}
+
static struct clients *scan_clients(struct clients *clients, bool display)
{
struct dirent *proc_dent;
+ bool freed = false;
struct client *c;
DIR *proc_dir;
int tmp;
@@ -1208,12 +1250,17 @@ next:
closedir(proc_dir);
for_each_client(clients, c, tmp) {
- if (c->status == PROBE)
+ if (c->status == PROBE) {
free_client(c);
- else if (c->status == FREE)
+ freed = true;
+ } else if (c->status == FREE) {
break;
+ }
}
+ if (freed)
+ clients_update_max_lengths(clients);
+
return display ? display_clients(clients) : clients;
}
@@ -2172,15 +2219,16 @@ print_clients_header(struct clients *clients, int lines,
int con_w, int con_h, int *class_w)
{
if (output_mode == INTERACTIVE) {
- const char *pidname = " PID NAME ";
unsigned int num_active = 0;
- int len = strlen(pidname);
+ int len;
if (lines++ >= con_h)
return lines;
printf("\033[7m");
- printf("%s", pidname);
+ len = printf("%*s %*s ",
+ clients->max_pid_len, "PID",
+ clients->max_name_len, "NAME");
if (lines++ >= con_h || len >= con_w)
return lines;
@@ -2241,7 +2289,9 @@ print_client(struct client *c, struct engines *engines, double t, int lines,
lines++;
- printf("%6u %17s ", c->pid, c->print_name);
+ printf("%*s %*s ",
+ clients->max_pid_len, c->pid_str,
+ clients->max_name_len, c->print_name);
for (i = 0; c->samples > 1 && i < clients->num_classes; i++) {
double pct;
--
2.37.2
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [igt-dev] [PATCH i-g-t 2/3] intel_gpu_top: Use full console width for global metrics
2023-03-28 12:54 [igt-dev] [PATCH i-g-t 0/3] Assorted intel_gpu_top tweaks Tvrtko Ursulin
2023-03-28 12:54 ` [igt-dev] [PATCH i-g-t 1/3] intel_gpu_top: Display large pids nicely in interactive mode Tvrtko Ursulin
@ 2023-03-28 12:54 ` Tvrtko Ursulin
2023-04-14 15:26 ` Kamil Konieczny
2023-03-28 12:54 ` [igt-dev] [PATCH i-g-t 3/3] intel_gpu_top: Show non-normalized client usage in numeric mode Tvrtko Ursulin
` (3 subsequent siblings)
5 siblings, 1 reply; 11+ messages in thread
From: Tvrtko Ursulin @ 2023-03-28 12:54 UTC (permalink / raw)
To: igt-dev, Intel-gfx; +Cc: Tvrtko Ursulin
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
It appears we had an off by one of a kind where we were not using the full
width of the terminal window for the global metrics section.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
tools/intel_gpu_top.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
index 39be916297e4..36da016c3df0 100644
--- a/tools/intel_gpu_top.c
+++ b/tools/intel_gpu_top.c
@@ -1960,8 +1960,7 @@ print_engines_header(struct engines *engines, double t,
a = " ENGINE BUSY ";
printf("\033[7m%s%*s%s\033[0m\n",
- a, (int)(con_w - 1 - strlen(a) - strlen(b)),
- " ", b);
+ a, (int)(con_w - strlen(a) - strlen(b)), " ", b);
lines++;
}
@@ -2000,7 +1999,6 @@ print_engine(struct engines *engines, unsigned int i, double t,
print_groups(groups);
if (output_mode == INTERACTIVE) {
- unsigned int max_w = con_w - 1;
unsigned int len;
char buf[128];
double val;
@@ -2012,7 +2010,7 @@ print_engine(struct engines *engines, unsigned int i, double t,
engine->display_name, engine_items[0].buf);
val = pmu_calc(&engine->busy.val, 1e9, t, 100);
- print_percentage_bar(val, max_w > len ? max_w - len : 0, false);
+ print_percentage_bar(val, con_w > len ? con_w - len : 0, false);
printf("%s\n", buf);
--
2.37.2
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [igt-dev] [PATCH i-g-t 3/3] intel_gpu_top: Show non-normalized client usage in numeric mode
2023-03-28 12:54 [igt-dev] [PATCH i-g-t 0/3] Assorted intel_gpu_top tweaks Tvrtko Ursulin
2023-03-28 12:54 ` [igt-dev] [PATCH i-g-t 1/3] intel_gpu_top: Display large pids nicely in interactive mode Tvrtko Ursulin
2023-03-28 12:54 ` [igt-dev] [PATCH i-g-t 2/3] intel_gpu_top: Use full console width for global metrics Tvrtko Ursulin
@ 2023-03-28 12:54 ` Tvrtko Ursulin
2023-04-14 15:28 ` [igt-dev] [Intel-gfx] " Kamil Konieczny
2023-03-28 14:45 ` [igt-dev] ✗ Fi.CI.BAT: failure for Assorted intel_gpu_top tweaks Patchwork
` (2 subsequent siblings)
5 siblings, 1 reply; 11+ messages in thread
From: Tvrtko Ursulin @ 2023-03-28 12:54 UTC (permalink / raw)
To: igt-dev, Intel-gfx; +Cc: Tvrtko Ursulin
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
When numeric display is selected in the interactive mode it is more
descriptive to show client's non-normalized (by number of engines per
class) usage. Rendering of the visual representation (bar) is kept the
same.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
tools/intel_gpu_top.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
index 36da016c3df0..b6827b3de9bd 100644
--- a/tools/intel_gpu_top.c
+++ b/tools/intel_gpu_top.c
@@ -1275,14 +1275,14 @@ static void n_spaces(const unsigned int n)
}
static void
-print_percentage_bar(double percent, int max_len, bool numeric)
+print_percentage_bar(double percent, double max, int max_len, bool numeric)
{
int bar_len, i, len = max_len - 2;
const int w = 8;
assert(max_len > 0);
- bar_len = ceil(w * percent * len / 100.0);
+ bar_len = ceil(w * percent * len / max);
if (bar_len > w * len)
bar_len = w * len;
@@ -2010,7 +2010,8 @@ print_engine(struct engines *engines, unsigned int i, double t,
engine->display_name, engine_items[0].buf);
val = pmu_calc(&engine->busy.val, 1e9, t, 100);
- print_percentage_bar(val, con_w > len ? con_w - len : 0, false);
+ print_percentage_bar(val, 100.0, con_w > len ? con_w - len : 0,
+ false);
printf("%s\n", buf);
@@ -2292,23 +2293,24 @@ print_client(struct client *c, struct engines *engines, double t, int lines,
clients->max_name_len, c->print_name);
for (i = 0; c->samples > 1 && i < clients->num_classes; i++) {
- double pct;
+ double pct, max;
if (!clients->class[i].num_engines)
continue; /* Assert in the ideal world. */
- pct = (double)c->val[i] / period_us / 1e3 * 100 /
- clients->class[i].num_engines;
+ pct = (double)c->val[i] / period_us / 1e3 * 100;
/*
* Guard against possible time-drift between sampling
* client data and time we obtained our time-delta from
* PMU.
*/
- if (pct > 100.0)
- pct = 100.0;
+ max = 100.0 * clients->class[i].num_engines;
+ if (pct > max)
+ pct = max;
- print_percentage_bar(pct, *class_w, numeric_clients);
+ print_percentage_bar(pct, max, *class_w,
+ numeric_clients);
}
putchar('\n');
--
2.37.2
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [igt-dev] ✗ Fi.CI.BAT: failure for Assorted intel_gpu_top tweaks
2023-03-28 12:54 [igt-dev] [PATCH i-g-t 0/3] Assorted intel_gpu_top tweaks Tvrtko Ursulin
` (2 preceding siblings ...)
2023-03-28 12:54 ` [igt-dev] [PATCH i-g-t 3/3] intel_gpu_top: Show non-normalized client usage in numeric mode Tvrtko Ursulin
@ 2023-03-28 14:45 ` Patchwork
2023-04-06 16:22 ` [igt-dev] ✓ Fi.CI.BAT: success for Assorted intel_gpu_top tweaks (rev2) Patchwork
2023-04-07 6:30 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
5 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2023-03-28 14:45 UTC (permalink / raw)
To: Tvrtko Ursulin; +Cc: igt-dev
[-- Attachment #1: Type: text/plain, Size: 4358 bytes --]
== Series Details ==
Series: Assorted intel_gpu_top tweaks
URL : https://patchwork.freedesktop.org/series/115725/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_12927 -> IGTPW_8702
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with IGTPW_8702 absolutely need to be
verified manually.
If you think the reported changes have nothing to do with the changes
introduced in IGTPW_8702, please notify your bug team 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_8702/index.html
Participating hosts (36 -> 36)
------------------------------
No changes in participating hosts
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in IGTPW_8702:
### IGT changes ###
#### Possible regressions ####
* igt@i915_selftest@live@gt_lrc:
- bat-adlp-9: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12927/bat-adlp-9/igt@i915_selftest@live@gt_lrc.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8702/bat-adlp-9/igt@i915_selftest@live@gt_lrc.html
Known issues
------------
Here are the changes found in IGTPW_8702 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_selftest@live@gt_mocs:
- bat-rpls-1: [PASS][3] -> [DMESG-FAIL][4] ([i915#7059])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12927/bat-rpls-1/igt@i915_selftest@live@gt_mocs.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8702/bat-rpls-1/igt@i915_selftest@live@gt_mocs.html
* igt@kms_chamelium_hpd@common-hpd-after-suspend:
- bat-dg1-5: NOTRUN -> [SKIP][5] ([i915#7828])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8702/bat-dg1-5/igt@kms_chamelium_hpd@common-hpd-after-suspend.html
* igt@kms_pipe_crc_basic@read-crc:
- bat-dg2-11: NOTRUN -> [SKIP][6] ([i915#5354])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8702/bat-dg2-11/igt@kms_pipe_crc_basic@read-crc.html
#### Possible fixes ####
* igt@i915_selftest@live@workarounds:
- bat-dg1-5: [ABORT][7] ([i915#4983] / [i915#7981]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12927/bat-dg1-5/igt@i915_selftest@live@workarounds.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8702/bat-dg1-5/igt@i915_selftest@live@workarounds.html
#### Warnings ####
* igt@i915_selftest@live@slpc:
- bat-rpls-2: [DMESG-FAIL][9] ([i915#6997] / [i915#7913]) -> [DMESG-FAIL][10] ([i915#6367] / [i915#7913] / [i915#7996])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12927/bat-rpls-2/igt@i915_selftest@live@slpc.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8702/bat-rpls-2/igt@i915_selftest@live@slpc.html
- bat-rpls-1: [DMESG-FAIL][11] ([i915#6367]) -> [DMESG-FAIL][12] ([i915#6997])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12927/bat-rpls-1/igt@i915_selftest@live@slpc.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8702/bat-rpls-1/igt@i915_selftest@live@slpc.html
[i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
[i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
[i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
[i915#6997]: https://gitlab.freedesktop.org/drm/intel/issues/6997
[i915#7059]: https://gitlab.freedesktop.org/drm/intel/issues/7059
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
[i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
[i915#7981]: https://gitlab.freedesktop.org/drm/intel/issues/7981
[i915#7996]: https://gitlab.freedesktop.org/drm/intel/issues/7996
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_7221 -> IGTPW_8702
CI-20190529: 20190529
CI_DRM_12927: 7139df0d53483b76598d625ae2f62cf742263ccb @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_8702: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8702/index.html
IGT_7221: 4b77c6d85024d22ca521d510f8eee574128fe04f @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8702/index.html
[-- Attachment #2: Type: text/html, Size: 5314 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* [igt-dev] ✓ Fi.CI.BAT: success for Assorted intel_gpu_top tweaks (rev2)
2023-03-28 12:54 [igt-dev] [PATCH i-g-t 0/3] Assorted intel_gpu_top tweaks Tvrtko Ursulin
` (3 preceding siblings ...)
2023-03-28 14:45 ` [igt-dev] ✗ Fi.CI.BAT: failure for Assorted intel_gpu_top tweaks Patchwork
@ 2023-04-06 16:22 ` Patchwork
2023-04-07 6:30 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
5 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2023-04-06 16:22 UTC (permalink / raw)
To: Tvrtko Ursulin; +Cc: igt-dev
[-- Attachment #1: Type: text/plain, Size: 5215 bytes --]
== Series Details ==
Series: Assorted intel_gpu_top tweaks (rev2)
URL : https://patchwork.freedesktop.org/series/115725/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_12981 -> IGTPW_8770
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/index.html
Participating hosts (36 -> 36)
------------------------------
Additional (1): fi-kbl-soraka
Missing (1): fi-snb-2520m
Known issues
------------
Here are the changes found in IGTPW_8770 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_huc_copy@huc-copy:
- fi-kbl-soraka: NOTRUN -> [SKIP][1] ([fdo#109271] / [i915#2190])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/fi-kbl-soraka/igt@gem_huc_copy@huc-copy.html
* igt@gem_lmem_swapping@basic:
- fi-kbl-soraka: NOTRUN -> [SKIP][2] ([fdo#109271] / [i915#4613]) +3 similar issues
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/fi-kbl-soraka/igt@gem_lmem_swapping@basic.html
* igt@i915_pm_rpm@module-reload:
- fi-kbl-soraka: NOTRUN -> [DMESG-WARN][3] ([i915#1982])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/fi-kbl-soraka/igt@i915_pm_rpm@module-reload.html
* igt@i915_selftest@live@gt_lrc:
- bat-adln-1: [PASS][4] -> [INCOMPLETE][5] ([i915#4983] / [i915#7609])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12981/bat-adln-1/igt@i915_selftest@live@gt_lrc.html
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/bat-adln-1/igt@i915_selftest@live@gt_lrc.html
* igt@i915_selftest@live@gt_pm:
- fi-kbl-soraka: NOTRUN -> [DMESG-FAIL][6] ([i915#1886])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/fi-kbl-soraka/igt@i915_selftest@live@gt_pm.html
* igt@i915_selftest@live@reset:
- bat-rpls-2: [PASS][7] -> [ABORT][8] ([i915#4983] / [i915#7913])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12981/bat-rpls-2/igt@i915_selftest@live@reset.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/bat-rpls-2/igt@i915_selftest@live@reset.html
- bat-rpls-1: [PASS][9] -> [ABORT][10] ([i915#4983])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12981/bat-rpls-1/igt@i915_selftest@live@reset.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/bat-rpls-1/igt@i915_selftest@live@reset.html
* igt@kms_chamelium_frames@hdmi-crc-fast:
- fi-kbl-soraka: NOTRUN -> [SKIP][11] ([fdo#109271]) +16 similar issues
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/fi-kbl-soraka/igt@kms_chamelium_frames@hdmi-crc-fast.html
* igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence:
- bat-dg2-11: NOTRUN -> [SKIP][12] ([i915#5354]) +1 similar issue
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/bat-dg2-11/igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence.html
#### Possible fixes ####
* igt@i915_pm_rps@basic-api:
- bat-dg2-11: [FAIL][13] ([i915#8308]) -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12981/bat-dg2-11/igt@i915_pm_rps@basic-api.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/bat-dg2-11/igt@i915_pm_rps@basic-api.html
* igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence@pipe-d-dp-1:
- bat-dg2-8: [FAIL][15] ([i915#7932]) -> [PASS][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12981/bat-dg2-8/igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence@pipe-d-dp-1.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/bat-dg2-8/igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence@pipe-d-dp-1.html
{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#1886]: https://gitlab.freedesktop.org/drm/intel/issues/1886
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
[i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
[i915#7609]: https://gitlab.freedesktop.org/drm/intel/issues/7609
[i915#7872]: https://gitlab.freedesktop.org/drm/intel/issues/7872
[i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
[i915#7932]: https://gitlab.freedesktop.org/drm/intel/issues/7932
[i915#8308]: https://gitlab.freedesktop.org/drm/intel/issues/8308
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_7243 -> IGTPW_8770
CI-20190529: 20190529
CI_DRM_12981: fbadfcf137737f02425a35bf3ae17a1492301f21 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_8770: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/index.html
IGT_7243: 402a13477510ab05591839a2bf4586de1158e60c @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/index.html
[-- Attachment #2: Type: text/html, Size: 6285 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* [igt-dev] ✓ Fi.CI.IGT: success for Assorted intel_gpu_top tweaks (rev2)
2023-03-28 12:54 [igt-dev] [PATCH i-g-t 0/3] Assorted intel_gpu_top tweaks Tvrtko Ursulin
` (4 preceding siblings ...)
2023-04-06 16:22 ` [igt-dev] ✓ Fi.CI.BAT: success for Assorted intel_gpu_top tweaks (rev2) Patchwork
@ 2023-04-07 6:30 ` Patchwork
5 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2023-04-07 6:30 UTC (permalink / raw)
To: Tvrtko Ursulin; +Cc: igt-dev
[-- Attachment #1: Type: text/plain, Size: 12906 bytes --]
== Series Details ==
Series: Assorted intel_gpu_top tweaks (rev2)
URL : https://patchwork.freedesktop.org/series/115725/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_12981_full -> IGTPW_8770_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/index.html
Participating hosts (7 -> 7)
------------------------------
No changes in participating hosts
Known issues
------------
Here are the changes found in IGTPW_8770_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gen9_exec_parse@allowed-all:
- shard-apl: [PASS][1] -> [ABORT][2] ([i915#5566])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12981/shard-apl7/igt@gen9_exec_parse@allowed-all.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/shard-apl3/igt@gen9_exec_parse@allowed-all.html
* igt@kms_ccs@pipe-c-bad-pixel-format-y_tiled_gen12_mc_ccs:
- shard-apl: NOTRUN -> [SKIP][3] ([fdo#109271] / [i915#3886])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/shard-apl6/igt@kms_ccs@pipe-c-bad-pixel-format-y_tiled_gen12_mc_ccs.html
* igt@kms_flip@2x-nonexisting-fb:
- shard-apl: NOTRUN -> [SKIP][4] ([fdo#109271]) +32 similar issues
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/shard-apl6/igt@kms_flip@2x-nonexisting-fb.html
* igt@kms_flip@flip-vs-expired-vblank@b-dp1:
- shard-apl: [PASS][5] -> [FAIL][6] ([i915#79])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12981/shard-apl2/igt@kms_flip@flip-vs-expired-vblank@b-dp1.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/shard-apl7/igt@kms_flip@flip-vs-expired-vblank@b-dp1.html
* igt@kms_hdmi_inject@inject-audio:
- shard-snb: [PASS][7] -> [SKIP][8] ([fdo#109271])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12981/shard-snb2/igt@kms_hdmi_inject@inject-audio.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/shard-snb4/igt@kms_hdmi_inject@inject-audio.html
#### Possible fixes ####
* igt@gem_exec_fair@basic-deadline:
- {shard-rkl}: [FAIL][9] ([i915#2846]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12981/shard-rkl-3/igt@gem_exec_fair@basic-deadline.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/shard-rkl-3/igt@gem_exec_fair@basic-deadline.html
* igt@gem_exec_fair@basic-none-solo@rcs0:
- shard-apl: [FAIL][11] ([i915#2842]) -> [PASS][12] +1 similar issue
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12981/shard-apl4/igt@gem_exec_fair@basic-none-solo@rcs0.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/shard-apl4/igt@gem_exec_fair@basic-none-solo@rcs0.html
* igt@gem_exec_fair@basic-pace-share@rcs0:
- shard-glk: [FAIL][13] ([i915#2842]) -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12981/shard-glk3/igt@gem_exec_fair@basic-pace-share@rcs0.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/shard-glk4/igt@gem_exec_fair@basic-pace-share@rcs0.html
* igt@i915_pm_rpm@dpms-mode-unset-lpsp:
- {shard-rkl}: [SKIP][15] ([i915#1397]) -> [PASS][16] +1 similar issue
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12981/shard-rkl-6/igt@i915_pm_rpm@dpms-mode-unset-lpsp.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/shard-rkl-7/igt@i915_pm_rpm@dpms-mode-unset-lpsp.html
* igt@kms_cursor_crc@cursor-suspend@pipe-c-dp-1:
- shard-apl: [ABORT][17] ([i915#180]) -> [PASS][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12981/shard-apl1/igt@kms_cursor_crc@cursor-suspend@pipe-c-dp-1.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/shard-apl3/igt@kms_cursor_crc@cursor-suspend@pipe-c-dp-1.html
* igt@kms_cursor_legacy@forked-move@pipe-b:
- {shard-rkl}: [INCOMPLETE][19] ([i915#8011]) -> [PASS][20] +1 similar issue
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12981/shard-rkl-7/igt@kms_cursor_legacy@forked-move@pipe-b.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/shard-rkl-3/igt@kms_cursor_legacy@forked-move@pipe-b.html
* igt@kms_plane_lowres@tiling-x@pipe-d-hdmi-a-4:
- {shard-dg1}: [FAIL][21] -> [PASS][22] +3 similar issues
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12981/shard-dg1-17/igt@kms_plane_lowres@tiling-x@pipe-d-hdmi-a-4.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/shard-dg1-15/igt@kms_plane_lowres@tiling-x@pipe-d-hdmi-a-4.html
* igt@kms_plane_scaling@i915-max-src-size@pipe-a-hdmi-a-2:
- {shard-rkl}: [FAIL][23] ([i915#8292]) -> [PASS][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12981/shard-rkl-4/igt@kms_plane_scaling@i915-max-src-size@pipe-a-hdmi-a-2.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/shard-rkl-6/igt@kms_plane_scaling@i915-max-src-size@pipe-a-hdmi-a-2.html
{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
[fdo#109274]: https://bugs.freedesktop.org/show_bug.cgi?id=109274
[fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
[fdo#109283]: https://bugs.freedesktop.org/show_bug.cgi?id=109283
[fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
[fdo#109291]: https://bugs.freedesktop.org/show_bug.cgi?id=109291
[fdo#109302]: https://bugs.freedesktop.org/show_bug.cgi?id=109302
[fdo#109307]: https://bugs.freedesktop.org/show_bug.cgi?id=109307
[fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
[fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
[fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
[fdo#111615]: https://bugs.freedesktop.org/show_bug.cgi?id=111615
[fdo#111825]: https://bugs.freedesktop.org/show_bug.cgi?id=111825
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[fdo#112054]: https://bugs.freedesktop.org/show_bug.cgi?id=112054
[fdo#112283]: https://bugs.freedesktop.org/show_bug.cgi?id=112283
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#1825]: https://gitlab.freedesktop.org/drm/intel/issues/1825
[i915#2437]: https://gitlab.freedesktop.org/drm/intel/issues/2437
[i915#2527]: https://gitlab.freedesktop.org/drm/intel/issues/2527
[i915#2575]: https://gitlab.freedesktop.org/drm/intel/issues/2575
[i915#2587]: https://gitlab.freedesktop.org/drm/intel/issues/2587
[i915#2672]: https://gitlab.freedesktop.org/drm/intel/issues/2672
[i915#280]: https://gitlab.freedesktop.org/drm/intel/issues/280
[i915#284]: https://gitlab.freedesktop.org/drm/intel/issues/284
[i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
[i915#2846]: https://gitlab.freedesktop.org/drm/intel/issues/2846
[i915#3023]: https://gitlab.freedesktop.org/drm/intel/issues/3023
[i915#3281]: https://gitlab.freedesktop.org/drm/intel/issues/3281
[i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
[i915#3297]: https://gitlab.freedesktop.org/drm/intel/issues/3297
[i915#3299]: https://gitlab.freedesktop.org/drm/intel/issues/3299
[i915#3359]: https://gitlab.freedesktop.org/drm/intel/issues/3359
[i915#3458]: https://gitlab.freedesktop.org/drm/intel/issues/3458
[i915#3539]: https://gitlab.freedesktop.org/drm/intel/issues/3539
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637
[i915#3638]: https://gitlab.freedesktop.org/drm/intel/issues/3638
[i915#3689]: https://gitlab.freedesktop.org/drm/intel/issues/3689
[i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
[i915#3742]: https://gitlab.freedesktop.org/drm/intel/issues/3742
[i915#3778]: https://gitlab.freedesktop.org/drm/intel/issues/3778
[i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
[i915#3955]: https://gitlab.freedesktop.org/drm/intel/issues/3955
[i915#3989]: https://gitlab.freedesktop.org/drm/intel/issues/3989
[i915#404]: https://gitlab.freedesktop.org/drm/intel/issues/404
[i915#4070]: https://gitlab.freedesktop.org/drm/intel/issues/4070
[i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
[i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078
[i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
[i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
[i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
[i915#4212]: https://gitlab.freedesktop.org/drm/intel/issues/4212
[i915#4213]: https://gitlab.freedesktop.org/drm/intel/issues/4213
[i915#4270]: https://gitlab.freedesktop.org/drm/intel/issues/4270
[i915#4281]: https://gitlab.freedesktop.org/drm/intel/issues/4281
[i915#433]: https://gitlab.freedesktop.org/drm/intel/issues/433
[i915#4349]: https://gitlab.freedesktop.org/drm/intel/issues/4349
[i915#4391]: https://gitlab.freedesktop.org/drm/intel/issues/4391
[i915#4538]: https://gitlab.freedesktop.org/drm/intel/issues/4538
[i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
[i915#4579]: https://gitlab.freedesktop.org/drm/intel/issues/4579
[i915#4771]: https://gitlab.freedesktop.org/drm/intel/issues/4771
[i915#4812]: https://gitlab.freedesktop.org/drm/intel/issues/4812
[i915#4818]: https://gitlab.freedesktop.org/drm/intel/issues/4818
[i915#4833]: https://gitlab.freedesktop.org/drm/intel/issues/4833
[i915#4852]: https://gitlab.freedesktop.org/drm/intel/issues/4852
[i915#4854]: https://gitlab.freedesktop.org/drm/intel/issues/4854
[i915#4859]: https://gitlab.freedesktop.org/drm/intel/issues/4859
[i915#4860]: https://gitlab.freedesktop.org/drm/intel/issues/4860
[i915#4879]: https://gitlab.freedesktop.org/drm/intel/issues/4879
[i915#4880]: https://gitlab.freedesktop.org/drm/intel/issues/4880
[i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176
[i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235
[i915#5286]: https://gitlab.freedesktop.org/drm/intel/issues/5286
[i915#5288]: https://gitlab.freedesktop.org/drm/intel/issues/5288
[i915#5289]: https://gitlab.freedesktop.org/drm/intel/issues/5289
[i915#5325]: https://gitlab.freedesktop.org/drm/intel/issues/5325
[i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
[i915#5431]: https://gitlab.freedesktop.org/drm/intel/issues/5431
[i915#5563]: https://gitlab.freedesktop.org/drm/intel/issues/5563
[i915#5566]: https://gitlab.freedesktop.org/drm/intel/issues/5566
[i915#5784]: https://gitlab.freedesktop.org/drm/intel/issues/5784
[i915#6095]: https://gitlab.freedesktop.org/drm/intel/issues/6095
[i915#6301]: https://gitlab.freedesktop.org/drm/intel/issues/6301
[i915#6524]: https://gitlab.freedesktop.org/drm/intel/issues/6524
[i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
[i915#6590]: https://gitlab.freedesktop.org/drm/intel/issues/6590
[i915#6768]: https://gitlab.freedesktop.org/drm/intel/issues/6768
[i915#6946]: https://gitlab.freedesktop.org/drm/intel/issues/6946
[i915#7116]: https://gitlab.freedesktop.org/drm/intel/issues/7116
[i915#7561]: https://gitlab.freedesktop.org/drm/intel/issues/7561
[i915#7697]: https://gitlab.freedesktop.org/drm/intel/issues/7697
[i915#7701]: https://gitlab.freedesktop.org/drm/intel/issues/7701
[i915#7711]: https://gitlab.freedesktop.org/drm/intel/issues/7711
[i915#7742]: https://gitlab.freedesktop.org/drm/intel/issues/7742
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
[i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79
[i915#7975]: https://gitlab.freedesktop.org/drm/intel/issues/7975
[i915#8011]: https://gitlab.freedesktop.org/drm/intel/issues/8011
[i915#8155]: https://gitlab.freedesktop.org/drm/intel/issues/8155
[i915#8292]: https://gitlab.freedesktop.org/drm/intel/issues/8292
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_7243 -> IGTPW_8770
* Piglit: piglit_4509 -> None
CI-20190529: 20190529
CI_DRM_12981: fbadfcf137737f02425a35bf3ae17a1492301f21 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_8770: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/index.html
IGT_7243: 402a13477510ab05591839a2bf4586de1158e60c @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8770/index.html
[-- Attachment #2: Type: text/html, Size: 7671 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [igt-dev] [Intel-gfx] [PATCH i-g-t 1/3] intel_gpu_top: Display large pids nicely in interactive mode
2023-03-28 12:54 ` [igt-dev] [PATCH i-g-t 1/3] intel_gpu_top: Display large pids nicely in interactive mode Tvrtko Ursulin
@ 2023-04-14 15:24 ` Kamil Konieczny
0 siblings, 0 replies; 11+ messages in thread
From: Kamil Konieczny @ 2023-04-14 15:24 UTC (permalink / raw)
To: igt-dev; +Cc: Intel-gfx
Hi,
On 2023-03-28 at 13:54:27 +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> So far the width of the PID column was hardcoded to six characters which
> is not enough on systems with high uptime, where PID numbers can grow
> large, and results in broken line formatting.
>
> Fix it by tracking the largest width for both the pid and name fields and
> use them dynamically.
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> ---
> tools/intel_gpu_top.c | 66 +++++++++++++++++++++++++++++++++++++------
> 1 file changed, 58 insertions(+), 8 deletions(-)
>
> diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
> index a4302aa389b4..39be916297e4 100644
> --- a/tools/intel_gpu_top.c
> +++ b/tools/intel_gpu_top.c
> @@ -1,5 +1,5 @@
> /*
> - * Copyright © 2007-2021 Intel Corporation
> + * Copyright © 2007-2023 Intel Corporation
> *
> * Permission is hereby granted, free of charge, to any person obtaining a
> * copy of this software and associated documentation files (the "Software"),
> @@ -693,6 +693,7 @@ struct client {
> enum client_status status;
> unsigned int id;
> unsigned int pid;
> + char pid_str[10];
> char name[24];
> char print_name[24];
> unsigned int samples;
> @@ -709,6 +710,9 @@ struct clients {
> unsigned int num_classes;
> struct engine_class *class;
>
> + int max_pid_len;
> + int max_name_len;
> +
> char pci_slot[64];
>
> struct client *client;
> @@ -758,9 +762,14 @@ update_client(struct client *c, unsigned int pid, char *name,
> const struct drm_client_fdinfo *info)
> {
> unsigned int i;
> + int len;
>
> - if (c->pid != pid)
> + if (c->pid != pid) {
> c->pid = pid;
> + len = snprintf(c->pid_str, sizeof(c->pid_str) - 1, "%u", pid);
> + if (len > c->clients->max_pid_len)
> + c->clients->max_pid_len = len;
> + }
>
> if (strcmp(c->name, name)) {
> char *p;
> @@ -774,6 +783,10 @@ update_client(struct client *c, unsigned int pid, char *name,
> *p = '*';
> p++;
> }
> +
> + len = strlen(c->print_name);
> + if (len > c->clients->max_name_len)
> + c->clients->max_name_len = len;
> }
>
> c->last_runtime = 0;
> @@ -990,6 +1003,7 @@ static struct clients *display_clients(struct clients *clients)
> ac->id = -c->pid;
> ac->pid = c->pid;
> strcpy(ac->name, c->name);
> + strcpy(ac->pid_str, c->pid_str);
> strcpy(ac->print_name, c->print_name);
> ac->val = calloc(clients->num_classes,
> sizeof(ac->val[0]));
> @@ -1013,6 +1027,9 @@ static struct clients *display_clients(struct clients *clients)
> aggregated->num_clients = num;
> aggregated->active_clients = num;
>
> + aggregated->max_pid_len = clients->max_pid_len;
> + aggregated->max_name_len = clients->max_name_len;
> +
> clients = aggregated;
>
> out:
> @@ -1104,9 +1121,34 @@ static size_t readat2buf(int at, const char *name, char *buf, const size_t sz)
> }
> }
>
> +static void clients_update_max_lengths(struct clients *clients)
> +{
> + struct client *c;
> + int tmp;
> +
> + clients->max_name_len = 0;
> + clients->max_pid_len = 0;
> +
> + for_each_client(clients, c, tmp) {
> + int len;
> +
> + if (c->status != ALIVE)
> + continue; /* Array not yet sorted by the caller. */
> +
> + len = strlen(c->print_name);
> + if (len > clients->max_name_len)
> + clients->max_name_len = len;
> +
> + len = strlen(c->pid_str);
> + if (len > clients->max_pid_len)
> + clients->max_pid_len = len;
> + }
> +}
> +
> static struct clients *scan_clients(struct clients *clients, bool display)
> {
> struct dirent *proc_dent;
> + bool freed = false;
> struct client *c;
> DIR *proc_dir;
> int tmp;
> @@ -1208,12 +1250,17 @@ next:
> closedir(proc_dir);
>
> for_each_client(clients, c, tmp) {
> - if (c->status == PROBE)
> + if (c->status == PROBE) {
> free_client(c);
> - else if (c->status == FREE)
> + freed = true;
> + } else if (c->status == FREE) {
> break;
> + }
> }
>
> + if (freed)
> + clients_update_max_lengths(clients);
> +
> return display ? display_clients(clients) : clients;
> }
>
> @@ -2172,15 +2219,16 @@ print_clients_header(struct clients *clients, int lines,
> int con_w, int con_h, int *class_w)
> {
> if (output_mode == INTERACTIVE) {
> - const char *pidname = " PID NAME ";
> unsigned int num_active = 0;
> - int len = strlen(pidname);
> + int len;
>
> if (lines++ >= con_h)
> return lines;
>
> printf("\033[7m");
> - printf("%s", pidname);
> + len = printf("%*s %*s ",
> + clients->max_pid_len, "PID",
> + clients->max_name_len, "NAME");
>
> if (lines++ >= con_h || len >= con_w)
> return lines;
> @@ -2241,7 +2289,9 @@ print_client(struct client *c, struct engines *engines, double t, int lines,
>
> lines++;
>
> - printf("%6u %17s ", c->pid, c->print_name);
> + printf("%*s %*s ",
> + clients->max_pid_len, c->pid_str,
> + clients->max_name_len, c->print_name);
>
> for (i = 0; c->samples > 1 && i < clients->num_classes; i++) {
> double pct;
> --
> 2.37.2
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 2/3] intel_gpu_top: Use full console width for global metrics
2023-03-28 12:54 ` [igt-dev] [PATCH i-g-t 2/3] intel_gpu_top: Use full console width for global metrics Tvrtko Ursulin
@ 2023-04-14 15:26 ` Kamil Konieczny
0 siblings, 0 replies; 11+ messages in thread
From: Kamil Konieczny @ 2023-04-14 15:26 UTC (permalink / raw)
To: igt-dev; +Cc: Intel-gfx
On 2023-03-28 at 13:54:28 +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> It appears we had an off by one of a kind where we were not using the full
> width of the terminal window for the global metrics section.
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> ---
> tools/intel_gpu_top.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
> index 39be916297e4..36da016c3df0 100644
> --- a/tools/intel_gpu_top.c
> +++ b/tools/intel_gpu_top.c
> @@ -1960,8 +1960,7 @@ print_engines_header(struct engines *engines, double t,
> a = " ENGINE BUSY ";
>
> printf("\033[7m%s%*s%s\033[0m\n",
> - a, (int)(con_w - 1 - strlen(a) - strlen(b)),
> - " ", b);
> + a, (int)(con_w - strlen(a) - strlen(b)), " ", b);
>
> lines++;
> }
> @@ -2000,7 +1999,6 @@ print_engine(struct engines *engines, unsigned int i, double t,
> print_groups(groups);
>
> if (output_mode == INTERACTIVE) {
> - unsigned int max_w = con_w - 1;
> unsigned int len;
> char buf[128];
> double val;
> @@ -2012,7 +2010,7 @@ print_engine(struct engines *engines, unsigned int i, double t,
> engine->display_name, engine_items[0].buf);
>
> val = pmu_calc(&engine->busy.val, 1e9, t, 100);
> - print_percentage_bar(val, max_w > len ? max_w - len : 0, false);
> + print_percentage_bar(val, con_w > len ? con_w - len : 0, false);
>
> printf("%s\n", buf);
>
> --
> 2.37.2
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [igt-dev] [Intel-gfx] [PATCH i-g-t 3/3] intel_gpu_top: Show non-normalized client usage in numeric mode
2023-03-28 12:54 ` [igt-dev] [PATCH i-g-t 3/3] intel_gpu_top: Show non-normalized client usage in numeric mode Tvrtko Ursulin
@ 2023-04-14 15:28 ` Kamil Konieczny
2023-04-17 10:58 ` Tvrtko Ursulin
0 siblings, 1 reply; 11+ messages in thread
From: Kamil Konieczny @ 2023-04-14 15:28 UTC (permalink / raw)
To: igt-dev; +Cc: Intel-gfx
On 2023-03-28 at 13:54:29 +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> When numeric display is selected in the interactive mode it is more
> descriptive to show client's non-normalized (by number of engines per
> class) usage. Rendering of the visual representation (bar) is kept the
> same.
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> ---
> tools/intel_gpu_top.c | 20 +++++++++++---------
> 1 file changed, 11 insertions(+), 9 deletions(-)
>
> diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
> index 36da016c3df0..b6827b3de9bd 100644
> --- a/tools/intel_gpu_top.c
> +++ b/tools/intel_gpu_top.c
> @@ -1275,14 +1275,14 @@ static void n_spaces(const unsigned int n)
> }
>
> static void
> -print_percentage_bar(double percent, int max_len, bool numeric)
> +print_percentage_bar(double percent, double max, int max_len, bool numeric)
> {
> int bar_len, i, len = max_len - 2;
> const int w = 8;
>
> assert(max_len > 0);
>
> - bar_len = ceil(w * percent * len / 100.0);
> + bar_len = ceil(w * percent * len / max);
> if (bar_len > w * len)
> bar_len = w * len;
>
> @@ -2010,7 +2010,8 @@ print_engine(struct engines *engines, unsigned int i, double t,
> engine->display_name, engine_items[0].buf);
>
> val = pmu_calc(&engine->busy.val, 1e9, t, 100);
> - print_percentage_bar(val, con_w > len ? con_w - len : 0, false);
> + print_percentage_bar(val, 100.0, con_w > len ? con_w - len : 0,
> + false);
>
> printf("%s\n", buf);
>
> @@ -2292,23 +2293,24 @@ print_client(struct client *c, struct engines *engines, double t, int lines,
> clients->max_name_len, c->print_name);
>
> for (i = 0; c->samples > 1 && i < clients->num_classes; i++) {
> - double pct;
> + double pct, max;
>
> if (!clients->class[i].num_engines)
> continue; /* Assert in the ideal world. */
>
> - pct = (double)c->val[i] / period_us / 1e3 * 100 /
> - clients->class[i].num_engines;
> + pct = (double)c->val[i] / period_us / 1e3 * 100;
>
> /*
> * Guard against possible time-drift between sampling
> * client data and time we obtained our time-delta from
> * PMU.
> */
> - if (pct > 100.0)
> - pct = 100.0;
> + max = 100.0 * clients->class[i].num_engines;
> + if (pct > max)
> + pct = max;
>
> - print_percentage_bar(pct, *class_w, numeric_clients);
> + print_percentage_bar(pct, max, *class_w,
> + numeric_clients);
> }
>
> putchar('\n');
> --
> 2.37.2
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [igt-dev] [Intel-gfx] [PATCH i-g-t 3/3] intel_gpu_top: Show non-normalized client usage in numeric mode
2023-04-14 15:28 ` [igt-dev] [Intel-gfx] " Kamil Konieczny
@ 2023-04-17 10:58 ` Tvrtko Ursulin
0 siblings, 0 replies; 11+ messages in thread
From: Tvrtko Ursulin @ 2023-04-17 10:58 UTC (permalink / raw)
To: Kamil Konieczny, igt-dev, Intel-gfx
Hi Kamil,
On 14/04/2023 16:28, Kamil Konieczny wrote:
> On 2023-03-28 at 13:54:29 +0100, Tvrtko Ursulin wrote:
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> When numeric display is selected in the interactive mode it is more
>> descriptive to show client's non-normalized (by number of engines per
>> class) usage. Rendering of the visual representation (bar) is kept the
>> same.
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Thanks for reviewing all three and merging them too!
Regards,
Tvrtko
>> ---
>> tools/intel_gpu_top.c | 20 +++++++++++---------
>> 1 file changed, 11 insertions(+), 9 deletions(-)
>>
>> diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
>> index 36da016c3df0..b6827b3de9bd 100644
>> --- a/tools/intel_gpu_top.c
>> +++ b/tools/intel_gpu_top.c
>> @@ -1275,14 +1275,14 @@ static void n_spaces(const unsigned int n)
>> }
>>
>> static void
>> -print_percentage_bar(double percent, int max_len, bool numeric)
>> +print_percentage_bar(double percent, double max, int max_len, bool numeric)
>> {
>> int bar_len, i, len = max_len - 2;
>> const int w = 8;
>>
>> assert(max_len > 0);
>>
>> - bar_len = ceil(w * percent * len / 100.0);
>> + bar_len = ceil(w * percent * len / max);
>> if (bar_len > w * len)
>> bar_len = w * len;
>>
>> @@ -2010,7 +2010,8 @@ print_engine(struct engines *engines, unsigned int i, double t,
>> engine->display_name, engine_items[0].buf);
>>
>> val = pmu_calc(&engine->busy.val, 1e9, t, 100);
>> - print_percentage_bar(val, con_w > len ? con_w - len : 0, false);
>> + print_percentage_bar(val, 100.0, con_w > len ? con_w - len : 0,
>> + false);
>>
>> printf("%s\n", buf);
>>
>> @@ -2292,23 +2293,24 @@ print_client(struct client *c, struct engines *engines, double t, int lines,
>> clients->max_name_len, c->print_name);
>>
>> for (i = 0; c->samples > 1 && i < clients->num_classes; i++) {
>> - double pct;
>> + double pct, max;
>>
>> if (!clients->class[i].num_engines)
>> continue; /* Assert in the ideal world. */
>>
>> - pct = (double)c->val[i] / period_us / 1e3 * 100 /
>> - clients->class[i].num_engines;
>> + pct = (double)c->val[i] / period_us / 1e3 * 100;
>>
>> /*
>> * Guard against possible time-drift between sampling
>> * client data and time we obtained our time-delta from
>> * PMU.
>> */
>> - if (pct > 100.0)
>> - pct = 100.0;
>> + max = 100.0 * clients->class[i].num_engines;
>> + if (pct > max)
>> + pct = max;
>>
>> - print_percentage_bar(pct, *class_w, numeric_clients);
>> + print_percentage_bar(pct, max, *class_w,
>> + numeric_clients);
>> }
>>
>> putchar('\n');
>> --
>> 2.37.2
>>
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2023-04-17 10:58 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-28 12:54 [igt-dev] [PATCH i-g-t 0/3] Assorted intel_gpu_top tweaks Tvrtko Ursulin
2023-03-28 12:54 ` [igt-dev] [PATCH i-g-t 1/3] intel_gpu_top: Display large pids nicely in interactive mode Tvrtko Ursulin
2023-04-14 15:24 ` [igt-dev] [Intel-gfx] " Kamil Konieczny
2023-03-28 12:54 ` [igt-dev] [PATCH i-g-t 2/3] intel_gpu_top: Use full console width for global metrics Tvrtko Ursulin
2023-04-14 15:26 ` Kamil Konieczny
2023-03-28 12:54 ` [igt-dev] [PATCH i-g-t 3/3] intel_gpu_top: Show non-normalized client usage in numeric mode Tvrtko Ursulin
2023-04-14 15:28 ` [igt-dev] [Intel-gfx] " Kamil Konieczny
2023-04-17 10:58 ` Tvrtko Ursulin
2023-03-28 14:45 ` [igt-dev] ✗ Fi.CI.BAT: failure for Assorted intel_gpu_top tweaks Patchwork
2023-04-06 16:22 ` [igt-dev] ✓ Fi.CI.BAT: success for Assorted intel_gpu_top tweaks (rev2) Patchwork
2023-04-07 6:30 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox