未验证 提交 a089072c 编写于 作者: W wangchaochaohu 提交者: GitHub

fix the profile print error (#22665)

* fix the profile print error test=develop
上级 6abeb5c5
......@@ -141,9 +141,7 @@ void PopEvent(const std::string &name) {
RecordEvent::RecordEvent(const std::string &name, const RecordRole role)
: is_enabled_(false), start_ns_(PosixInNsec()), role_(role) {
if (g_state == ProfilerState::kDisabled || name.empty()) return;
if ((g_tracer_option == TracerOption::kOpDetail &&
role_ != RecordRole::kInnerOp) ||
(g_tracer_option == TracerOption::kDefault &&
if ((g_tracer_option == TracerOption::kDefault &&
role != RecordRole::kOrdinary))
return;
// lock is not needed, the code below is thread-safe
......
......@@ -94,7 +94,7 @@ void PopEvent(const std::string& name);
struct RecordEvent {
RecordEvent(const std::string& name,
const RecordRole r_type = RecordRole::kOrdinary);
const RecordRole role = RecordRole::kOrdinary);
~RecordEvent();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册