Match dynamic counter sources

When capturing a profile of your application, the application, or other sources such as the Graphics Analyzer layer driver, can generate software counters. Software counters sometimes require namespacing, for example reporting unique values per graphics context. To include counters using namespaced names in your templates, create a wildcard series to match a counter using a fixed prefix string and a variable post-fix.

Procedure

  1. Create a chart configuration template, as described in Create a chart configuration template. Click the Create new wildcard series button in your chart, then enter part of a counter name with a wildcard * for the new series to match with intercepted counters.

    Note

    The supported wildcard format is $<Prefix>*, where <Prefix> is the start of the counter name that you want to match.

    The wildcard creates a match_with attribute in your template. The match_with attribute specifies the variable name pattern that is used to match variables by the template. For example, it can be used to match the EGL Context suffix (a hex number) that is appended to variable names by the Graphics Analyzer layer driver.

    This example shows how a wildcard (*) is used to specify all counters that start with DrawCallsFramEGLContext.

    <chart title="Draw calls" series_composition="stacked" rendering_type="filled" average_selection="yes">
    <series name="Draw calls EGLContext ${*}" match_with="$DrawCallsFrameEGLContext*" \
      description="The number of draw calls." display="AVERAGE" color="246,138,51"
    units="draw calls"/>
    </chart>
    
  2. Apply your wildcard configuration template to your charts in Live view or Timeline view. Open the Select Counters dialog box, click Switch and manage templates, and select your template containing the wildcard name.

    Select wildcard template.
  3. Expand your chart and see the matched chart series with their expressions.

    Note

    The expression for the chart series now shows the full matched variable name, instead of the wildcard pattern. You can change the color of the chart series to help distinguish between different series, but the color is not persistent. The Name and Expression cannot be edited.

    Expanded wildcard chart series.
  4. To change the color of the wildcard series, select the Auto Color checkbox, or click the color box to open the Color dialog box.

    Wildcard chart series Auto Color checkbox.

    Note

    When you save your template, the color of the wildcard series is saved.