sdk: Make the tracing SDK compatible with MSVC

This patch makes the tracing SDK compile with MSVC. The main changes
are:

1) Working around an issue in the track event trace point where a
   constexpr variable incorrectly loses its constexpr-ness when accessed
   from a lambda.

2) Enabling "standards-compliant" mode with /permissive- to enable a
   fix for a recently addressed compiler bug[1] with explicit template
   member instantiation.

3) Working around another compiler bug[2] with thread_local template
   member instantiation. This bug has yet to be addressed, but the
   workaround doesn't appear to have adverse side-effects as long as
   PERFETTO_DECLARE_DATA_SOURCE_STATIC_MEMBERS and
   PERFETTO_DEFINE_DATA_SOURCE_STATIC_MEMBERS are used consistently.

The minimum supported compiler version is Visual Studio 2019 v16.5.

Bug: 174454879

[1] https://developercommunity.visualstudio.com/content/problem/319447/explicit-specialization-of-static-data-member-inco.html
[2] https://developercommunity2.visualstudio.com/t/Unable-to-specialize-static-thread_local/130268

Change-Id: I6270e9646e7f02f0d4c881b8d6634c606e981bb0
7 files changed
tree: a4c75774580c70f554f69adf2c22bd8ca46bb46a
  1. .github/
  2. bazel/
  3. build_overrides/
  4. buildtools/
  5. debian/
  6. docs/
  7. examples/
  8. gn/
  9. include/
  10. infra/
  11. protos/
  12. src/
  13. test/
  14. tools/
  15. ui/
  16. .clang-format
  17. .clang-tidy
  18. .gitignore
  19. .gn
  20. .style.yapf
  21. Android.bp
  22. Android.bp.extras
  23. BUILD
  24. BUILD.extras
  25. BUILD.gn
  26. CHANGELOG
  27. codereview.settings
  28. heapprofd.rc
  29. LICENSE
  30. METADATA
  31. MODULE_LICENSE_APACHE2
  32. OWNERS
  33. perfetto.rc
  34. PRESUBMIT.py
  35. README.chromium
  36. README.md
  37. TEST_MAPPING
  38. traced_perf.rc
  39. WORKSPACE
README.md

Perfetto - System profiling, app tracing and trace analysis

Perfetto is a production-grade open-source stack for performance instrumentation and trace analysis. It offers services and libraries and for recording system-level and app-level traces, native + java heap profiling, a library for analyzing traces using SQL and a web-based UI to visualize and explore multi-GB traces.

See https://perfetto.dev/docs or the /docs/ directory for documentation.