From: Vincent Guittot vincent.guittot@linaro.org
with new resources and way to sync, we have to change how a run period is measured.
Signed-off-by: Vincent Guittot vincent.guittot@linaro.org --- src/rt-app.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/rt-app.c b/src/rt-app.c index 5384149..c799403 100644 --- a/src/rt-app.c +++ b/src/rt-app.c @@ -148,7 +148,7 @@ void put_resource(rtapp_resource_access_list_t *lock) }
void run(int ind, struct timespec *min, struct timespec *max, - rtapp_tasks_resource_list_t *blockages, int nblockages) + rtapp_tasks_resource_list_t *blockages, int nblockages, struct timespec *t_start) { int i, busywait = 1; struct timespec t_exec; @@ -171,6 +171,9 @@ void run(int ind, struct timespec *min, struct timespec *max, lock = lock->next; }
+ if (!i && t_start) + clock_gettime(CLOCK_MONOTONIC, t_start); + if (busywait) { /* Busy wait */ log_debug("[%d] busywait for %lu", ind, timespec_to_usec(&blockages[i].usage)); @@ -444,7 +447,7 @@ void *thread_body(void *arg)
clock_gettime(CLOCK_MONOTONIC, &t_start); run(data->ind, &data->min_et, &data->max_et, data->blockages, - data->nblockages); + data->nblockages, data->sleep ? NULL: &t_start); clock_gettime(CLOCK_MONOTONIC, &t_end);
t_diff = timespec_sub(&t_end, &t_start);