EPICS Multi-Core Utilities  1.2.2-SNAPSHOT
Real-Time Utilities for EPICS IOCs on Multi-Core Linux
 All Files Functions Variables Typedefs Macros Groups Pages
Macros | Functions | Variables
utils.h File Reference

Header file for utils.c. More...

#include <sched.h>
#include <unistd.h>
#include <errlog.h>

Go to the source code of this file.

Macros

#define NO_OF_CPUS   sysconf(_SC_NPROCESSORS_CONF)
 
#define checkStatus(status, message)
 

Functions

void strToCpuset (cpu_set_t *cpuset, const char *spec)
 Convert a cpuset string specification (e.g. "0,2-3") to a cpuset.
 
void cpusetToStr (char *set, size_t len, const cpu_set_t *cpuset)
 Convert a cpuset into its string specification (e.g. "0,2-3").
 
const char * policyToStr (const int policy)
 Convert scheduling policy to string.
 
int strToPolicy (const char *string)
 Convert string policy specification to policy.
 

Variables

int cpuDigits
 Number of digits needed for a single CPU spec.
 

Detailed Description

Header file for utils.c.

Author
Ralph Lange Ralph.nosp@m..Lan.nosp@m.ge@gm.nosp@m.x.de

Definition in file utils.h.

Macro Definition Documentation

#define checkStatus (   status,
  message 
)
Value:
if((status)) {\
errlogPrintf("%s error %s\n", (message), strerror((status))); \
}

Definition at line 23 of file utils.h.

#define NO_OF_CPUS   sysconf(_SC_NPROCESSORS_CONF)

Definition at line 21 of file utils.h.

Function Documentation

void cpusetToStr ( char *  set,
size_t  len,
const cpu_set_t *  cpuset 
)

Convert a cpuset into its string specification (e.g. "0,2-3").

Parameters
setoutput buffer to write into
lenlength of set
cpusetcpuset to convert

Definition at line 59 of file utils.c.

const char* policyToStr ( const int  policy)

Convert scheduling policy to string.

Parameters
policypolicy to convert
Returns
string representation

Definition at line 96 of file utils.c.

void strToCpuset ( cpu_set_t *  cpuset,
const char *  spec 
)

Convert a cpuset string specification (e.g. "0,2-3") to a cpuset.

Parameters
cpusetcpuset to write into
specspecification string

Definition at line 29 of file utils.c.

int strToPolicy ( const char *  string)

Convert string policy specification to policy.

Parameters
stringstring policy specification
Returns
policy value, or -1 on error

Definition at line 124 of file utils.c.

Variable Documentation

int cpuDigits

Number of digits needed for a single CPU spec.

Set in mcoreThreadShowInit().

Definition at line 21 of file utils.c.