| // Copyright 2025 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.attribution; |
| |
| 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; |
| |
| /// Protocol used by user pagers to publish memory attribution statistics. |
| @discoverable |
| protocol PageRefaultSink { |
| /// Sends a VMO containing a shared count of the number of page refaults of a pager. The shared |
| /// count is a single atomic 64-bit unsigned integer. |
| SendPageRefaultCount(resource struct { |
| page_refaults_vmo zx.Handle:<VMO, VMO_MAP_READONLY_RIGHTS>; |
| }); |
| }; |