onnxruntime/include/onnxruntime/core/common
ivberg 74028e4bdc
Fully dynamic ETW controlled logging for ORT and QNN logs (#20537)
### Description
Windows - Fully dynamic ETW controlled logging for ORT and QNN logs

The logging support is documented here 
-
https://onnxruntime.ai/docs/performance/tune-performance/logging_tracing.html#tracing---windows
-
https://onnxruntime.ai/docs/performance/tune-performance/profiling-tools.html#tracelogging-etw-windows-profiling

Also add support for logging ORT SessionCreation on ETW CaptureState

### Motivation and Context
The previous ETW support only worked if you enabled ETW before the
session started. There can commonly be long-lived AI inference processes
that need to be traced & debugged. This enables logging fully on the
fly.

Without this support a dev would have to end up killing a process or
stopping a service in order to get tracing. We had to do this for a
recent issue with QNN, and it was a bit painful to get the logs and it
ruined the repro.

### Testing
I tested with the following cases
- Leaving default ORT run
- Enabling ETW prior to start and leaving running for entire session +
inferences, then stopping
- Starting ORT session + inf, then enabling and stopping ETW
  - Start ORT session /w long running Inferences 
- wpr -start
[ort.wprp](e6228575e4/ort.wprp (L4))
-start
[etw_provider.wprp](e6228575e4/onnxruntime/test/platform/windows/logging/etw_provider.wprp)
  - Wait a few seconds
  - wpr -stop ort.etl
  - Inferences are still running
- Verify ONNXRuntimeLogEvent provider events are present and new
SessionCreation_CaptureState event under Microsoft.ML.ONNXRuntime
provider

Related:
#18882
#19428
2024-06-06 21:11:14 -07:00
..
logging Fully dynamic ETW controlled logging for ORT and QNN logs (#20537) 2024-06-06 21:11:14 -07:00
basic_types.h
code_location.h Run clang-format in CI (#15524) 2023-04-18 09:26:58 -07:00
common.h Run clang-format in CI (#15524) 2023-04-18 09:26:58 -07:00
const_pointer_container.h
denormal.h
eigen_common_wrapper.h Enable -Wshorten-64-to-32 warning if available. (#16524) 2023-07-07 08:11:44 -07:00
exceptions.h Improve compatibility with certain STL's 2023-02-21 14:06:16 -08:00
gpu_profiler_common.h Fix skew between GPU/CPU timestamps in ORT profiler (#14004) 2023-01-05 11:07:26 -08:00
gsl.h Switch GSL to MS GSL 4.0.0 (#13416) 2022-10-29 04:15:20 -07:00
hash_combine.h Update kernel matching logic: decouple from op schemas and remove kernel def hashes (#12791) 2022-09-20 14:24:59 -07:00
inlined_containers.h Run clang-format in CI (#15524) 2023-04-18 09:26:58 -07:00
inlined_containers_fwd.h Graph transformer to ensure unique DQ nodes for QDQ node units (#15145) 2023-03-31 08:39:43 +10:00
make_string.h
narrow.h Prevent GSL_SUPPRESS arguments from being modified by clang-format (#17242) 2023-08-22 18:26:53 -07:00
optional.h
parse_string.h Update kernel matching logic: decouple from op schemas and remove kernel def hashes (#12791) 2022-09-20 14:24:59 -07:00
profiler_common.h Run clang-format in CI (#15524) 2023-04-18 09:26:58 -07:00
span_utils.h Fix build - redefinition of default argument for ‘long unsigned int Extent’ (#17281) 2023-08-25 00:40:40 +08:00
spin_pause.h
status.h remove gsl to make status.h independent from gsl (#17402) 2023-09-13 21:47:43 -07:00
string_helper.h Csharp bindings for on-device training APIs (#12404) 2022-09-02 13:13:48 -07:00