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

Method Clear

tensorflow/core/profiler/internal/traceme_recorder.cc:205–213  ·  view source on GitHub ↗

This method is performance critical and should be kept fast. It is called when tracing starts/stops. The mutex is held, so no threads can be registered/unregistered. This prevents calling ThreadLocalRecorder::Clear from two different threads.

Source from the content-addressed store, hash-verified

203// registered/unregistered. This prevents calling ThreadLocalRecorder::Clear
204// from two different threads.
205TraceMeRecorder::Events TraceMeRecorder::Clear() {
206 TraceMeRecorder::Events result;
207 std::swap(orphaned_events_, result);
208 for (const auto& entry : threads_) {
209 auto* recorder = entry.second;
210 result.push_back(recorder->Clear());
211 }
212 return result;
213}
214
215bool TraceMeRecorder::StartRecording(int level) {
216 level = std::max(0, level);

Callers 5

ExecStepClass · 0.45
FromProtoMethod · 0.45
FromProtoMethod · 0.45
ResetTotalStatsMethod · 0.45
ReInitMethod · 0.45

Calls 1

push_backMethod · 0.45

Tested by

no test coverage detected