MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / print_stacktrace

Method print_stacktrace

oneflow/extension/stack/stacktrace.h:3937–3951  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3935
3936 template<typename ST>
3937 void print_stacktrace(ST& st, std::ostream& os, Colorize& colorize) {
3938 print_header(os, st.thread_id());
3939 _resolver.load_stacktrace(st);
3940 if (reverse) {
3941 for (size_t trace_idx = st.size(); trace_idx > 0; --trace_idx) {
3942 print_trace(os, _resolver.resolve(st[trace_idx - 1]), colorize);
3943 }
3944 } else {
3945 for (size_t trace_idx = 0; trace_idx < st.size(); ++trace_idx) {
3946 print_trace(os, _resolver.resolve(st[trace_idx]), colorize);
3947 }
3948 }
3949 // Modify: Add a new line before Python stack
3950 os << std::endl;
3951 }
3952
3953 template<typename IT>
3954 void print_stacktrace(IT begin, IT end, std::ostream& os, size_t thread_id, Colorize& colorize) {

Callers

nothing calls this directly

Calls 4

load_stacktraceMethod · 0.80
thread_idMethod · 0.45
sizeMethod · 0.45
resolveMethod · 0.45

Tested by

no test coverage detected