On 24 November 2016 at 11:32, Juri Lelli juri.lelli@arm.com wrote:
Add c_duration (sum of durations of the different events that comes from json configuration file). This is handy for post-processing logs.
Signed-off-by: Juri Lelli juri.lelli@arm.com
Acked-by: Vincent Guittot vincent.guittot@linaro.org
src/rt-app.c | 7 +++++-- src/rt-app_types.h | 2 ++ src/rt-app_utils.c | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/rt-app.c b/src/rt-app.c index 66ae021cb180..becc3649f791 100644 --- a/src/rt-app.c +++ b/src/rt-app.c @@ -288,6 +288,7 @@ static int run_event(event_data_t *event, int dry_run, { struct timespec t_start, t_end; log_debug("run %d ", event->duration);
ldata->c_duration += event->duration; clock_gettime(CLOCK_MONOTONIC, &t_start); *perf += loadwait(event->duration); clock_gettime(CLOCK_MONOTONIC, &t_end);
@@ -301,6 +302,7 @@ static int run_event(event_data_t *event, int dry_run, int64_t diff_ns;
log_debug("runtime %d ", event->duration);
ldata->c_duration += event->duration; clock_gettime(CLOCK_MONOTONIC, &t_start); do {
@@ -587,10 +589,10 @@ void *thread_body(void *arg)
log_notice("[%d] starting thread ...\n", data->ind);
fprintf(data->log_handler, "%s %8s %8s %8s %15s %15s %15s %10s %10s %10s\n",
fprintf(data->log_handler, "%s %8s %8s %8s %15s %15s %15s %10s %10s %10s %10s\n", "#idx", "perf", "run", "period", "start", "end", "rel_st", "slack",
"c_period", "wu_lat");
"c_duration", "c_period", "wu_lat"); if (opts.ftrace) log_ftrace(ft_data.marker_fd, "[%d] starts", data->ind);
@@ -645,6 +647,7 @@ void *thread_body(void *arg) curr_timing->wu_latency = ldata.wu_latency; curr_timing->slack = ldata.slack; curr_timing->c_period = ldata.c_period;
curr_timing->c_duration = ldata.c_duration; if (opts.logsize && !timings && continue_running) log_timing(data->log_handler, curr_timing);
diff --git a/src/rt-app_types.h b/src/rt-app_types.h index 276bce02d1e6..ae088f0f4c4b 100644 --- a/src/rt-app_types.h +++ b/src/rt-app_types.h @@ -164,6 +164,7 @@ typedef struct _log_data_t { unsigned long perf; unsigned long duration; unsigned long wu_latency;
unsigned long c_duration; unsigned long c_period; long slack;
} log_data_t; @@ -199,6 +200,7 @@ typedef struct _timing_point_t { unsigned long perf; unsigned long duration; unsigned long period;
unsigned long c_duration; unsigned long c_period; unsigned long wu_latency; long slack;
diff --git a/src/rt-app_utils.c b/src/rt-app_utils.c index ea5724d8c523..f12f48cffa90 100644 --- a/src/rt-app_utils.c +++ b/src/rt-app_utils.c @@ -140,7 +140,7 @@ void log_timing(FILE *handler, timing_point_t *t) { fprintf(handler,
"%4d %8lu %8lu %8lu %15llu %15llu %15llu %10ld %10lu %10lu",
"%4d %8lu %8lu %8lu %15llu %15llu %15llu %10ld %10lu %10lu %10lu", t->ind, t->perf, t->duration,
@@ -149,6 +149,7 @@ log_timing(FILE *handler, timing_point_t *t) t->end_time, t->rel_start_time, t->slack,
t->c_duration, t->c_period, t->wu_latency );
-- 2.10.0