0fee95455c
Move away from setting command line flags and calling Cleanup or Init to reinitialize the profiler. Split starting and stopping the profiler into separate methods and keep only one-time initialization/cleanup in Init and Cleanup methods. Create a separate method for reconfiguring the profiler Profiler::SetConfig. This removes data races which were plaguing older code and makes it simpler to reason about. Fixes https://github.com/dart-lang/sdk/issues/62038 Fixes https://github.com/dart-lang/sdk/issues/61828 TEST=ci Cq-Include-Trybots: luci.dart.try:vm-tsan-mac-release-arm64-try,vm-tsan-linux-release-x64-try Change-Id: I679aa0a8724e39624e76abfad6814fe06a6a6964 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/472862 Commit-Queue: Slava Egorov <vegorov@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com>