[Mesa-dev] [PATCH v2] intel: aubinator: use different colors to signal batch start/end

Lionel Landwerlin lionel.g.landwerlin at intel.com
Mon Oct 17 16:28:16 UTC 2016


Hi Ken,

Sure, I guess this all depends on your terminal's background color (mine 
is white).
Let's go with your version, having some distinction already helps :)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>

On 17/10/16 17:11, Kenneth Graunke wrote:
> From: Lionel Landwerlin <llandwerlin at gmail.com>
>
> This makes the stream of commands a bit easier to read.
>
> v2 (Ken): Use bold text on green headers for easier readability;
>            swap the green and blue headers so the majority stay blue.
>
> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>   src/intel/tools/aubinator.c | 15 ++++++++++-----
>   1 file changed, 10 insertions(+), 5 deletions(-)
>
> Hi Lionel,
>
> Your patch makes most headers basically unreadable in my terminal
> (Konsole with the "Linux Colors" scheme):
> http://whitecape.org/paste/konsole-linux-colors-aubinator-ll.png
>
> How about this instead?  With bold text, the green is reasonably
> readable, but I still find the blue nicer, so I kept that on the
> majority of headers.  The bright green makes the batch start/end
> stand out, which is a nice visual cue...
>
> http://whitecape.org/paste/konsole-linux-colors-aubinator-kl.png
>
> diff --git a/src/intel/tools/aubinator.c b/src/intel/tools/aubinator.c
> index d716a65..31c1f89 100644
> --- a/src/intel/tools/aubinator.c
> +++ b/src/intel/tools/aubinator.c
> @@ -50,8 +50,9 @@
>   #define AUB_MI_BATCH_BUFFER_END (0x0500 << 16)
>   
>   #define CSI "\e["
> -#define HEADER CSI "37;44m"
> -#define NORMAL CSI "0m"
> +#define BLUE_HEADER  CSI "0;44m"
> +#define GREEN_HEADER CSI "1;42m"
> +#define NORMAL       CSI "0m"
>   
>   /* options */
>   
> @@ -727,9 +728,13 @@ parse_commands(struct gen_spec *spec, uint32_t *cmds, int size, int engine)
>         const char *color, *reset_color = NORMAL;
>         uint64_t offset;
>   
> -      if (option_full_decode)
> -         color = HEADER;
> -      else
> +      if (option_full_decode) {
> +         if ((p[0] & 0xffff0000) == AUB_MI_BATCH_BUFFER_START ||
> +             (p[0] & 0xffff0000) == AUB_MI_BATCH_BUFFER_END)
> +            color = GREEN_HEADER;
> +         else
> +            color = BLUE_HEADER;
> +      } else
>            color = NORMAL;
>   
>         if (option_color == COLOR_NEVER) {




More information about the mesa-dev mailing list