blob: 61f4fdec4379119e3ce27ef766f2544fe0d42dd0 [file] [log] [blame] [edit]
// Copyright 2023 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.heapdump.process;
using zx;
/// Rights to map a VMO in read-only mode and read its "content size" property.
const VMO_MAP_READONLY_RIGHTS zx.rights
= zx.RIGHTS_BASIC | zx.rights.READ | zx.rights.GET_PROPERTY | zx.rights.MAP;
/// Instrumented processes send application-initiated snapshots over this channel.
///
/// This channel is also used by the server to detect when an instrumented process exits.
// TODO(fxbug.dev/122389): Application-initiated snapshots are not implemented yet.
protocol SnapshotSinkV1 {};
/// The Registry keeps track of all the instrumented processes that are running in the system.
@discoverable
protocol Registry {
/// Binds the given process to the registry and share the relevant resources.
RegisterV1(resource struct {
process zx.handle:<PROCESS, zx.RIGHTS_BASIC | zx.RIGHTS_IO | zx.rights.GET_PROPERTY>;
allocations_vmo zx.handle:<VMO, VMO_MAP_READONLY_RIGHTS>;
snapshot_sink server_end:SnapshotSinkV1;
});
};