Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH i-g-t] tools/intel_gpu_top: Show the active device
@ 2020-11-13 13:56 Chris Wilson
  2020-11-16 11:12 ` [Intel-gfx] [igt-dev] " Tvrtko Ursulin
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Wilson @ 2020-11-13 13:56 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Chris Wilson

Include the active device name on the update screen.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tools/intel_gpu_top.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
index 298defa4e..c16e80502 100644
--- a/tools/intel_gpu_top.c
+++ b/tools/intel_gpu_top.c
@@ -1027,7 +1027,8 @@ static bool print_groups(struct cnt_group **groups)
 }
 
 static int
-print_header(struct engines *engines, double t,
+print_header(const struct igt_device_card *card,
+	     struct engines *engines, double t,
 	     int lines, int con_w, int con_h, bool *consumed)
 {
 	struct pmu_counter fake_pmu = {
@@ -1106,14 +1107,15 @@ print_header(struct engines *engines, double t,
 		printf("\033[H\033[J");
 
 		if (lines++ < con_h) {
+			printf("intel-gpu-top: %s - ", card->card);
 			if (!engines->discrete)
-				printf("intel-gpu-top - %s/%s MHz;  %s%% RC6; %s %s; %s irqs/s\n",
+				printf("%s/%s MHz;  %s%% RC6; %s %s; %s irqs/s\n",
 					freq_items[1].buf, freq_items[0].buf,
 					rc6_items[0].buf, power_items[0].buf,
 					engines->rapl_unit,
 					irq_items[0].buf);
 			else
-				printf("intel-gpu-top - %s/%s MHz;  %s%% RC6; %s irqs/s\n",
+				printf("%s/%s MHz;  %s%% RC6; %s irqs/s\n",
 					freq_items[1].buf, freq_items[0].buf,
 					rc6_items[0].buf, irq_items[0].buf);
 		}
@@ -1457,7 +1459,8 @@ int main(int argc, char **argv)
 			break;
 
 		while (!consumed) {
-			lines = print_header(engines, t, lines, con_w, con_h,
+			lines = print_header(&card, engines,
+					     t, lines, con_w, con_h,
 					     &consumed);
 
 			if (engines->imc_fd)
-- 
2.29.2

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

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

* Re: [Intel-gfx] [igt-dev] [PATCH i-g-t] tools/intel_gpu_top: Show the active device
  2020-11-13 13:56 [Intel-gfx] [PATCH i-g-t] tools/intel_gpu_top: Show the active device Chris Wilson
@ 2020-11-16 11:12 ` Tvrtko Ursulin
  0 siblings, 0 replies; 2+ messages in thread
From: Tvrtko Ursulin @ 2020-11-16 11:12 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: igt-dev


On 13/11/2020 13:56, Chris Wilson wrote:
> Include the active device name on the update screen.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   tools/intel_gpu_top.c | 11 +++++++----
>   1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
> index 298defa4e..c16e80502 100644
> --- a/tools/intel_gpu_top.c
> +++ b/tools/intel_gpu_top.c
> @@ -1027,7 +1027,8 @@ static bool print_groups(struct cnt_group **groups)
>   }
>   
>   static int
> -print_header(struct engines *engines, double t,
> +print_header(const struct igt_device_card *card,
> +	     struct engines *engines, double t,
>   	     int lines, int con_w, int con_h, bool *consumed)
>   {
>   	struct pmu_counter fake_pmu = {
> @@ -1106,14 +1107,15 @@ print_header(struct engines *engines, double t,
>   		printf("\033[H\033[J");
>   
>   		if (lines++ < con_h) {
> +			printf("intel-gpu-top: %s - ", card->card);
>   			if (!engines->discrete)
> -				printf("intel-gpu-top - %s/%s MHz;  %s%% RC6; %s %s; %s irqs/s\n",
> +				printf("%s/%s MHz;  %s%% RC6; %s %s; %s irqs/s\n",
>   					freq_items[1].buf, freq_items[0].buf,
>   					rc6_items[0].buf, power_items[0].buf,
>   					engines->rapl_unit,
>   					irq_items[0].buf);
>   			else
> -				printf("intel-gpu-top - %s/%s MHz;  %s%% RC6; %s irqs/s\n",
> +				printf("%s/%s MHz;  %s%% RC6; %s irqs/s\n",
>   					freq_items[1].buf, freq_items[0].buf,
>   					rc6_items[0].buf, irq_items[0].buf);
>   		}
> @@ -1457,7 +1459,8 @@ int main(int argc, char **argv)
>   			break;
>   
>   		while (!consumed) {
> -			lines = print_header(engines, t, lines, con_w, con_h,
> +			lines = print_header(&card, engines,
> +					     t, lines, con_w, con_h,
>   					     &consumed);
>   
>   			if (engines->imc_fd)
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

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

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

end of thread, other threads:[~2020-11-16 11:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-13 13:56 [Intel-gfx] [PATCH i-g-t] tools/intel_gpu_top: Show the active device Chris Wilson
2020-11-16 11:12 ` [Intel-gfx] [igt-dev] " Tvrtko Ursulin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox