ppsm_init()

void * ppsm_init( int verbose,
                  int prio,
                  int interval,
                  int scale_factor,
                  int lower,
                  int upper,
                  int policy);

This function creates the device structure and starts the CPU load-accounting threads for each CPU. The arguments are:

verbose
The level of verbosity to use when logging information.
prio
The priority you want to set for the CPU accounting thread (default: 51).
interval
The interval (in ms) at which to check the CPU load and put the CPU into the desired state according to current CPU load.
scale_factor
When the system is busy (target state or current state at highest performance state), the polling time = interval × scale_factor.
lower
The lower threshold (as a percentage of CPU loading from 0 to 100).
upper
The upper threshold (as a percentage of CPU loading from 0 to 100).
policy
The default initial policy; the following policies are supported:
  • PPSM_POLICY_NONE — always run at the highest available performance state
  • PPSM_POLICY_ADAPTIVE — choose the performance state, based on the CPU demand
  • PPSM_POLICY_CONSTANT — always run at the lowest performance state

The ppsm_init() function returns a handle that you need to pass to the other PPSM functions, or NULL if the initialization failed (see the system log for details).