Returns true if `item` might be traced by the given trace and event collectors. Returns false only if `item` definitely will not be traced.
| 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. |
| 660 | bool 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 | |
| 679 | template <class PropagatorStateType> |
| 680 | Status ExecutorState<PropagatorStateType>::ProcessSync( |
no test coverage detected