Profiler

The Profiler sample demonstrates the functionality of the Profiler subsystem. It shows how to use the Profiler to log and visualize data about custom events that are not part of the Event Manager.

Overview

The sample initializes the Profiler, registers two event types, and profiles their occurrences periodically.

Event without data (no data event):

This event is used to signal the occurrence of an event only. It does not contain additional data.

Event with data (data event):

There are several numerical values associated with this event. The values are updated periodically.

Requirements

The sample supports the following development kits:

Hardware platforms

PCA

Board name

Build target

nRF9160 DK

PCA10090

nrf9160dk_nrf9160

nrf9160dk_nrf9160ns

nRF52840 DK

PCA10056

nrf52840dk_nrf52840

nrf52840dk_nrf52840

nRF52 DK

PCA10040

nrf52dk_nrf52832

nrf52dk_nrf52832

Building and running

This sample can be found under samples/profiler in the nRF Connect SDK folder structure.

See Building and programming a sample application for information about how to build and program the application.

Testing

After programming the sample to your board, you can test it by running the script real_time_plot.py (located under scripts/profiler). As an argument, pass the name that should be used to store the data. For example, run real_time_plot.py test_name to generate a test_name.csv and a test_name.json file.

The script opens a GUI window that displays events as points on timelines. See the Profiler documentation for more information.

Connect to the board with a terminal emulator (for example, PuTTY) to see messages displayed by the sample. See How to connect with PuTTY for the required settings.

Tip

If you use SEGGER Embedded Studio, make sure to stop debugging before you run Python scripts. Otherwise, you may observe problems with accessing RTT data by the profiler scripts.

Dependencies

This sample uses the following nRF Connect SDK subsystems: