Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Enumerations | Functions
sysfs.c File Reference
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include "helpers/sysfs.h"

Go to the source code of this file.

Enumerations

enum  idlestate_value {
  IDLESTATE_USAGE, IDLESTATE_POWER, IDLESTATE_LATENCY, IDLESTATE_TIME,
  MAX_IDLESTATE_VALUE_FILES
}
 
enum  idlestate_string { IDLESTATE_DESC, IDLESTATE_NAME, MAX_IDLESTATE_STRING_FILES }
 
enum  cpuidle_string { CPUIDLE_GOVERNOR, CPUIDLE_GOVERNOR_RO, CPUIDLE_DRIVER, MAX_CPUIDLE_STRING_FILES }
 

Functions

unsigned int sysfs_read_file (const char *path, char *buf, size_t buflen)
 
int sysfs_is_cpu_online (unsigned int cpu)
 
unsigned int sysfs_idlestate_read_file (unsigned int cpu, unsigned int idlestate, const char *fname, char *buf, size_t buflen)
 
unsigned long sysfs_get_idlestate_latency (unsigned int cpu, unsigned int idlestate)
 
unsigned long sysfs_get_idlestate_usage (unsigned int cpu, unsigned int idlestate)
 
unsigned long long sysfs_get_idlestate_time (unsigned int cpu, unsigned int idlestate)
 
charsysfs_get_idlestate_name (unsigned int cpu, unsigned int idlestate)
 
charsysfs_get_idlestate_desc (unsigned int cpu, unsigned int idlestate)
 
int sysfs_get_idlestate_count (unsigned int cpu)
 
charsysfs_get_cpuidle_governor (void)
 
charsysfs_get_cpuidle_driver (void)
 
int sysfs_get_sched (const char *smt_mc)
 
int sysfs_set_sched (const char *smt_mc, int val)
 

Enumeration Type Documentation

Enumerator:
CPUIDLE_GOVERNOR 
CPUIDLE_GOVERNOR_RO 
CPUIDLE_DRIVER 
MAX_CPUIDLE_STRING_FILES 

Definition at line 304 of file sysfs.c.

Enumerator:
IDLESTATE_DESC 
IDLESTATE_NAME 
MAX_IDLESTATE_STRING_FILES 

Definition at line 188 of file sysfs.c.

Enumerator:
IDLESTATE_USAGE 
IDLESTATE_POWER 
IDLESTATE_LATENCY 
IDLESTATE_TIME 
MAX_IDLESTATE_VALUE_FILES 

Definition at line 145 of file sysfs.c.

Function Documentation

char* sysfs_get_cpuidle_driver ( void  )

Definition at line 351 of file sysfs.c.

char* sysfs_get_cpuidle_governor ( void  )

Definition at line 342 of file sysfs.c.

int sysfs_get_idlestate_count ( unsigned int  cpu)

Definition at line 260 of file sysfs.c.

char* sysfs_get_idlestate_desc ( unsigned int  cpu,
unsigned int  idlestate 
)

Definition at line 250 of file sysfs.c.

unsigned long sysfs_get_idlestate_latency ( unsigned int  cpu,
unsigned int  idlestate 
)

Definition at line 227 of file sysfs.c.

char* sysfs_get_idlestate_name ( unsigned int  cpu,
unsigned int  idlestate 
)

Definition at line 245 of file sysfs.c.

unsigned long long sysfs_get_idlestate_time ( unsigned int  cpu,
unsigned int  idlestate 
)

Definition at line 239 of file sysfs.c.

unsigned long sysfs_get_idlestate_usage ( unsigned int  cpu,
unsigned int  idlestate 
)

Definition at line 233 of file sysfs.c.

int sysfs_get_sched ( const char smt_mc)

Definition at line 363 of file sysfs.c.

unsigned int sysfs_idlestate_read_file ( unsigned int  cpu,
unsigned int  idlestate,
const char fname,
char buf,
size_t  buflen 
)

Definition at line 117 of file sysfs.c.

int sysfs_is_cpu_online ( unsigned int  cpu)

Definition at line 67 of file sysfs.c.

unsigned int sysfs_read_file ( const char path,
char buf,
size_t  buflen 
)

Definition at line 19 of file sysfs.c.

int sysfs_set_sched ( const char smt_mc,
int  val 
)

Definition at line 374 of file sysfs.c.