tools/intel_gpu_top: Add support for stdout logging
From: Tvrtko Ursulin <[email protected]>
Two new output modes are added: listing of text data to standard out (-l on the command line), and dumping of JSON formatted records (-J), also to standard out.
The first mode is selected automatically when non-interactive standard out is detected.
References: https://bugs.freedesktop.org/show_bug.cgi?id=108689
Cc: Eero Tamminen <[email protected]>
Cc: [email protected]
--- man/intel_gpu_top.rst | 9 +- tools/intel_gpu_top.c | 742 +++++++++++++++++++++++++++++++++++------- 2 files changed, 630 insertions(+), 121 deletions(-)
man/intel_gpu_top.rst +7 -2
@@ -7,9 +7,9 @@ Display a top-like summary of Intel GPU usage --------------------------------------------- .. include:: defs.rst :Author: IGT Developers <[email protected]> -:Date: 2018-04-04 +:Date: 2019-02-08 :Version: |PACKAGE_STRING| -:Copyright: 2009,2011,2012,2016,2018 Intel Corporation +:Copyright: 2009,2011,2012,2016,2018,2019 Intel Corporation :Manual section: |MANUAL_SECTION| :Manual group: |MANUAL_GROUP|
@@ -31,6 +31,11 @@ OPTIONS -s <ms> Refresh period in milliseconds. +-l + List text data to standard out. + +-J + Output JSON formatted data to standard output. -h Show help text.
tools/intel_gpu_top.c +623 -119
848 lines not on this page · raw message
Signature · 6 lines
2.19.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoting Tvrtko Ursulin (2019-02-08 10:26:12)
Quoted 5 lines
From: Tvrtko Ursulin <[email protected]>
Two new output modes are added: listing of text data to standard out (-l on the command line), and dumping of JSON formatted records (-J), also to standard out.
Any chance of interactive with yaml^W json to file? -Chris
_______________________________________________
igt-dev mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoted 8 lines · Chris Wilson
Quoting Tvrtko Ursulin (2019-02-08 10:26:12)
Quoted 5 lines
From: Tvrtko Ursulin <[email protected]>
Two new output modes are added: listing of text data to standard out (-l on the command line), and dumping of JSON formatted records (-J), also to standard out.
Any chance of interactive with yaml^W json to file?
If you cannot do with shell redirection then sure, it shouldn't be hard to add.
YAML, if it follows the same patterns as JSON, also should be easy like a handful of lines.
And the latter.. I need some feedback from the users on how they plan to use it. This implementation outputs records, but if you Ctrl-C-it you get the last incomplete. And you probably need to wrap everything in [ ] to make an array of these records.
Regards,
Tvrtko
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoting Tvrtko Ursulin (2019-02-08 10:52:19)
Quoted 14 lines · Chris Wilson
Quoted 8 lines
Quoting Tvrtko Ursulin (2019-02-08 10:26:12)
Quoted 5 lines
From: Tvrtko Ursulin <[email protected]>
Two new output modes are added: listing of text data to standard out (-l on the command line), and dumping of JSON formatted records (-J), also to standard out.
Any chance of interactive with yaml^W json to file?
If you cannot do with shell redirection then sure, it shouldn't be hard to add.
Quoted 7 lines
YAML, if it follows the same patterns as JSON, also should be easy like a handful of lines.
And the latter.. I need some feedback from the users on how they plan to use it. This implementation outputs records, but if you Ctrl-C-it you get the last incomplete. And you probably need to wrap everything in [ ] to make an array of these records.
signal(SIGINT, close_output) ?
-Chris
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoted 18 lines · Chris Wilson
Quoting Tvrtko Ursulin (2019-02-08 10:52:19)
Quoted 17 lines · Chris Wilson
Quoted 8 lines
Quoting Tvrtko Ursulin (2019-02-08 10:26:12)
Quoted 5 lines
From: Tvrtko Ursulin <[email protected]>
Two new output modes are added: listing of text data to standard out (-l on the command line), and dumping of JSON formatted records (-J), also to standard out.
Any chance of interactive with yaml^W json to file?
If you cannot do with shell redirection then sure, it shouldn't be hard to add.
YAML, if it follows the same patterns as JSON, also should be easy like a handful of lines.
Quoted 6 lines
Quoted 4 lines
And the latter.. I need some feedback from the users on how they plan to use it. This implementation outputs records, but if you Ctrl-C-it you get the last incomplete. And you probably need to wrap everything in [ ] to make an array of these records.
signal(SIGINT, close_output)?
I guess.. wanted to keep it simple but this is probably warranted.
Regards,
Tvrtko
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoting Tvrtko Ursulin (2019-02-08 10:26:12)
Quoted 19 lines
tools/intel_gpu_top.c +19
-0+static unsigned int json_indent_level; + +static const char *json_indent[] = { +"" , +"\t" , +"\t\t" , +"\t\t\t" , +"\t\t\t\t" , +"\t\t\t\t\t" , +}; + +#define ARRAY_SIZE (arr) (sizeof(arr)/sizeof(arr[0])) + +static unsigned int json_prev_struct_members; +static unsigned int json_struct_members; + +static void +json_open_struct (const char *name) +{
tools/intel_gpu_top.c usage(const char *appname) · line 766
Quoted 10 lines
tools/intel_gpu_top.c +10
-0+assert (json_indent_level <ARRAY_SIZE (json_indent)); + + json_prev_struct_members = json_struct_members; + json_struct_members =0 ; + +if (name) +printf ("%s%s\"%s\": {\n" , + json_prev_struct_members ?",\n" :"" , + json_indent[json_indent_level], + name);
"%*s", json_indent_level, "\t\t\t\t\t\t"
Ok, that seems to tally with what I expect the output to look like.
Quoted 1 line
+static unsigned int
stdout_level;
Ah, stdout == plain old output.
Quoted 75 lines
tools/intel_gpu_top.c +75
-0+static int +print_header (struct engines *engines,double t, +int lines,int con_w,int con_h,bool *consumed) +{ +struct pmu_counter fake_pmu = { + .present = true, + .val.cur =1 , + }; +struct cnt_item period_items[] = { + { &fake_pmu,0 ,0 ,1.0 ,1.0 , t *1e3 ,"duration" }, + {NULL ,0 ,0 ,0.0 ,0.0 ,0.0 ,"unit" ,"ms" }, + { }, + }; +struct cnt_group period_group = { + .name ="period" , + .items = period_items, + }; +struct cnt_item freq_items[] = { + { &engines->freq_req,4 ,0 ,1.0 , t,1 ,"requested" ,"req" }, + { &engines->freq_act,4 ,0 ,1.0 , t,1 ,"actual" ,"act" }, + {NULL ,0 ,0 ,0.0 ,0.0 ,0.0 ,"unit" ,"MHz" }, + { }, + }; +struct cnt_group freq_group = { + .name ="frequency" , + .display_name ="Freq MHz" , + .items = freq_items, + }; +struct cnt_item irq_items[] = { + { &engines->irq,8 ,0 ,1.0 , t,1 ,"count" ,"/s" }, + {NULL ,0 ,0 ,0.0 ,0.0 ,0.0 ,"unit" ,"irq/s" }, + { }, + }; +struct cnt_group irq_group = { + .name ="interrupts" , + .display_name ="IRQ" , + .items = irq_items, + }; +struct cnt_item rc6_items[] = { + { &engines->rc6,3 ,0 ,1e9 , t,100 ,"value" ,"%" }, + {NULL ,0 ,0 ,0.0 ,0.0 ,0.0 ,"unit" ,"%" }, + { }, + }; +struct cnt_group rc6_group = { + .name ="rc6" , + .display_name ="RC6" , + .items = rc6_items, + }; +struct cnt_item power_items[] = { + { &engines->rapl,4 ,2 ,1.0 , t, engines->rapl_scale,"value" , +"W" }, + {NULL ,0 ,0 ,0.0 ,0.0 ,0.0 ,"unit" ,"W" }, + { }, + }; +struct cnt_group power_group = { + .name ="power" , + .display_name ="Power" , + .items = power_items, + }; +struct cnt_group *groups[] = { + &period_group, + &freq_group, + &irq_group, + &rc6_group, + &power_group, +NULL + }; + +if (output_mode !=JSON ) +memmove (&groups[0 ], &groups[1 ], +sizeof (groups) -sizeof (groups[0 ])); + + pops->open_struct (NULL ); + + *consumed =print_groups (groups);
tools/intel_gpu_top.c usage(const char *appname) · line 1096
Quoted 10 lines
tools/intel_gpu_top.c +10
-0+ +if (output_mode ==INTERACTIVE ) { +printf ("\033[H\033[J" ); + +if (lines++ < con_h) +printf ("intel-gpu-top - %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);
I would suggest a timestamp (time of day) if room.
Hang on, I don't recall seeing a timestamp amongst the output?
Looks very, very neat.
-Chris
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.BAT: success for tools/intel_gpu_top: Add support for stdout logging
In reply to Tvrtko Ursulin== Series Details ==
== Series Details ==
Series: tools/intel_gpu_top: Add support for stdout logging
URL : https://patchwork.freedesktop.org/series/56389/
State : success
== Summary ==
CI Bug Log - changes from IGT_4814 -> IGTPW_2360
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/56389/revisions/1/mbox/
Known issues
------------
Here are the changes found in IGTPW_2360 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_suspend@basic-s3:
- fi-blb-e6850: PASS -> INCOMPLETE [fdo#107718]
* igt@kms_busy@basic-flip-a:
- fi-gdg-551: NOTRUN -> FAIL [fdo#103182]
* igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a-frame-sequence:
- fi-byt-clapper: PASS -> FAIL [fdo#103191] / [fdo#107362]
* igt@kms_pipe_crc_basic@read-crc-pipe-a:
- fi-byt-clapper: PASS -> FAIL [fdo#107362]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#103182]: https://bugs.freedesktop.org/show_bug.cgi?id=103182
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109527]: https://bugs.freedesktop.org/show_bug.cgi?id=109527
Participating hosts (45 -> 45)
------------------------------
Additional (4): fi-hsw-4770r fi-byt-j1900 fi-gdg-551 fi-pnv-d510
Missing (4): fi-kbl-soraka fi-ilk-m540 fi-byt-squawks fi-bsw-cyan
Build changes
-------------
* IGT: IGT_4814 -> IGTPW_2360
CI_DRM_5566: dc8d2739325432dd969028550e9e9b3070b76db1 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2360: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2360/
IGT_4814: cec046d72944a2d559ce5bd83358f08f20454005 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2360/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.IGT: success for tools/intel_gpu_top: Add support for stdout logging
In reply to Tvrtko Ursulin== Series Details ==
== Series Details ==
Series: tools/intel_gpu_top: Add support for stdout logging
URL : https://patchwork.freedesktop.org/series/56389/
State : success
== Summary ==
CI Bug Log - changes from IGT_4814_full -> IGTPW_2360_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/56389/revisions/1/mbox/
Known issues
------------
Here are the changes found in IGTPW_2360_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_mmap_gtt@hang:
- shard-snb: NOTRUN -> FAIL [fdo#109469]
* igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-a:
- shard-snb: NOTRUN -> DMESG-WARN [fdo#107956]
* igt@kms_color@pipe-a-gamma:
- shard-kbl: PASS -> FAIL [fdo#104782]
* igt@kms_cursor_crc@cursor-256x85-random:
- shard-apl: PASS -> FAIL [fdo#103232] +3
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-pwrite:
- shard-apl: PASS -> FAIL [fdo#103167] +5
* igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-onoff:
- shard-glk: PASS -> FAIL [fdo#103167] +10
* igt@kms_frontbuffer_tracking@fbc-suspend:
- shard-kbl: PASS -> FAIL [fdo#103167] +1
* igt@kms_plane@pixel-format-pipe-a-planes-source-clamping:
- shard-apl: PASS -> FAIL [fdo#108948]
* igt@kms_plane@plane-panning-top-left-pipe-c-planes:
- shard-kbl: PASS -> FAIL [fdo#103166] +2
* igt@kms_plane@plane-position-covered-pipe-a-planes:
- shard-glk: PASS -> FAIL [fdo#103166] +6
* igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb:
- shard-glk: NOTRUN -> FAIL [fdo#108145]
* igt@kms_plane_multiple@atomic-pipe-a-tiling-y:
- shard-apl: PASS -> FAIL [fdo#103166] +5
* igt@kms_plane_multiple@atomic-pipe-c-tiling-none:
- shard-glk: NOTRUN -> FAIL [fdo#103166]
* igt@kms_setmode@basic:
- shard-apl: PASS -> FAIL [fdo#99912]
* igt@prime_busy@hang-vebox:
- shard-apl: PASS -> FAIL [fdo#108807]
#### Possible fixes ####
* igt@kms_ccs@pipe-a-crc-sprite-planes-basic:
- shard-kbl: FAIL [fdo#107725] / [fdo#108145] -> PASS
* igt@kms_color@pipe-c-ctm-max:
- shard-kbl: FAIL [fdo#108147] -> PASS
- shard-apl: FAIL [fdo#108147] -> PASS
* igt@kms_color@pipe-c-legacy-gamma:
- shard-apl: FAIL [fdo#104782] -> PASS
* igt@kms_cursor_crc@cursor-128x128-random:
- shard-apl: FAIL [fdo#103232] -> PASS +5
* igt@kms_cursor_crc@cursor-256x256-random:
- shard-kbl: FAIL [fdo#103232] -> PASS
* igt@kms_cursor_crc@cursor-256x256-suspend:
- shard-kbl: FAIL [fdo#103191] / [fdo#103232] -> PASS
- shard-apl: FAIL [fdo#103191] / [fdo#103232] -> PASS
* igt@kms_cursor_crc@cursor-256x85-sliding:
- shard-glk: FAIL [fdo#103232] -> PASS +1
* igt@kms_flip@flip-vs-expired-vblank:
- shard-glk: FAIL [fdo#102887] / [fdo#105363] -> PASS
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-cpu:
- shard-apl: FAIL [fdo#103167] -> PASS +1
* igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-mmap-gtt:
- shard-glk: FAIL [fdo#103167] -> PASS
* igt@kms_plane@pixel-format-pipe-a-planes-source-clamping:
- shard-glk: FAIL [fdo#108948] -> PASS
* igt@kms_plane@pixel-format-pipe-b-planes-source-clamping:
- shard-apl: FAIL [fdo#108948] -> PASS
* igt@kms_plane@plane-position-covered-pipe-c-planes:
- shard-glk: FAIL [fdo#103166] -> PASS +1
* igt@kms_plane_alpha_blend@pipe-b-alpha-opaque-fb:
- shard-glk: FAIL [fdo#108145] -> PASS
* igt@kms_plane_alpha_blend@pipe-b-constant-alpha-max:
- shard-apl: FAIL [fdo#108145] -> PASS
* igt@kms_plane_multiple@atomic-pipe-c-tiling-yf:
- shard-apl: FAIL [fdo#103166] -> PASS +3
- shard-kbl: FAIL [fdo#103166] -> PASS +3
* igt@kms_setmode@basic:
- shard-kbl: FAIL [fdo#99912] -> PASS
* igt@kms_vblank@pipe-c-ts-continuation-suspend:
- shard-kbl: INCOMPLETE [fdo#103665] -> PASS
#### Warnings ####
* igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-b:
- shard-snb: DMESG-WARN [fdo#107956] -> INCOMPLETE [fdo#105411]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#102887]: https://bugs.freedesktop.org/show_bug.cgi?id=102887
[fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[fdo#104782]: https://bugs.freedesktop.org/show_bug.cgi?id=104782
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#105411]: https://bugs.freedesktop.org/show_bug.cgi?id=105411
[fdo#107725]: https://bugs.freedesktop.org/show_bug.cgi?id=107725
[fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108147]: https://bugs.freedesktop.org/show_bug.cgi?id=108147
[fdo#108807]: https://bugs.freedesktop.org/show_bug.cgi?id=108807
[fdo#108948]: https://bugs.freedesktop.org/show_bug.cgi?id=108948
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109469]: https://bugs.freedesktop.org/show_bug.cgi?id=109469
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
Participating hosts (7 -> 5)
------------------------------
Missing (2): shard-skl shard-iclb
Build changes
-------------
* IGT: IGT_4814 -> IGTPW_2360
CI_DRM_5566: dc8d2739325432dd969028550e9e9b3070b76db1 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2360: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2360/
IGT_4814: cec046d72944a2d559ce5bd83358f08f20454005 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2360/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] ✓ Fi.CI.IGT: success for tools/intel_gpu_top: Add support for stdout logging
Quoting Patchwork (2019-02-08 12:11:40)
Quoted 6 lines
== Series Details ==
Series:
tools/intel_gpu_top: Add support for stdout logging
URL : https://patchwork.freedesktop.org/series/56389/
State : success
Quoted 7 lines
== Summary ==
CI Bug Log - changes from
IGT_4814_full->IGTPW_2360_full
====================================================Summary
-------
Should we add a sanitycheck to igt/tools_test.c ?
-Chris
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev