![]() |
Shamrock 2025.10.0
Astrophysical Code
|
This file contains the definition for the stacktrace related functionality. More...
#include "shambase/SourceLocation.hpp"#include "shambase/aliases_float.hpp"#include "shambase/aliases_int.hpp"#include "shambase/profiling/profiling.hpp"#include "shambase/string.hpp"#include "shambase/unique_name_macro.hpp"#include <stack>
Include dependency graph for stacktrace.hpp:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Classes | |
| struct | shambase::details::CallStackEntry |
| Helper class to manage the call stack entry. More... | |
| struct | shambase::details::BasicStackEntry |
| struct | shambase::details::NamedBasicStackEntry |
Namespaces | |
| namespace | shambase |
| namespace for basic c++ utilities | |
Macros | |
| #define | __shamrock_stack_entry() [[maybe_unused]] StackEntry __shamrock_unique_name(stack_loc_) {} |
| Macro to create a stack entry. | |
| #define | __shamrock_log_callsite(callsite) |
| Macro to create a stack entry from a given location. Can be used only on SourceLocation &&. | |
| #define | __shamrock_stack_entry_with_callsite(callsite) [[maybe_unused]] StackEntry __shamrock_unique_name(stack_loc_) { callsite } |
| Macro to create a stack entry. | |
Typedefs | |
| using | StackEntry = shambase::details::BasicStackEntry |
| Alias for shambase::details::BasicStackEntry. | |
| using | NamedStackEntry = shambase::details::NamedBasicStackEntry |
| Alias for shambase::details::NamedBasicStackEntry. | |
Functions | |
| 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::dump_profilings (const std::string &process_prefix, u32 world_rank) |
| Dump the profiling data in a JSON format to a file. | |
| void | shambase::details::dump_profilings_chrome (const std::string &process_prefix, u32 world_rank) |
| Dump the profiling data in a Chrome Tracing format. | |
| void | shambase::details::clear_profiling_data () |
| Clear the profiling data. (should be done in large run to avoid out-of-memory) | |
| std::string | shambase::fmt_callstack () |
| Get the formatted callstack. | |
| void | shambase::set_callstack_process_identifier (std::string identifier) |
| void | shambase::add_callstack_gen_info_generator (std::string(*generator)()) |
Variables | |
| std::stack< SourceLocation > | shambase::details::call_stack |
| The call stack used to keep track of the stack trace. It is used to print the stack trace when an exception is thrown. | |
This file contains the definition for the stacktrace related functionality.
Definition in file stacktrace.hpp.
| #define __shamrock_log_callsite | ( | callsite | ) |
Macro to create a stack entry from a given location. Can be used only on SourceLocation &&.
This macro defines a StackEntry variable with a unique name by leveraging the __shamrock_unique_name macro.
Definition at line 266 of file stacktrace.hpp.
| #define __shamrock_stack_entry | ( | ) | [[maybe_unused]] StackEntry __shamrock_unique_name(stack_loc_) {} |
Macro to create a stack entry.
This macro defines a StackEntry variable with a unique name by leveraging the __shamrock_unique_name macro.
Definition at line 257 of file stacktrace.hpp.
| #define __shamrock_stack_entry_with_callsite | ( | callsite | ) | [[maybe_unused]] StackEntry __shamrock_unique_name(stack_loc_) { callsite } |
Macro to create a stack entry.
This macro defines a StackEntry variable with a unique name by leveraging the __shamrock_unique_name macro.
Definition at line 277 of file stacktrace.hpp.
Alias for shambase::details::NamedBasicStackEntry.
This alias is used to simplify the use of the NamedBasicStackEntry class.
Definition at line 249 of file stacktrace.hpp.
Alias for shambase::details::BasicStackEntry.
This alias is used to simplify the use of the BasicStackEntry class.
Definition at line 242 of file stacktrace.hpp.
| 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:
|
inline |
The call stack used to keep track of the stack trace. It is used to print the stack trace when an exception is thrown.
Definition at line 84 of file stacktrace.hpp.