Add support for `--trace-to` for python and use it in repl tests (#28179)

* Start adding tracing start/stop functions

* Add raii-like support for tracing

* Add raii-like support for tracing

* Fix compile logic

* Switch linux, mac, android to C++17 by default

* Start outputting trace data

* Upload traces that are gathered

* Fix names

* Allow placeholders in script args too

* Allow from-string tracing

* Do not newline-separate restyle path otherwise only the first argument is processed

* Restyle

* Add some additional types

* Minor python fixes

* Import ctypes

* Things run now

* Add trace bits to our tests

* Undo restyle-diff change

* Fix some typos in naming

* Add perfetto for darwin too

* mobile-device-test.py does not suppor trace-to yet

* Make mobile device test also be able to trace. Mobile device test seems super slow

* Restyled by autopep8

* Restyled by isort

---------

Co-authored-by: Andrei Litvin <andreilitvin@google.com>
Co-authored-by: Restyled.io <commits@restyled.io>
diff --git a/.gitmodules b/.gitmodules
index 990cb20..1508216 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -307,7 +307,7 @@
 	path = third_party/perfetto/repo
 	url = https://github.com/google/perfetto.git
 	branch = master
-	platforms = linux,android
+	platforms = linux,android,darwin
 [submodule "third_party/asr/components"]
 	path = third_party/asr/components
 	url = https://github.com/asriot/asriot_components.git