Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Namespaces | Functions
profiling.hpp File Reference
#include "shambase/SourceLocation.hpp"
#include "shambase/aliases_float.hpp"
#include "shambase/aliases_int.hpp"
#include <optional>
#include <string>
+ Include dependency graph for profiling.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  shambase
 namespace for basic c++ utilities
 

Functions

bool shambase::profiling::is_profiling_enabled ()
 Check if profiling is enabled.
 
void shambase::profiling::set_enable_nvtx (bool enable_nvtx)
 Set wether to enable NVTX profiling.
 
void shambase::profiling::set_enable_profiling (bool enable_profiling)
 Set wether to enable profiling.
 
void shambase::profiling::set_use_complete_event (bool use_complete_event)
 Use complete event, or start and begin event in chrome tracing.
 
void shambase::profiling::set_event_record_threshold (f64 threshold)
 Set the event record threshold.
 
void shambase::profiling::stack_entry_start (const SourceLocation &fileloc, f64 t_start, const std::optional< std::string > &name=std::nullopt, const std::optional< std::string > &category_name=std::nullopt)
 Register the start of a profiling event.
 
void shambase::profiling::stack_entry_end (const SourceLocation &fileloc, f64 t_start, f64 tend, const std::optional< std::string > &name=std::nullopt, const std::optional< std::string > &category_name=std::nullopt)
 Register the end of a profiling event.
 
void shambase::profiling::stack_entry_start_no_time (const SourceLocation &fileloc, const std::optional< std::string > &name=std::nullopt, const std::optional< std::string > &category_name=std::nullopt)
 Start a profiling event without a time info.
 
void shambase::profiling::stack_entry_end_no_time (const SourceLocation &fileloc, const std::optional< std::string > &name=std::nullopt, const std::optional< std::string > &category_name=std::nullopt)
 End a profiling event without a time info.
 
void shambase::profiling::register_counter_val (const std::string &name, f64 time, f64 val)
 Register a counter value.
 

Detailed Description

Author
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)

Definition in file profiling.hpp.

Function Documentation

◆ is_profiling_enabled()

bool shambase::profiling::is_profiling_enabled ( )

Check if profiling is enabled.

Definition at line 94 of file profiling.cpp.

+ Here is the call graph for this function:

◆ register_counter_val()

void shambase::profiling::register_counter_val ( const std::string &  name,
f64  time,
f64  val 
)

Register a counter value.

Parameters
nameThe name of the counter
timeThe time of the event
valThe value of the counter

Definition at line 164 of file profiling.cpp.

+ Here is the call graph for this function:

◆ set_enable_nvtx()

void shambase::profiling::set_enable_nvtx ( bool  enable_nvtx)

Set wether to enable NVTX profiling.

Parameters
enable_nvtxWhether to enable NVTX profiling

Definition at line 96 of file profiling.cpp.

+ Here is the call graph for this function:

◆ set_enable_profiling()

void shambase::profiling::set_enable_profiling ( bool  enable_profiling)

Set wether to enable profiling.

Parameters
enable_profilingWhether to enable profiling

Definition at line 97 of file profiling.cpp.

+ Here is the call graph for this function:

◆ set_event_record_threshold()

void shambase::profiling::set_event_record_threshold ( f64  threshold)

Set the event record threshold.

The threshold is the minimum time in seconds between two events, if the time between two events is smaller than the threshold, the second event will not be recorded.

Parameters
thresholdThe event record threshold

Definition at line 99 of file profiling.cpp.

+ Here is the call graph for this function:

◆ set_use_complete_event()

void shambase::profiling::set_use_complete_event ( bool  use_complete_event)

Use complete event, or start and begin event in chrome tracing.

Parameters
use_complete_eventWhether to use complete events

Definition at line 98 of file profiling.cpp.

+ Here is the call graph for this function:

◆ stack_entry_end()

void shambase::profiling::stack_entry_end ( const SourceLocation fileloc,
f64  t_start,
f64  tend,
const std::optional< std::string > &  name = std::nullopt,
const std::optional< std::string > &  category_name = std::nullopt 
)

Register the end of a profiling event.

Parameters
filelocThe source location of the function
t_startThe starting time of the event
tendThe ending time of the event
nameThe name of the event
category_nameThe name of the category

Definition at line 117 of file profiling.cpp.

+ Here is the call graph for this function:

◆ stack_entry_end_no_time()

void shambase::profiling::stack_entry_end_no_time ( const SourceLocation fileloc,
const std::optional< std::string > &  name = std::nullopt,
const std::optional< std::string > &  category_name = std::nullopt 
)

End a profiling event without a time info.

Parameters
filelocThe source location of the function
nameThe name of the event
category_nameThe name of the category

Definition at line 151 of file profiling.cpp.

+ Here is the call graph for this function:

◆ stack_entry_start()

void shambase::profiling::stack_entry_start ( const SourceLocation fileloc,
f64  t_start,
const std::optional< std::string > &  name = std::nullopt,
const std::optional< std::string > &  category_name = std::nullopt 
)

Register the start of a profiling event.

Parameters
filelocThe source location of the function
t_startThe starting time of the event
nameThe name of the event
category_nameThe name of the category

Definition at line 101 of file profiling.cpp.

+ Here is the call graph for this function:

◆ stack_entry_start_no_time()

void shambase::profiling::stack_entry_start_no_time ( const SourceLocation fileloc,
const std::optional< std::string > &  name = std::nullopt,
const std::optional< std::string > &  category_name = std::nullopt 
)

Start a profiling event without a time info.

Parameters
filelocThe source location of the function
nameThe name of the event
category_nameThe name of the category

Definition at line 138 of file profiling.cpp.

+ Here is the call graph for this function: