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

Function MightTrace

tensorflow/core/common_runtime/executor.cc:660–677  ·  view source on GitHub ↗

Returns true if `item` might be traced by the given trace and event collectors. Returns false only if `item` definitely will not be traced.

Source from the content-addressed store, hash-verified

658// Returns true if `item` might be traced by the given trace and event
659// collectors. Returns false only if `item` definitely will not be traced.
660bool MightTrace(const NodeItem& item,
661 const tracing::EventCollector* event_collector) {
662 // Tracing will only be enabled if either `event_collector` is non null,
663 // or `trace_collector` is non-null and enabled for this particular kernel.
664 // Although `profiler::TraceMe`, `tracing::ScopedAnnotation`, and
665 // `tracing::ScopedRegion` check subsets of these properties internally in
666 // their constructors, the cost of passing the necessary arguments to them can
667 // be significant, so we avoid constructing them in the common case (when we
668 // know they will not be used).
669 if (event_collector != nullptr) {
670 return true;
671 }
672
673 if (tracing::ScopedAnnotation::IsEnabled()) return true;
674
675 return profiler::TraceMeRecorder::Active(
676 profiler::GetTFTraceMeLevel(item.kernel->IsExpensive()));
677}
678
679template <class PropagatorStateType>
680Status ExecutorState<PropagatorStateType>::ProcessSync(

Callers 1

ProcessSyncMethod · 0.85

Calls 3

IsEnabledFunction · 0.85
GetTFTraceMeLevelFunction · 0.85
IsExpensiveMethod · 0.45

Tested by

no test coverage detected