![]() |
Shamrock 2025.10.0
Astrophysical Code
|
#include "shambase/stacktrace.hpp"#include "shambase/time.hpp"#include <sstream>#include <string>#include <vector>
Include dependency graph for stacktrace.cpp:Go to the source code of this file.
Classes | |
| struct | shambase::details::ChromeProfileEntry |
| Chrome tracing profile entry. More... | |
| struct | shambase::details::ProfileEntry |
| Structure to hold data for a profiling entry. More... | |
Namespaces | |
| namespace | shambase |
| namespace for basic c++ utilities | |
Functions | |
| void | shambase::details::add_entry_chrome (std::source_location loc, f64 time, bool is_start) |
| Add a Chrome tracing entry to the storage. | |
| void | shambase::details::clear_chrome_entry () |
| Clear the Chrome tracing entries storage. | |
| void | shambase::details::dump_profilings_chrome (const std::string &process_prefix, u32 world_rank) |
| Dump the profiling data in a Chrome Tracing format. | |
| f64 | shambase::details::get_wtime () |
| Returns the current wall clock time in seconds. | |
| void | shambase::details::register_profile_entry_start (std::source_location loc, f64 start_time) |
| Register the start of a profile entry. This is required for chrome profiling as there is a separate entry for start and end. | |
| void | shambase::details::register_profile_entry (std::source_location loc, f64 start_time, f64 end_time) |
| Register a profile entry. This register the end of a profile entry for chrome tracing and a complete entry in the builtin profiling data. | |
| void | shambase::details::clear_profiling_data () |
| Clear the profiling data. (should be done in large run to avoid out-of-memory) | |
| void | shambase::details::dump_profilings (const std::string &process_prefix, u32 world_rank) |
| Dump the profiling data in a JSON format to a file. | |
| void | shambase::set_callstack_process_identifier (std::string identifier) |
| void | shambase::add_callstack_gen_info_generator (std::string(*generator)()) |
| std::string | shambase::fmt_callstack () |
| Get the formatted callstack. | |
Variables | |
| std::vector< ChromeProfileEntry > | shambase::details::profile_data_chrome |
| Chrome tracing entries storage. | |
| auto | shambase::details::make_timer |
| Utility to create a timer and start it. | |
| Timer | shambase::details::global_timer = make_timer() |
| Wall time global timer. | |
| std::vector< ProfileEntry > | shambase::details::profile_data |
| Vector to hold profiling entries. | |
| std::string | shambase::_callstack_process_identifier |
| std::vector< std::function< std::string()> > | shambase::_callstack_gen_info_generators |
Definition in file stacktrace.cpp.
|
inline |
Add a Chrome tracing entry to the storage.
| loc | The source location of the entry |
| time | The time of the entry |
| is_start | Whether the entry is a start or end entry |
Definition at line 70 of file stacktrace.cpp.
|
inline |
Clear the Chrome tracing entries storage.
Definition at line 83 of file stacktrace.cpp.
| void shambase::details::clear_profiling_data | ( | ) |
Clear the profiling data. (should be done in large run to avoid out-of-memory)
Definition at line 195 of file stacktrace.cpp.
Here is the call graph for this function:Dump the profiling data in a JSON format to a file.
| process_prefix | The prefix of the process name. |
| world_rank | The rank of the process. |
Definition at line 200 of file stacktrace.cpp.
Here is the call graph for this function:| void shambase::details::dump_profilings_chrome | ( | const std::string & | process_prefix, |
| u32 | world_rank | ||
| ) |
Dump the profiling data in a Chrome Tracing format.
| process_prefix | The prefix of the process name. |
| world_rank | The rank of the process. |
Definition at line 85 of file stacktrace.cpp.
| f64 shambase::details::get_wtime | ( | ) |
Returns the current wall clock time in seconds.
Get the current wall time.
Definition at line 179 of file stacktrace.cpp.
Here is the call graph for this function:| void shambase::details::register_profile_entry | ( | std::source_location | loc, |
| f64 | start_time, | ||
| f64 | end_time | ||
| ) |
Register a profile entry. This register the end of a profile entry for chrome tracing and a complete entry in the builtin profiling data.
| loc | The source location of the profile entry. |
| start_time | The start time of the profile entry. |
| end_time | The end time of the profile entry. |
Definition at line 188 of file stacktrace.cpp.
Here is the call graph for this function:| void shambase::details::register_profile_entry_start | ( | std::source_location | loc, |
| f64 | start_time | ||
| ) |
Register the start of a profile entry. This is required for chrome profiling as there is a separate entry for start and end.
| loc | The source location of the profile entry. |
| start_time | The start time of the profile entry. |
Definition at line 184 of file stacktrace.cpp.
Here is the call graph for this function:| Timer shambase::details::global_timer = make_timer() |
Wall time global timer.
Definition at line 140 of file stacktrace.cpp.
| auto shambase::details::make_timer |
Utility to create a timer and start it.
Definition at line 133 of file stacktrace.cpp.
| std::vector<ProfileEntry> shambase::details::profile_data |
Vector to hold profiling entries.
Definition at line 172 of file stacktrace.cpp.
| std::vector<ChromeProfileEntry> shambase::details::profile_data_chrome |
Chrome tracing entries storage.
Definition at line 61 of file stacktrace.cpp.