3.7.2. An example TraceEnable configuration

This example is applicable to ETMv1.2 or later.

Suppose that you want to configure the activation of TraceEnable to turn tracing on when function X is called, and off when it ends. At the same time, you want to ensure that calls to the C library, and code at a fixed address range, for example, calls to a subfunction, must not be traced.

The simplified diagram of the TraceEnable configuration required is shown in Figure 3.79.

Figure 3.79. Example TraceEnable configuration

To view this graphic, your browser must support the SVG format. Either install a browser with native support, or install an appropriate plugin such as Adobe SVG Viewer.


The contents of the range and comparison inputs required are listed in Table 3.92.

Table 3.92. Example comparator inputs

Comparator

Contents

Address comparator 1

Function X entry point

Address comparator 2

First function X exit point

Address comparator 3

Second function X exit point

Address comparator 4

Third function X exit point

Address range 3

Sub-function address range to exclude

Address range 4

C library code address range to exclude


To configure TraceEnable for this example, proceed as follows:

  1. Program ETMTEEVR as Figure 3.80 shows.

    Figure 3.80. ETMTEEVR example

    To view this graphic, your browser must support the SVG format. Either install a browser with native support, or install an appropriate plugin such as Adobe SVG Viewer.


    The encoding in Figure 3.80 selects Boolean function A, together with external input 16. This permanently enables the TraceEnable event.

  2. Program the ETMTECR1 as Figure 3.81 shows.

    Figure 3.81. ETMTECR1 example

    To view this graphic, your browser must support the SVG format. Either install a browser with native support, or install an appropriate plugin such as Adobe SVG Viewer.


    Table 3.93Table 3.93 describes the values for this setting of ETMTECR1.

    Table 3.93. ETMTECR1 example values

    Bit

    For this example:
    Value

    Description

    [25]

    1

    Trace start/stop enable. Tracing is controlled by trace on and off addresses.

    [24]

    1

    Include/exclude control. Exclude.

    The resources specified in bits [23:0] and in ETMTECR2 indicate regions to be excluded from the trace. When outside an exclude region, tracing can occur.

    [23:8]

    0x0000

    Selects no memory map decodes for include/exclude control.

    [7:4]

    b0000

    These address range comparators are not selected.

    [3:2]

    b11

    Address range comparators 3 and 4 are selected.

    [1:0]

    b00

    These address range comparators are not selected.


    Bit [25], the tracing on/off bit, of ETMTECR1 is set on, to show that on/off addresses have been specified. Bit [24], the include/exclude bit, is set to exclude, to show that the referenced resources are excluded. Bits [23:8] show that no memory map decodes are referenced. Address range comparators 3 and 4 are indicated by bit [2] and bit [3].

  3. Program ETMTSSCR as Figure 3.82 shows:

    Figure 3.82. ETMTSSCR example

    To view this graphic, your browser must support the SVG format. Either install a browser with native support, or install an appropriate plugin such as Adobe SVG Viewer.


    ETMTSSCR selects address comparator 1 to turn trace on, and address comparators 2, 3, and 4 to turn trace off.

No single addresses are to be excluded in this example, so you must program ETMTECR2 to zero.

Copyright © 1999-2002, 2004-2009, 2011 ARM Limited. All rights reserved.ARM IHI 0014Q
Non-ConfidentialID101211