[Mesa-dev] [PATCH 1/2] intel/aubinator_error_decode: Avoid printing long ascii85 lines

Chris Wilson chris at chris-wilson.co.uk
Fri Apr 7 07:50:23 UTC 2017


On Thu, Apr 06, 2017 at 01:37:54PM -0700, Jordan Justen wrote:
> Since '---' can exist within an ascii85 encoded string, we should
> avoid these strings when looking for header lines in the error state
> file.
> 
> One of the things we do inside the 'if (dashes) {' block is to print
> the entire line. Since these the ascii85 lines are extremely long it
> makes it difficult to then view the aubinator_error_decode output.
> 
> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> ---
>  src/intel/tools/aubinator_error_decode.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/src/intel/tools/aubinator_error_decode.c b/src/intel/tools/aubinator_error_decode.c
> index 2e623698ed1..21386fef8a9 100644
> --- a/src/intel/tools/aubinator_error_decode.c
> +++ b/src/intel/tools/aubinator_error_decode.c
> @@ -349,6 +349,7 @@ read_data_file(FILE *file)
>     while (getline(&line, &line_size, file) > 0) {
>        char *new_ring_name = NULL;
>        char *dashes;
> +      bool ascii85_start = line[0] == ':' || line[0] == '~';
>        line_number++;
>  
>        if (sscanf(line, "%m[^ ] command stream\n", &new_ring_name) > 0) {
> @@ -356,7 +357,7 @@ read_data_file(FILE *file)
>           ring_name = new_ring_name;
>        }

Just handle ascii85_start here, they are unique line[0].

decode() needs a few fixes to use the right pair of ring/buffer names
and to not execute after every line (needs a *count = 0; restored).
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the mesa-dev mailing list