YAC 3.21.0
Yet Another Coupler
Loading...
Searching...
No Matches
instrument_internal.h File Reference
#include "instrument.h"
Include dependency graph for instrument_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define YAC_INSTRUMENT_START(ID)    yac_instrument_start_impl((ID), __FILE__, __LINE__)
 Enter an instrumented region.
 
#define YAC_INSTRUMENT_STOP(ID)    yac_instrument_stop_impl((ID), __FILE__, __LINE__)
 Exit an instrumented region entered with YAC_INSTRUMENT_START(ID).
 

Functions

void yac_instrument_start_impl (yac_instrument_region_id id, char const *file, int line)
 Start an instrumented region. Do not call directly — use the YAC_INSTRUMENT_START macro below, which supplies the source location.
 
void yac_instrument_stop_impl (yac_instrument_region_id id, char const *file, int line)
 Stop an instrumented region. Do not call directly — use the YAC_INSTRUMENT_STOP macro below, which supplies the source location.
 

Macro Definition Documentation

◆ YAC_INSTRUMENT_START

#define YAC_INSTRUMENT_START ( ID)     yac_instrument_start_impl((ID), __FILE__, __LINE__)

Enter an instrumented region.

Must be paired with a YAC_INSTRUMENT_STOP(ID) for the same ID, reached unconditionally before the enclosing function returns (no early return/goto in between) — a skipped stop leaves the region open and is only portable (no compiler-specific scope-guard extension is used), so it is caught at runtime, not compile time: the next YAC_INSTRUMENT_START or YAC_INSTRUMENT_STOP that observes the inconsistent depth reports the file/line where the leaked region was opened.

Definition at line 60 of file instrument_internal.h.

◆ YAC_INSTRUMENT_STOP

#define YAC_INSTRUMENT_STOP ( ID)     yac_instrument_stop_impl((ID), __FILE__, __LINE__)

Exit an instrumented region entered with YAC_INSTRUMENT_START(ID).

Definition at line 66 of file instrument_internal.h.

Function Documentation

◆ yac_instrument_start_impl()

void yac_instrument_start_impl ( yac_instrument_region_id id,
char const * file,
int line )

Start an instrumented region. Do not call directly — use the YAC_INSTRUMENT_START macro below, which supplies the source location.

Parameters
idThe ID of the instrumented region to start.
fileSource file of the call (for diagnostics).
lineSource line of the call (for diagnostics).
Remarks
This function is not thread-safe and should not be called concurrently from multiple threads (e.g. from within an OpenMP parallel region).
Nesting of the same region ID is not allowed. If a region is started while already active — which also happens if a prior YAC_INSTRUMENT_STOP for it was skipped, e.g. by an early return — an assertion is triggered, reporting where the still-open region was started.

Definition at line 171 of file instrument.c.

Here is the call graph for this function:

◆ yac_instrument_stop_impl()

void yac_instrument_stop_impl ( yac_instrument_region_id id,
char const * file,
int line )

Stop an instrumented region. Do not call directly — use the YAC_INSTRUMENT_STOP macro below, which supplies the source location.

Parameters
idThe ID of the instrumented region to stop.
fileSource file of the call (for diagnostics).
lineSource line of the call (for diagnostics).
Remarks
This function is not thread-safe and should not be called concurrently from multiple threads (e.g. from within an OpenMP parallel region).
If the region is not the innermost currently-open one — which also happens if a YAC_INSTRUMENT_STOP for a more recently started region was skipped, e.g. by an early return — an assertion is triggered.

Definition at line 214 of file instrument.c.

Here is the call graph for this function: