MCPcopy Create free account
hub / github.com/apache/brpc / OutputToStream

Method OutputToStream

src/bthread/task_tracer.cpp:101–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101void TaskTracer::Result::OutputToStream(std::ostream& os) const {
102 char symbol_name[128];
103 char unknown_symbol_name[] = "<unknown>";
104 if (frame_count > 0) {
105 for (size_t i = 0; i < frame_count; ++i) {
106 os << "# " << i << " 0x" << std::hex << ips[i] << std::dec << " ";
107 if (absl::Symbolize(ips[i], symbol_name, arraysize(symbol_name))) {
108 os << symbol_name;
109 } else {
110 os << unknown_symbol_name;
111 }
112 if (i + 1 < frame_count) {
113 os << '\n';
114 }
115 }
116 } else {
117 os << "No frame";
118 }
119 if (error) {
120 os << "\nError message: " << err_msg;
121 }
122}
123
124bool TaskTracer::Init() {
125 if (_trace_time.expose("bthread_trace_time") != 0) {

Callers 3

TEST_FFunction · 0.45
CheckDebugOutputToStreamFunction · 0.45
TraceMethod · 0.45

Calls

no outgoing calls

Tested by 2

TEST_FFunction · 0.36
CheckDebugOutputToStreamFunction · 0.36