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