blob: fa8be1f655df695b43a8a17d294dd40f74b30a54 [file] [log] [blame]
James Robinson85ccf052014-12-01 16:31:03 -08001// Copyright 2014 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5module tracing;
6
Viet-Trung Luu97276c72015-02-12 22:52:03 -08007// To participate in the tracing ecosystem, implement the TraceController
James Robinson85ccf052014-12-01 16:31:03 -08008// interface and connect to the tracing app. Then, when the controller's Start()
James Robinson47225cb2015-02-02 16:56:34 -08009// function is called collect tracing data and pass it back via the provided
James Robinson85ccf052014-12-01 16:31:03 -080010// TraceDataCollector interface up until Stop() is called.
11
James Robinson85ccf052014-12-01 16:31:03 -080012interface TraceController {
James Robinson47225cb2015-02-02 16:56:34 -080013 StartTracing(string categories, TraceDataCollector collector);
James Robinson85ccf052014-12-01 16:31:03 -080014 StopTracing();
15};
16
James Robinson85ccf052014-12-01 16:31:03 -080017interface TraceDataCollector {
18 DataCollected(string json);
James Robinson85ccf052014-12-01 16:31:03 -080019};
20
21interface TraceCoordinator {
Adam Barth9b3cd6f2015-01-15 16:32:16 -080022 // Request tracing data from all connected TraceControllers to stream to
23 // |stream|.
24 Start(handle<data_pipe_producer> stream, string categories);
James Robinson85ccf052014-12-01 16:31:03 -080025
26 // Stop tracing and flush results to file.
27 StopAndFlush();
28};