summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuri Lelli <juri.lelli@arm.com>2015-05-28 09:50:25 +0100
committerJuri Lelli <juri.lelli@arm.com>2016-11-25 08:21:17 +0000
commiteb3ca23d902c5cf470ac4e23ba466bd87c195804 (patch)
treef7af1a7cdd2ff3f438eecdd86e07ff9be4c412ed
parentc2f1bdc43e7a834e07ceb07338fea9854b3b1c15 (diff)
rt-app: add configured duration (c_duration) to log metrics
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>
-rw-r--r--src/rt-app.c7
-rw-r--r--src/rt-app_types.h2
-rw-r--r--src/rt-app_utils.c3
3 files changed, 9 insertions, 3 deletions
diff --git a/src/rt-app.c b/src/rt-app.c
index 393c8fb..0d24c8d 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 276bce0..ae088f0 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 ea5724d..f12f48c 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
);