7#ifndef _NRF_PROFILER_H_
8#define _NRF_PROFILER_H_
18#include <zephyr/types.h>
19#include <zephyr/sys/util.h>
20#include <zephyr/sys/__assert.h>
22#ifndef CONFIG_NRF_PROFILER_MAX_NUMBER_OF_APP_EVENTS
24#define CONFIG_NRF_PROFILER_MAX_NUMBER_OF_APP_EVENTS 0
27#ifndef CONFIG_NRF_PROFILER_NUMBER_OF_INTERNAL_EVENTS
29#define CONFIG_NRF_PROFILER_NUMBER_OF_INTERNAL_EVENTS 0
33#define NRF_PROFILER_MAX_NUMBER_OF_APPLICATION_AND_INTERNAL_EVENTS \
34 ((CONFIG_NRF_PROFILER_MAX_NUMBER_OF_APP_EVENTS) + \
35 (CONFIG_NRF_PROFILER_NUMBER_OF_INTERNAL_EVENTS))
71#ifdef CONFIG_NRF_PROFILER
87#ifdef CONFIG_NRF_PROFILER
96#ifdef CONFIG_NRF_PROFILER
108#ifdef CONFIG_NRF_PROFILER
125 if (IS_ENABLED(CONFIG_NRF_PROFILER)) {
126 __ASSERT_NO_MSG(nrf_profiler_event_id <
128 return atomic_test_bit(_nrf_profiler_event_enabled_bm.
flags, nrf_profiler_event_id);
145#ifdef CONFIG_NRF_PROFILER
152 uint8_t arg_cnt) {
return 0; }
160#ifdef CONFIG_NRF_PROFILER
174#ifdef CONFIG_NRF_PROFILER
189#ifdef CONFIG_NRF_PROFILER
204#ifdef CONFIG_NRF_PROFILER
219#ifdef CONFIG_NRF_PROFILER
234#ifdef CONFIG_NRF_PROFILER
249#ifdef CONFIG_NRF_PROFILER
266#ifdef CONFIG_NRF_PROFILER
270 const char *
string) {}
284#ifdef CONFIG_NRF_PROFILER
286 const void *mem_address);
289 const void *mem_address) {}
306#ifdef CONFIG_NRF_PROFILER
310 uint16_t event_type_id) {}
void nrf_profiler_log_encode_uint8(struct log_event_buf *buf, uint8_t data)
Encode and add uint8_t data type to a buffer.
#define NRF_PROFILER_MAX_NUMBER_OF_APPLICATION_AND_INTERNAL_EVENTS
Definition nrf_profiler.h:33
nrf_profiler_arg
Data types for profiling.
Definition nrf_profiler.h:56
@ NRF_PROFILER_ARG_U8
Definition nrf_profiler.h:57
@ NRF_PROFILER_ARG_STRING
Definition nrf_profiler.h:63
@ NRF_PROFILER_ARG_TIMESTAMP
Definition nrf_profiler.h:64
@ NRF_PROFILER_ARG_S32
Definition nrf_profiler.h:62
@ NRF_PROFILER_ARG_U32
Definition nrf_profiler.h:61
@ NRF_PROFILER_ARG_U16
Definition nrf_profiler.h:59
@ NRF_PROFILER_ARG_S16
Definition nrf_profiler.h:60
@ NRF_PROFILER_ARG_S8
Definition nrf_profiler.h:58
void nrf_profiler_log_send(struct log_event_buf *buf, uint16_t event_type_id)
Send data from the buffer to the host.
void nrf_profiler_log_start(struct log_event_buf *buf)
Initialize a buffer for the data of an event.
void nrf_profiler_term(void)
Terminate the Profiler.
static bool is_profiling_enabled(size_t nrf_profiler_event_id)
Check if profiling is enabled for a given event type.
Definition nrf_profiler.h:123
void nrf_profiler_log_encode_uint32(struct log_event_buf *buf, uint32_t data)
Encode and add uint32_t data type to a buffer.
void nrf_profiler_log_add_mem_address(struct log_event_buf *buf, const void *mem_address)
Encode and add the event's address in memory to the buffer.
const char * nrf_profiler_get_event_descr(size_t nrf_profiler_event_id)
Retrieve the description of an event type.
void nrf_profiler_log_encode_int32(struct log_event_buf *buf, int32_t data)
Encode and add int32_t data type to a buffer.
int nrf_profiler_init(void)
Initialize the Profiler.
uint16_t nrf_profiler_register_event_type(const char *name, const char *const *args, const enum nrf_profiler_arg *arg_types, uint8_t arg_cnt)
Register an event type.
void nrf_profiler_log_encode_string(struct log_event_buf *buf, const char *string)
Encode and add string to a buffer.
void nrf_profiler_log_encode_uint16(struct log_event_buf *buf, uint16_t data)
Encode and add uint16_t data type to a buffer.
void nrf_profiler_log_encode_int16(struct log_event_buf *buf, int16_t data)
Encode and add int16_t data type to a buffer.
uint8_t nrf_profiler_num_events
Number of event types registered in the Profiler.
void nrf_profiler_log_encode_int8(struct log_event_buf *buf, int8_t data)
Encode and add int8_t data type to a buffer.
uint8_t * payload
Definition nrf_profiler.h:73
uint8_t payload_start[CONFIG_NRF_PROFILER_CUSTOM_EVENT_BUF_LEN]
Definition nrf_profiler.h:75
Buffer required for data that is sent with the event.
Definition nrf_profiler.h:70
atomic_t flags[ATOMIC_BITMAP_SIZE(((0)+(0)))]
Definition nrf_profiler.h:41
Bitmask indicating event is enabled. This structure is private to nrf_profiler and should not be refe...
Definition nrf_profiler.h:40