Configuring Barman

You must configure Barman with the configuration and generation utility before you compile the binary executable to be analyzed. Barman must then be built into the executable.

About this task

The configuration and generation utility is a wizard dialog available from the Streamline menu. The generated header and source files, and the configuration XML file, are then saved into a folder of your choice. The generation mechanism is also accessible from the command line.

Procedure

  1. Access this utility from Streamline → Generate Barman Sources.

  2. Configure the default configuration options, such as:

    • The number of processor elements.

    • Whether you intend to supply executable image memory map information.

    • Whether you intend to provide process or task level information (for example if you are running an RTOS).

    • The data storage mode (linear or circular RAM buffer).

    Select configuration options dialog.

    Barman uses statically allocated, fixed sized headers for information such as details of the active processors on the system, and task, thread, and process information.

    Max number of mmap layout records and Max number of task information records are the maximum amount of space in the header for storing the task, thread, and process information. For example, if you have an RTOS with a fixed number of threads, specify the number of threads here. Max number of mmap layout records specifies the number of address mapping entries for mapping sections of the ELF image to addresses in memory. If you have a single ELF image that is physically mapped to memory, leave this value as zero.

    The Minimum sample period is the minimum time in nanoseconds between samples. Set this value to be an integer multiple of the timer sampling rate. For example, if you have a fixed timer interrupt operating at 1000Hz, but due to memory constraints you want to sample at 100Hz, set Minimum sample period to 10000000. This value ensures that there is at least 10ms between each sample.

    To provide your own implementation of the memory functions for Barman, for example memcpy and memset, deselect Enable builtin memory functions.

    Note

    See Profiling with System Trace Macrocell for information about using the STM Interface data storage backend.

    See Profiling with Instrumentation Trace Macrocell for information about using the ITM Interface data storage backend.

    See the gator protocol documentation in <install_directory>/sw/streamline/protocol/gator/ for more information about pmus.xml and events.xml.

  3. Select the target processor from the pre-defined list.

    Select processors to target dialog.
  4. Select the PMU counters to collect during the capture session by double-clicking on them in the Available events list. Alternatively you can drag and drop the events into the Selected events list. To deselect events, drag and drop them back into the Available events list.

    Select events to trace dialog.
  5. Add custom counters.

    Add custom counters dialog.
  6. Select generator options.

    Select generator options dialog.
  7. Finish.

    Summary information.

Results

The setup process produces the following output:

  • A configuration file, barman.xml, which contains the settings that were entered into the configuration wizard, and which can be used to reproduce the same configuration later.

  • barman.c. You must compile and link this file into the bare-metal executable.

  • barman.h. You must include this header when calling any of the functions within the agent. It also declares function prototypes for the functions you must implement.

  • barman_in_memory_helpers.py. You can use this file as a use case script in Arm® Development Studio. It helps you dump the contents of the in-memory capture buffer.

You need the compiler flag --gnu for armcc (Arm® Compiler 5) to compile barman.c.