Depends on D90490.
The stop command is simple and invokes the new method Trace::StopTracingThread(thread).
On the other hand, the start command works by delegating its implementation to a CommandObject provided by the Trace plugin. This is necessary because each trace plugin needs different options for this command. There's even the chance that a Trace plugin can't support live tracing, but instead supports offline decoding and analysis, which means that "thread trace dump instructions" works but "thread trace start" doest. Because of this and a few other reasons, it's better to have each plugin provide this implementation.
Besides, I'm using the GetSupportedTraceType method introduced in D90490 to quickly infer what's the trace plug-in that works for the current process.
As an implementation note, I moved CommandObjectIterateOverThreads to its header so that I can use it from the IntelPT plugin. Besides, the actual start and stop logic for intel-pt is not part of this diff.
This should return true as a default implementation. Then only the ProcessTrace, and the ProcessMachCore, ProcessMinidump, and ProcessELFCore would need to override. We could make a ProcessCore base class that overrides this by returning false and then having all of the mentioned core file classes inherit from ProcessCore. We also need header documentation for this.
Having a default implementation will help make sure the buildbots stay clean for Process plug-ins that are not always built, like ProcessWindows, which we missed in this diff.