MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ProfilerSession

Method ProfilerSession

tensorflow/core/profiler/lib/profiler_session.cc:196–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196ProfilerSession::ProfilerSession()
197 : active_(!session_active.exchange(true)),
198 start_time_micros_(Env::Default()->NowNanos() / EnvTime::kMicrosToNanos) {
199 if (!active_) {
200 status_ = tensorflow::Status(error::UNAVAILABLE,
201 "Another profiler session is active.");
202 return;
203 }
204
205 LOG(INFO) << "Profiler session started.";
206
207 CreateProfilers(&profilers_);
208 status_ = Status::OK();
209
210 for (auto& profiler : profilers_) {
211 auto start_status = profiler->Start();
212 if (!start_status.ok()) {
213 LOG(WARNING) << "Encountered error while starting profiler: "
214 << start_status.ToString();
215 }
216 }
217}
218
219ProfilerSession::~ProfilerSession() {
220 for (auto& profiler : profilers_) {

Callers

nothing calls this directly

Calls 7

DefaultFunction · 0.85
CreateProfilersFunction · 0.85
StatusClass · 0.50
NowNanosMethod · 0.45
StartMethod · 0.45
okMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected