processor.c File Reference

#include "config.h"
#include <unistd.h>
#include <strings.h>
#include <sys/time.h>
#include <sys/fcntl.h>
#include <sys/types.h>
#include <errno.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <stdio.h>
#include "powerlib_local.h"
#include "powerlib.h"

Defines

#define ACPI_PROCESSOR_DIR   "/proc/acpi/processor"
#define PROC_STAT_FILE   "/proc/stat"
#define PROC_CPUINFO_FILE   "/proc/cpuinfo"
#define SYSFS_CPU_PATH   "/sys/devices/system/cpu"

Functions

int getThrottlingInfo (int *num_states, int *current_state)
 get throttling information (ACPI only)
int getThrottlingInfoCPU (const int cpu, int *states, int *current)
 get throttling info for one single cpu
int setThrottlingState (const int state)
int setThrottlingStateCPU (const int cpu, const int state)
 set throttling state on cpu
int setThrottlingPercentCPU (const int cpu, const int percent)
 set throttling percent for single cpu
int setThrottlingPercent (const int percent)
 set throttling percent
float getRealProcessorSpeed ()
 get processor speed
int calcCPULoad (const int consider_nice)
 calculate cpu load
int getCPULoad (const int cpu)
 get current cpu load
int getCPUCount ()
 get number of cpus in system
void freeCPULoadData ()
 free data for calculating cpu time
int getCPUOnline (int cpu_num)

Variables

static unsigned long * ps_last_total_time = NULL
static unsigned long * ps_last_working_time = NULL
static int * ps_cpuload = NULL
static int cpuCount = -1

Define Documentation

#define ACPI_PROCESSOR_DIR   "/proc/acpi/processor"
 

#define PROC_CPUINFO_FILE   "/proc/cpuinfo"
 

#define PROC_STAT_FILE   "/proc/stat"
 

#define SYSFS_CPU_PATH   "/sys/devices/system/cpu"
 


Function Documentation

int getCPUOnline int  cpu_num  ) 
 

int setThrottlingState const int  state  ) 
 


Variable Documentation

int cpuCount = -1 [static]
 

int* ps_cpuload = NULL [static]
 

unsigned long* ps_last_total_time = NULL [static]
 

unsigned long * ps_last_working_time = NULL [static]
 


Generated on Mon Mar 27 09:27:19 2006 for Powersave Daemon by  doxygen 1.4.6