61 rl_log(
ERROR,
"In read_status: failed to get shared status memory id; %d message: %s", errno, strerror(errno));
66 if (shm_status == (
void *) -1) {
67 rl_log(
ERROR,
"In read_status: failed to map shared status memory; %d message: %s", errno, strerror(errno));
72 *status = *shm_status;
90 rl_log(
ERROR,
"In write_status: failed to get shared status memory id; %d message: %s", errno, strerror(errno));
95 if (shm_status == (
void *) -1) {
96 rl_log(
ERROR,
"In write_status: failed to map shared status memory; %d message: %s", errno, strerror(errno));
117 if(n%d == d || n%d == 0) {
134 if (signo == SIGQUIT) {
140 if (signo == SIGINT) {
141 signal(signo, SIG_IGN);
142 printf(
"Stopping RocketLogger ...\n");
158 unsigned int value = 0;
159 fp = fopen(filename,
"rt");
164 if(fscanf(fp,
"%x", &value) <= 0) {
int write_status(struct rl_status *status)
int is_low_current(int index)
struct rl_status status
Current status of RocketLogger.
void rl_log(rl_log_type type, const char *format,...)
int read_status(struct rl_status *status)
int read_file_value(char filename[])
#define SHMEM_STATUS_KEY
Key for status shared memory (used for creation)
int ceil_div(int n, int d)
#define NUM_CHANNELS
Maximum number of RocketLogger channels.
#define CHANNEL_ENABLED
Channel sampling enabled.
void sig_handler(int signo)
int is_current(int index)
#define SHMEM_PERMISSIONS
Permissions for shared memory.
rl_sampling sampling
Sampling state.
int count_channels(int channels[NUM_CHANNELS])