geopm  3.1.1.dev296+g5916b956
GEOPM - Global Extensible Open Power Manager
Functions
geopm_policystore.h File Reference
#include <stddef.h>
#include "geopm_public.h"
Include dependency graph for geopm_policystore.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int GEOPM_PUBLIC geopm_policystore_connect (const char *data_path)
 Create a geopm policy store interface. More...
 
int GEOPM_PUBLIC geopm_policystore_disconnect ()
 Destroy a geopm policy store interface and release its resources. More...
 
int GEOPM_PUBLIC geopm_policystore_get_best (const char *agent_name, const char *profile_name, size_t max_policy_vals, double *policy_vals)
 Get the best known policy for a given agent and profile. More...
 
int GEOPM_PUBLIC geopm_policystore_set_best (const char *agent_name, const char *profile_name, size_t num_policy_vals, const double *policy_vals)
 Set the best known policy for a given agent and profile. More...
 
int GEOPM_PUBLIC geopm_policystore_set_default (const char *agent_name, size_t num_policy_vals, const double *policy_vals)
 Set the default policy for a given agent. More...
 

Function Documentation

◆ geopm_policystore_connect()

int GEOPM_PUBLIC geopm_policystore_connect ( const char *  data_path)

Create a geopm policy store interface.

Connects to a data store, creating a one if does not exist already.

Parameters
[in]data_pathPath to the data store.
Returns
Zero on success, error code on failure.

◆ geopm_policystore_disconnect()

int GEOPM_PUBLIC geopm_policystore_disconnect ( )

Destroy a geopm policy store interface and release its resources.

Returns
Zero on success, error code on failure.

◆ geopm_policystore_get_best()

int GEOPM_PUBLIC geopm_policystore_get_best ( const char *  agent_name,
const char *  profile_name,
size_t  max_policy_vals,
double *  policy_vals 
)

Get the best known policy for a given agent and profile.

Gets the agent's default policy if no best policy has been reported.

Parameters
[in]agent_nameName of the agent to find.
[in]profile_nameName of the profile to find.
[in]max_policy_valsMaximum number of values that can fit in policy_vals.
[out]policy_valsBest known or default policy.
Returns
Zero on success, error code on failure.

◆ geopm_policystore_set_best()

int GEOPM_PUBLIC geopm_policystore_set_best ( const char *  agent_name,
const char *  profile_name,
size_t  num_policy_vals,
const double *  policy_vals 
)

Set the best known policy for a given agent and profile.

Parameters
[in]profile_nameName of the profile.
[in]agent_nameName of the agent.
[in]num_policy_valsNumber of values in policy_vals.
[in]policy_valsNew policy to apply.
Returns
Zero on success, error code on failure.

◆ geopm_policystore_set_default()

int GEOPM_PUBLIC geopm_policystore_set_default ( const char *  agent_name,
size_t  num_policy_vals,
const double *  policy_vals 
)

Set the default policy for a given agent.

Parameters
[in]agent_nameName of the agent.
[in]num_policy_valsNumber of values in policy_vals.
[in]policy_valsDefault policy to apply.
Returns
Zero on success, error code on failure.