From a089072c8b1a9290a9081eb1ffd9bda0839a524d Mon Sep 17 00:00:00 2001 From: wangchaochaohu Date: Wed, 19 Feb 2020 23:55:06 +0800 Subject: [PATCH] fix the profile print error (#22665) * fix the profile print error test=develop --- paddle/fluid/platform/profiler.cc | 4 +--- paddle/fluid/platform/profiler.h | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/paddle/fluid/platform/profiler.cc b/paddle/fluid/platform/profiler.cc index 07659e596e..dabd2af6af 100644 --- a/paddle/fluid/platform/profiler.cc +++ b/paddle/fluid/platform/profiler.cc @@ -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 diff --git a/paddle/fluid/platform/profiler.h b/paddle/fluid/platform/profiler.h index eb135475b5..3b82160647 100644 --- a/paddle/fluid/platform/profiler.h +++ b/paddle/fluid/platform/profiler.h @@ -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(); -- GitLab