[Mesa-dev] [PATCH v2 12/42] i965: Add debug flag to print out the new L3 state during transitions.

Francisco Jerez currojerez at riseup.net
Sun Nov 22 06:17:18 PST 2015


Jordan Justen <jordan.l.justen at intel.com> writes:

> On 2015-11-17 21:54:44, Jordan Justen wrote:
>> From: Francisco Jerez <currojerez at riseup.net>
>> 
>> ---
>>  src/mesa/drivers/dri/i965/gen7_l3_state.c | 17 +++++++++++++++++
>>  src/mesa/drivers/dri/i965/intel_debug.c   |  1 +
>>  src/mesa/drivers/dri/i965/intel_debug.h   |  1 +
>>  3 files changed, 19 insertions(+)
>> 
>> diff --git a/src/mesa/drivers/dri/i965/gen7_l3_state.c b/src/mesa/drivers/dri/i965/gen7_l3_state.c
>> index 58eb07b..45bad02 100644
>> --- a/src/mesa/drivers/dri/i965/gen7_l3_state.c
>> +++ b/src/mesa/drivers/dri/i965/gen7_l3_state.c
>> @@ -435,6 +435,18 @@ update_urb_size(struct brw_context *brw, const struct brw_l3_config *cfg)
>>     }
>>  }
>>  
>> +/**
>> + * Print out the specified L3 configuration.
>> + */
>> +static void
>> +dump_l3_config(const struct brw_l3_config *cfg)
>> +{
>> +   fprintf(stderr, "SLM=%d URB=%d ALL=%d DC=%d RO=%d IS=%d C=%d T=%d\n",
>> +           cfg->n[L3P_SLM], cfg->n[L3P_URB], cfg->n[L3P_ALL],
>> +           cfg->n[L3P_DC], cfg->n[L3P_RO],
>> +           cfg->n[L3P_IS], cfg->n[L3P_C], cfg->n[L3P_T]);
>> +}
>> +
>>  static void
>>  emit_l3_state(struct brw_context *brw)
>>  {
>> @@ -464,6 +476,11 @@ emit_l3_state(struct brw_context *brw)
>>        setup_l3_config(brw, cfg);
>>        update_urb_size(brw, cfg);
>>        brw->l3.config = cfg;
>> +
>> +      if (unlikely(INTEL_DEBUG & DEBUG_L3)) {
>
> Do you think we need the debug flag for this? What about adding this
> code with if (0)? Maybe you forsee more commonly useful debug messages
> being added later? Maybe 'cache' rather than 'l3'?
>
It seems useful to be able to find out at run-time what L3 partitioning
the application used in order to analyze performance problems.  "cache"
seems rather vague, how many other hardware and software caches do we
have the user may not care about?  I considered using "perf" for this
but I'm not sure it's a good fit because most other messages it prints
out are warnings about issues likely to affect performance negatively,
while L3 transition messages shouldn't be interpreted as a warning sign
since they're in most cases harmless.

> Either way, you can add
> Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
>
Thanks.

>> +         fprintf(stderr, "L3 config transition (%f > %f): ", dw, dw_threshold);
>> +         dump_l3_config(cfg);
>> +      }
>>     }
>>  }
>>  
>> diff --git a/src/mesa/drivers/dri/i965/intel_debug.c b/src/mesa/drivers/dri/i965/intel_debug.c
>> index f53c4ab..3fe941c 100644
>> --- a/src/mesa/drivers/dri/i965/intel_debug.c
>> +++ b/src/mesa/drivers/dri/i965/intel_debug.c
>> @@ -79,6 +79,7 @@ static const struct debug_control debug_control[] = {
>>     { "tcs",         DEBUG_TCS },
>>     { "ds",          DEBUG_TES },
>>     { "tes",         DEBUG_TES },
>> +   { "l3",          DEBUG_L3 },
>>     { NULL,    0 }
>>  };
>>  
>> diff --git a/src/mesa/drivers/dri/i965/intel_debug.h b/src/mesa/drivers/dri/i965/intel_debug.h
>> index 9c6030a..5d3f97a 100644
>> --- a/src/mesa/drivers/dri/i965/intel_debug.h
>> +++ b/src/mesa/drivers/dri/i965/intel_debug.h
>> @@ -71,6 +71,7 @@ extern uint64_t INTEL_DEBUG;
>>  #define DEBUG_NO_COMPACTION       (1ull << 35)
>>  #define DEBUG_TCS                 (1ull << 36)
>>  #define DEBUG_TES                 (1ull << 37)
>> +#define DEBUG_L3                  (1ull << 38)
>>  
>>  #ifdef HAVE_ANDROID_PLATFORM
>>  #define LOG_TAG "INTEL-MESA"
>> -- 
>> 2.6.2
>> 
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20151122/15001f61/attachment.sig>


More information about the mesa-dev mailing list