'\"macro stdmacro .\" .\" Copyright (c) 2022 Red Hat. All Rights Reserved. .\" Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved. .\" .\" This program is free software; you can redistribute it and/or modify it .\" under the terms of the GNU General Public License as published by the .\" Free Software Foundation; either version 2 of the License, or (at your .\" option) any later version. .\" .\" This program is distributed in the hope that it will be useful, but .\" WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY .\" or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" for more details. .\" .\" .TH PMSTORE 3 "PCP" "Performance Co-Pilot" .SH NAME \f3pmStore\f1, \f3pmStoreHighRes\f1 \- modify values of performance metrics .SH "C SYNOPSIS" .ft 3 #include .sp .nf int pmStore(const pmResult *\fIresult\fP); .br int pmStoreHighRes(const pmHighResResult *\fIresult\fP); .fi .sp cc ... \-lpcp .ft 1 .SH DESCRIPTION .de CR .ie t \f(CR\\$1\f1\\$2 .el \fI\\$1\f1\\$2 .. In some special cases it may be helpful to modify the current values of performance metrics, e.g. to reset a counter to zero, or to modify a ``metric'' which is a control variable for some agent collecting performance metrics. .PP The routines .B pmStore and .B pmStoreHighRes are lightweight inverses of .BR pmFetch (3) and .BR pmFetchHighRes (3) respectively. .PP The caller must build the .I result data structure (of course, this could have been returned from an earlier .BR pmFetch (3) or .BR pmFetchHighRes (3) call). .PP It is an error to pass a .I result to .B pmStore or .B pmStoreHighRes in which the .CR numval field within any of the .B pmValueSet structures has a value less than one. .PP The current Performance Metrics Application Programming Interface (PMAPI) context must be one with a host as the source of metrics, and the current value of the nominated metrics will be changed, i.e. .B pmStore and .B pmStoreHighRes cannot be used to make retrospective changes to information in either the archives, or in the recent past for real-time sources of metrics. .PP The return code from .B pmStore and .B pmStoreHighRes is zero for success. .SH DIAGNOSTICS .IP \f3PM_ERR_GENERIC\f1 At least one of the modifications was rejected. No other status is available from below the PMAPI (this is the lightweight part of the functionality!). In cases where the outcome of storing into individual metrics is important, the caller should make one call to either .B pmStore or .B pmStoreHighRes for each metric. On the other hand, a bulk modification can be performed in a single call for situations in which the outcome is not critical. .IP \f3PM_ERR_NOTHOST\f1 The current PMAPI context is an archive rather than a host, or it is a host that is not set to the current time, i.e. has been ``rewound'' to the recent past using .BR pmSetMode (3) or .BR pmSetModeHighRes (3). .IP \f3PM_ERR_TOOSMALL\f1 The number of metrics specified in .I result is less than one. .IP \f3PM_ERR_VALUE\f1 One or more of the .CR pmValueSet s in .I result has a .CR numval field with a value less than one. .SH SEE ALSO .BR PMAPI (3), .BR pmFetch (3), .BR pmFetchHighRes (3), .BR pmSetModeHighRes (3) and .BR pmSetMode (3).