Event Manager profiling tracer
The Event Manager profiling tracer sample demonstrates the functionality of profiling Event Manager events using the Profiler and the Event Manager profiler tracer modules.
Requirements
The sample supports the following development kits:
Hardware platforms |
PCA |
Board name |
Build target |
---|---|---|---|
PCA10090 |
|
||
PCA10040 |
|
||
PCA10056 |
|
||
nRF21540 DK |
PCA10112 |
|
Overview
The sample application consists of the following modules that communicate using events:
Module A (
module_a.c
)Module B (
module_b.c
)
Module A waits for a configuration event sent by main.c
.
After receiving this event, Module A starts sending periodic events every second to Module B.
Module A also has a counter that increases before a one_sec_event
is sent.
The counter value is transmitted during the event.
Module B waits for the one_sec_event
events from Module A.
Every time it receives a one_sec_event
, the module checks if the value it transmits is equal to 5
.
If it is equal to 5
, Module B sends a five_sec_event
to Module A.
When Module A receives a five_sec_event
from Module B, it zeros the counter, sends a series of 50 burst_event
, and simulates work for 100 ms by busy waiting.
Configuration
See Configuring your application for information about how to permanently or temporarily change the configuration.
Building and running
This sample can be found under samples/event_manager_profiler_tracer
in the nRF Connect SDK folder structure.
See Building and programming an application for information about how to build and program the application.
Testing
After programming the sample to your development kit, test it by performing the following steps:
Run the script
real_time_plot.py
located in thescripts/profiler
folder, with the name that is to be used to store the data as argument. For example, run the following command to generate atest_name.csv
and atest_name.json
file using the test_name argument:real_time_plot.py test_name
The script opens a GUI window that displays events as points on timelines, similar to the following:
Use scroll wheel to zoom into interesting parts on a GUI. See the Backend visualization in the Profiler documentation for more information about how to work with the diagram.
Click the middle mouse button to highlight an event submission or processing for tracking, and to display the event data as on a figure:
On this image, the zoom focuses on actions triggered by the fifth one-second event. The five-second event triggers 50 burst events. One event submission and corresponding processing time is highlighted in green.
Check the results for the generated
test_name.csv
andtest_name.json
files.See how events are logged with data transmitted by the event.
Dependencies
This sample uses the following nRF Connect SDK subsystems:
In addition, it uses the following Zephyr subsystems: