[Mesa-dev] [PATCH 5/6] radeonsi: enable string markers and record apitrace call numbers

Marek Olšák maraeo at gmail.com
Fri Jul 1 12:24:18 UTC 2016


On Fri, Jul 1, 2016 at 2:16 PM, Bas Nieuwenhuizen
<bas at basnieuwenhuizen.nl> wrote:
> On Fri, Jul 1, 2016 at 1:21 AM, Marek Olšák <maraeo at gmail.com> wrote:
>> From: Marek Olšák <marek.olsak at amd.com>
>>
>> ---
>>  src/gallium/drivers/radeonsi/si_debug.c |  4 ++++
>>  src/gallium/drivers/radeonsi/si_pipe.c  | 20 +++++++++++++++++++-
>>  src/gallium/drivers/radeonsi/si_pipe.h  |  1 +
>>  3 files changed, 24 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/gallium/drivers/radeonsi/si_debug.c b/src/gallium/drivers/radeonsi/si_debug.c
>> index 112e686..220ce13 100644
>> --- a/src/gallium/drivers/radeonsi/si_debug.c
>> +++ b/src/gallium/drivers/radeonsi/si_debug.c
>> @@ -814,6 +814,10 @@ void si_check_vm_faults(struct r600_common_context *ctx,
>>         fprintf(f, "Device name: %s\n\n", screen->get_name(screen));
>>         fprintf(f, "Failing VM page: 0x%08x\n\n", addr);
>>
>> +       if (sctx->apitrace_call_number)
>> +               fprintf(f, "Last apitrace call: %u\n\n",
>> +                       sctx->apitrace_call_number);
>> +
>>         switch (ring) {
>>         case RING_GFX:
>>                 si_dump_debug_state(&sctx->b.b, f, 0);
>> diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
>> index 6c88fe3..f15e589 100644
>> --- a/src/gallium/drivers/radeonsi/si_pipe.c
>> +++ b/src/gallium/drivers/radeonsi/si_pipe.c
>> @@ -31,6 +31,7 @@
>>  #include "util/u_memory.h"
>>  #include "util/u_suballoc.h"
>>  #include "vl/vl_decoder.h"
>> +#include "../ddebug/dd_util.h"
>>
>>  #define SI_LLVM_DEFAULT_FEATURES \
>>         "+DumpCode,+vgpr-spilling,-fp32-denormals,+fp64-denormals"
>> @@ -106,6 +107,22 @@ si_amdgpu_get_reset_status(struct pipe_context *ctx)
>>         return sctx->b.ws->ctx_query_reset_status(sctx->b.ctx);
>>  }
>>
>> +/* Apitrace profiling:
>> + *   1) qapitrace : Tools -> Profile: Measure CPU & GPU times
>> + *   2) In the middle panel, zoom in (mouse wheel) on some bad draw call
>> + *      and remember its number.
>> + *   3) In Mesa, enable queries and performance counters around that draw
>> + *      call and print the results.
>> + *   4) glretrace --benchmark --markers ..
>> + */
>
> Were there issues that you hit with the existing apitrace performance
> counters support?

I didn't know apitrace had that. How to use it?

Marek


More information about the mesa-dev mailing list