15#include <Urm/UrmAPIs.h>
17#define UCLAMP_MIN_RES 0x00030000
18#define UCLAMP_BOOST_VAL 750
19#define TUNE_DURATION 5000
48 int64_t duration = 5000;
56 int32_t properties = 0;
63 properties = SET_REQUEST_PRIORITY(properties, REQ_PRIORITY_LOW);
67 .mResCode = UCLAMP_MIN_RES,
72 .value = UCLAMP_BOOST_VAL,
79 int64_t handle =
tuneResources(duration, properties, 1, resourceList);
83 std::cout<<
"Request Could not be Sent to the Resource Tuner Server"<<std::endl;
85 std::cout<<
"Handle Returned is: "<<handle<<std::endl;
103 int64_t duration = -1;
106 int32_t properties = 0;
109 properties = SET_REQUEST_PRIORITY(properties, REQ_PRIORITY_HIGH);
113 properties = ADD_ALLOWED_MODE(properties, MODE_RESUME);
114 properties = ADD_ALLOWED_MODE(properties, MODE_SUSPEND);
127 resourceList[0].
mResCode = CONSTRUCT_RES_CODE(0x03, 0x0000);
162 int64_t handle =
tuneResources(duration, properties, 1, resourceList);
166 std::cout<<
"Tune Request could not be sent to the Resource Tuner Server"<<std::endl;
170 std::cout<<
"Handle Returned is: "<<handle<<std::endl;
180 std::cout<<
"Untune Request could not be sent to the Resource Tuner Server"<<std::endl;
192 int64_t duration = 8000;
195 int32_t properties = 0;
198 properties = SET_REQUEST_PRIORITY(properties, REQ_PRIORITY_HIGH);
203 properties = ADD_ALLOWED_MODE(properties, MODE_RESUME);
213 resourceList[0].
mResCode = 0x00030000;
240 int64_t handle =
tuneResources(duration, properties, 1, resourceList);
244 std::cout<<
"Tune Request could not be sent to the Resource Tuner Server"<<std::endl;
248 std::cout<<
"Handle Returned is: "<<handle<<std::endl;
255 int64_t newDuration = 20000;
259 std::cout<<
"Untune Request could not be sent to the Resource Tuner Server"<<std::endl;
263int32_t main(int32_t argc,
char* argv[]) {
int64_t tuneResources(int64_t duration, int32_t prop, int32_t numRes, SysResource *resourceList)
Tune Resource Values for finite or finite duration.
int8_t retuneResources(int64_t handle, int64_t duration)
Modify the duration of a previously issued Tune Request.
int8_t untuneResources(int64_t handle)
Release (or free) the Request with the given handle.
Used to store information regarding Resources / Tunables which need to be Provisioned as part of the ...
int32_t value
Use this field for single Valued Resources.
uint32_t mResCode
A uniqued 32-bit (unsigned) identifier for the Resource.
int32_t mNumValues
Number of values to be configured for the Resource, both single-valued and multi-valued Resources are...
int32_t mResInfo
Holds Logical Core and Cluster Information:
union SysResource::@123143110140375143216027027064266051075023012302 mResValue
The value to be Configured for this Resource Node.
int32_t mOptionalInfo
Field to hold optional information for Request Processing.