Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bjdooks/fixes 20feb2024 v2 #132

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions src/rt-app.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,9 @@ static int run_event(event_data_t *event, int dry_run,
break;
case rtapp_sleep:
{
struct timespec sleep = usec_to_timespec(event->duration);
log_debug("sleep %d ", event->duration);
nanosleep(&sleep, NULL);
struct timespec sleep = usec_to_timespec(event->duration);
log_debug("sleep %d ", event->duration);
nanosleep(&sleep, NULL);
}
break;
case rtapp_run:
Expand Down Expand Up @@ -1030,9 +1030,10 @@ static void _set_thread_deadline(thread_data_t *data, sched_data_t *sched_data)

ret = sched_setattr(tid, &sa_params, flags);
if (ret) {
log_critical("[%d] sched_setattr returned %d",
data->ind, ret);
errno = ret;
int tmp = errno;
log_critical("[%d] sched_setattr returned %d (%d - %s)",
data->ind, ret, errno, strerror(errno));
errno = tmp;
perror("sched_setattr: failed to set deadline attributes");
exit(EXIT_FAILURE);
}
Expand Down Expand Up @@ -1076,9 +1077,10 @@ static void _set_thread_uclamp(thread_data_t *data, sched_data_t *sched_data)

ret = sched_setattr(tid, &sa_params, flags);
if (ret) {
log_critical("[%d] sched_setattr returned %d",
data->ind, ret);
errno = ret;
int tmp = errno;
log_critical("[%d] sched_setattr returned %d (errno %d: %s)",
data->ind, ret, tmp, strerror(tmp));
errno = tmp;
perror("sched_setattr: failed to set uclamp value(s)");
exit(EXIT_FAILURE);
}
Expand Down Expand Up @@ -1583,6 +1585,10 @@ int main(int argc, char* argv[])
p_load = calibrate_cpu_cycles(CLOCK_MONOTONIC);
sched_setaffinity(0, sizeof(cpu_set_t), &orig_set);
log_notice("pLoad = %dns : calib_cpu %d", p_load, opts.calib_cpu);
if (p_load == 0) {
log_error("Did not get a good calibration value (p_load=%d)", p_load);
exit(EXIT_FAILURE);
}
} else {
p_load = opts.calib_ns_per_loop;
log_notice("pLoad = %dns", p_load);
Expand Down