diff options
Diffstat (limited to 'src/perfetto_cmd/perfetto_cmd.h')
-rw-r--r-- | src/perfetto_cmd/perfetto_cmd.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/perfetto_cmd/perfetto_cmd.h b/src/perfetto_cmd/perfetto_cmd.h index 9504ca5fa..b55cbc8c2 100644 --- a/src/perfetto_cmd/perfetto_cmd.h +++ b/src/perfetto_cmd/perfetto_cmd.h @@ -28,6 +28,7 @@ #include "perfetto/ext/base/event_fd.h" #include "perfetto/ext/base/pipe.h" #include "perfetto/ext/base/scoped_file.h" +#include "perfetto/ext/base/thread_task_runner.h" #include "perfetto/ext/base/unix_task_runner.h" #include "perfetto/ext/base/weak_ptr.h" #include "perfetto/ext/tracing/core/consumer.h" @@ -67,7 +68,7 @@ class PerfettoCmd : public Consumer { void OnAttach(bool, const TraceConfig&) override; void OnTraceStats(bool, const TraceStats&) override; void OnObservableEvents(const ObservableEvents&) override; - void OnSessionCloned(bool, const std::string&) override; + void OnSessionCloned(const OnSessionClonedArgs&) override; void SignalCtrlC() { ctrl_c_evt_.Notify(); } @@ -116,6 +117,8 @@ class PerfettoCmd : public Consumer { // will have no effect. void NotifyBgProcessPipe(BgProcessStatus status); + void OnCloneSnapshotTriggerReceived(TracingSessionID); + #if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) static base::ScopedFile CreateUnlinkedTmpFile(); void SaveTraceIntoIncidentOrCrash(); @@ -162,6 +165,14 @@ class PerfettoCmd : public Consumer { // How long we expect to trace for or 0 if the trace is indefinite. uint32_t expected_duration_ms_ = 0; bool trace_data_timeout_armed_ = false; + + // The aux thread that is used to invoke secondary instances of PerfettoCmd + // to create snapshots. This is used only when the trace config involves a + // CLONE_SNAPSHOT trigger. + std::unique_ptr<base::ThreadTaskRunner> snapshot_thread_; + int snapshot_count_ = 0; + std::string snapshot_config_; + base::WeakPtrFactory<PerfettoCmd> weak_factory_{this}; }; |