SpiNNFrontEndCommon 7.1.1
Common support code for user-facing front end systems.
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions | Variables
profiler.h File Reference

Support for code profiling. More...

#include <stdint.h>
#include <spin1_api.h>

Go to the source code of this file.

Data Structures

struct  profiler_region
 The layout of the profiler's DSG region. More...
 
struct  profiler_state
 The internal state of the profiler. More...
 

Macros

#define PROFILER_N_HEADER_WORDS   1
 Number of words in profile region not filled with actual profile data.
 

Enumerations

enum  profiler_event { PROFILER_ENTER = 1 << 31 , PROFILER_EXIT = 0 }
 Types of profiler event. More...
 

Functions

void profiler_init (uint32_t *data_region)
 Initialise the profiler from a SDRAM region.
 
void profiler_finalise (void)
 Finalises profiling.
 
static void profiler_write_entry (uint32_t tag)
 Write a profiler entry.
 
static void profiler_write_entry_disable_irq_fiq (uint32_t tag)
 Write an entry with all interrupts disabled.
 
static void profiler_write_entry_disable_fiq (uint32_t tag)
 Write an entry with just fast interrupts disabled.
 

Variables

struct profiler_state profiler_state
 The concrete profiler state.
 

Detailed Description

Support for code profiling.

The profiler is known to have an impact on performance, and requires the use of the secondary system timer for this core.

Definition in file profiler.h.


Data Structure Documentation

◆ profiler_region

struct profiler_region

The layout of the profiler's DSG region.

Definition at line 47 of file profiler.h.

Data Fields
uint32_t count The number of samples taken.
uint32_t samples[] The samples.

Each sample is the timestamp (taken from a free-running timer) at the point a sample was taken, and a tag identifying what the sample point was. (Two words. Not formed into a structure for historical reasons.)

◆ profiler_state

struct profiler_state

The internal state of the profiler.

Definition at line 59 of file profiler.h.

Data Fields
uint32_t * count Points to where the profiling data starts being stored.
uint32_t samples_remaining How many samples can be written before space is exhausted.
uint32_t * output Points to where the next sample will be written.

Macro Definition Documentation

◆ PROFILER_N_HEADER_WORDS

#define PROFILER_N_HEADER_WORDS   1

Number of words in profile region not filled with actual profile data.

Definition at line 28 of file profiler.h.

Enumeration Type Documentation

◆ profiler_event

Types of profiler event.

Definition at line 78 of file profiler.h.

Function Documentation

◆ profiler_init()

void profiler_init ( uint32_t data_region)

Initialise the profiler from a SDRAM region.

Parameters
data_regionThe pointer to the region, which must be laid out according to the profiler_region structure.

Definition at line 34 of file profiler.c.

◆ profiler_finalise()

void profiler_finalise ( void  )

Finalises profiling.

This includes the potentially slow process of writing to profiler_region::count

Definition at line 51 of file profiler.c.

◆ profiler_write_entry()

static void profiler_write_entry ( uint32_t  tag)
inlinestatic

Write a profiler entry.

Parameters
[in]tagValue that identifies the location being profiled.

Requires two words of profiler storage to record an entry, one for the high-resolution timestamp and one for the tag.

Definition at line 99 of file profiler.h.

◆ profiler_write_entry_disable_irq_fiq()

static void profiler_write_entry_disable_irq_fiq ( uint32_t  tag)
inlinestatic

Write an entry with all interrupts disabled.

Parameters
[in]tagValue that identifies the location being profiled.

See profiler_write_entry().

Definition at line 111 of file profiler.h.

◆ profiler_write_entry_disable_fiq()

static void profiler_write_entry_disable_fiq ( uint32_t  tag)
inlinestatic

Write an entry with just fast interrupts disabled.

Parameters
[in]tagValue that identifies the location being profiled.

See profiler_write_entry().

Definition at line 122 of file profiler.h.

Variable Documentation

◆ profiler_state

The concrete profiler state.

Definition at line 29 of file profiler.c.