blob: 8f65c17178c0f1fe819c18682d79bbf9ecc68087 [file] [log] [blame]
// 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.memory.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>;
resources_vmo zx.Handle:<VMO, VMO_MAP_READONLY_RIGHTS>;
snapshot_sink server_end:SnapshotSinkV1;
});
};