blob: 558bec3e3aaca98e387980cd8320ad3a81f39038 [file] [log] [blame]
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// TODO(vtl): This file should be split into trace_provider.mojom (containing
// TraceProvider and TraceRecorder) and trace_collector.mojom.
[DartPackage="mojo_services"]
module tracing;
// To participate in the tracing ecosystem, implement the TraceProvider
// interface and connect to the tracing app. Then, when the provider's Start()
// function is called collect tracing data and pass it back via the provided
// TraceRecorder interface up until Stop() is called.
[ServiceName="tracing::TraceProvider"]
interface TraceProvider {
// Categories can either be the empty string to mean the default set of
// categories or a comma-delimited list of categories to trace.
StartTracing(string categories, TraceRecorder recorder);
StopTracing();
};
interface TraceRecorder {
Record(string json);
};
[ServiceName="tracing::TraceCollector"]
interface TraceCollector {
// Request tracing data from all connected providers to stream to
// |stream|.
Start(handle<data_pipe_producer> stream, string categories);
// Stop tracing and flush results to the |stream| passed in to Start().
// Closes |stream| when all data is collected.
StopAndFlush();
};