diff options
author | Tvrtko Ursulin <tvrtko.ursulin@intel.com> | 2021-02-03 10:46:38 +0000 |
---|---|---|
committer | Tvrtko Ursulin <tvrtko.ursulin@intel.com> | 2021-02-03 13:04:22 +0000 |
commit | c18765b5f84a0fd3e0ab3ae8bb7258f209d6671e (patch) | |
tree | f64af9004747476b8c0527ded458cdc15bbe4533 /tools | |
parent | 2b2b58f9a61c2ce38e425231b3caa59b75819c1f (diff) |
intel_gpu_top: Show banner messages when cycling sort modes
It is useful to let the user know what is the currently active sort mode.
v2:
* Show some other messages as well.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/intel_gpu_top.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c index 1ffdf5ee..94809cdf 100644 --- a/tools/intel_gpu_top.c +++ b/tools/intel_gpu_top.c @@ -1444,6 +1444,8 @@ static bool print_groups(struct cnt_group **groups) return print_data; } +static const char *header_msg; + static int print_header(const struct igt_device_card *card, const char *codename, @@ -1537,6 +1539,15 @@ print_header(const struct igt_device_card *card, } printf("%s irqs/s\n", irq_items[0].buf); } + + if (lines++ < con_h) { + if (header_msg) { + printf(" >>> %s\n", header_msg); + header_msg = NULL; + } else { + printf("\n"); + } + } } return lines; @@ -2088,12 +2099,15 @@ static void select_client_sort(void) switch (++client_sort % 3) { case 0: client_cmp = client_last_cmp; + header_msg = "Sorting clients by current GPU usage."; break; case 1: client_cmp = client_total_cmp; + header_msg = "Sorting clients by accummulated GPU usage."; break; case 2: client_cmp = client_id_cmp; + header_msg = "Sorting clients by sysfs id."; } } @@ -2122,9 +2136,17 @@ static void process_stdin(unsigned int timeout_us) break; case '1': class_view ^= true; + if (class_view) + header_msg = "Aggregating engine classes."; + else + header_msg = "Showing physical engines."; break; case 'i': filter_idle ^= true; + if (filter_idle) + header_msg = "Hiding inactive clients."; + else + header_msg = "Showing inactive clients."; break; case 'n': numeric_clients ^= true; |