blob: 5b7b1ea34220377fd15eeb8d09f0fe1b11f8c32f [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.tracing.kernel;
using zx;
using fuchsia.tracing;
// TODO(https://fxbug.dev/42105268): Allow providing a vmo of the buffer to use.
@discoverable
closed protocol Controller {
/// Start tracing.
strict Start(struct {
group_mask uint32;
buffering_mode fuchsia.tracing.BufferingMode;
}) -> (struct {
status zx.Status;
});
/// Stop tracing.
strict Stop() -> (struct {
status zx.Status;
});
/// Rewind the trace buffer.
strict Rewind() -> (struct {
status zx.Status;
});
};
const MAX_BUF uint32 = 8192;
@discoverable
closed protocol Reader {
/// Get the number of bytes written to the trace buffer.
/// `size` is valid if, and only if, `status` is `ZX_OK`.
strict GetBytesWritten() -> (struct {
status zx.Status;
size uint64;
});
/// Read `count` bytes from ktrace buffer at `offset`
/// and return `data` read upon success
strict ReadAt(struct {
count uint64;
offset uint64;
}) -> (struct {
status zx.Status;
data vector<uint8>:MAX_BUF;
});
};