.\" Automatically generated by Pandoc 2.2.1 .\" .TH "PMEM_CTL" "5" "2019-02-19" "PMDK - pmem_ctl API version 1.4" "PMDK Programmer's Manual" .hy .\" Copyright 2014-2019, Intel Corporation .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" .\" * Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" .\" * Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in .\" the documentation and/or other materials provided with the .\" distribution. .\" .\" * Neither the name of the copyright holder nor the names of its .\" contributors may be used to endorse or promote products derived .\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS .\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR .\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT .\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE .\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .SH NAME .PP ctl \- interface for examination and modification of the library's internal state. .SH DESCRIPTION .PP The CTL namespace is organized in a tree structure. Starting from the root, each node can be either internal, containing other elements, or a leaf. Internal nodes themselves can only contain other nodes and cannot be entry points. There are two types of those nodes: \f[I]named\f[] and \f[I]indexed\f[]. Named nodes have string identifiers. Indexed nodes represent an abstract array index and have an associated string identifier. The index itself is provided by the user. A collection of indexes present on the path of an entry point is provided to the handler functions as name and index pairs. .PP Entry points are the leaves of the CTL namespace structure. Each entry point can read from the internal state, write to the internal state, exec a function or a combination of these operations. .PP The entry points are listed in the following format: .PP name | r(ead)w(rite)x(ecute) | global/\- | read argument type | write argument type | exec argument type | config argument type .PP A description of \f[B]pmem_ctl\f[] functions can be found on the following manual pages: \f[B]libpmemblk_ctl_get\f[](3), \f[B]libpmemlog_ctl_get\f[](3), \f[B]libpmemobj_ctl_get\f[](3) .SH CTL EXTERNAL CONFIGURATION .PP In addition to direct function call, each write entry point can also be set using two alternative methods. .PP The first method is to load a configuration directly from the \f[B]PMEMBLK_CONF\f[]/ \f[B]PMEMLOG_CONF\f[]/ \f[B]PMEMOBJ_CONF\f[] environment variable. A properly formatted ctl config string is a single\-line sequence of queries separated by `;': .IP .nf \f[C] query0;query1;...;queryN \f[] .fi .PP A single query is constructed from the name of the ctl write entry point and the argument, separated by `=': .IP .nf \f[C] entry_point=entry_point_argument \f[] .fi .PP The entry point argument type is defined by the entry point itself, but there are three predefined primitives: .IP .nf \f[C] *)\ integer:\ represented\ by\ a\ sequence\ of\ [0\-9]\ characters\ that\ form \ \ \ \ a\ single\ number. *)\ boolean:\ represented\ by\ a\ single\ character:\ y/n/Y/N/0/1,\ each \ \ \ \ corresponds\ to\ true\ or\ false.\ If\ the\ argument\ contains\ any \ \ \ \ trailing\ characters,\ they\ are\ ignored. *)\ string:\ a\ simple\ sequence\ of\ characters. \f[] .fi .PP There are also complex argument types that are formed from the primitives separated by a `,': .IP .nf \f[C] first_arg,second_arg \f[] .fi .PP In summary, a full configuration sequence looks like this: .IP .nf \f[C] (first_entry_point)=(arguments,\ ...);...;(last_entry_point)=(arguments,\ ...); \f[] .fi .PP As an example, to set both prefault at_open and at_create variables: .IP .nf \f[C] PMEMBLK_CONF="prefault.at_open=1;prefault.at_create=1" \f[] .fi .PP The second method of loading an external configuration is to set the \f[B]PMEMBLK_CONF_FILE\f[]/ \f[B]PMEMLOG_CONF_FILE\f[]/ \f[B]PMEMOBJ_CONF_FILE\f[] environment variable to point to a file that contains a sequence of ctl queries. The parsing rules are all the same, but the file can also contain white\-spaces and comments. .PP To create a comment, simply use `#' anywhere in a line and everything afterwards, until a new line, will be ignored. .PP An example configuration file: .IP .nf \f[C] ######################### #\ My\ pmemblk\ configuration ######################### # #\ Global\ settings: prefault.\ #\ modify\ the\ behavior\ of\ pre\-faulting \ \ \ \ at_open\ =\ 1;\ #\ prefault\ when\ the\ pool\ is\ opened prefault. \ \ \ \ at_create\ =\ 0;\ #\ but\ don\[aq]t\ prefault\ when\ it\[aq]s\ created #\ Per\-pool\ settings: #\ ... \f[] .fi .SH SEE ALSO .PP \f[B]libpmemblk_ctl_get\f[](3), \f[B]libpmemlog_ctl_get\f[](3), \f[B]libpmemobj_ctl_get\f[](3) and \f[B]\f[]