diff options
author | Vincent Guittot <vincent.guittot@linaro.org> | 2014-09-10 09:39:28 +0200 |
---|---|---|
committer | Vincent Guittot <vincent.guittot@linaro.org> | 2014-09-10 09:41:55 +0200 |
commit | 332853f185a787f9c9eb3f57355cad54c99e51ad (patch) | |
tree | 8d2382c618e4678044d2932c54afa3f63b279054 /src | |
parent | de7d2cf2b1b287699506ff631d9c91882d719f5d (diff) |
Improve performance figures
And reenable support of deadline scheduler
Diffstat (limited to 'src')
-rw-r--r-- | src/rt-app.c | 50 | ||||
-rw-r--r-- | src/rt-app_parse_config.c | 4 | ||||
-rw-r--r-- | src/rt-app_types.h | 12 | ||||
-rw-r--r-- | src/rt-app_utils.c | 11 |
4 files changed, 64 insertions, 13 deletions
diff --git a/src/rt-app.c b/src/rt-app.c index 45aaf61..be0c254 100644 --- a/src/rt-app.c +++ b/src/rt-app.c @@ -331,7 +331,13 @@ void *thread_body(void *arg) attr.sched_flags = 0; attr.sched_policy = SCHED_DEADLINE; attr.sched_priority = 0; - break; + attr.sched_runtime = data->runtime; + attr.sched_deadline = data->deadline; + attr.sched_period = data->period; + + log_notice("[%d] period: %lu, exec: %lu, deadline: %lu", + data->ind, data->period, data->runtime, data->deadline); + break; #endif default: @@ -612,6 +618,48 @@ int main(int argc, char* argv[]) fprintf(gnuplot_script, "set terminal wxt\nreplot\n"); fclose(gnuplot_script); + /* gnuplot of each task */ + for (i=0; i<nthreads; i++) { + snprintf(tmp, PATH_LENGTH, "%s/%s-%s.plot", + opts.logdir, opts.logbasename, opts.threads_data[i].name); + gnuplot_script = fopen(tmp, "w+"); + snprintf(tmp, PATH_LENGTH, "%s-%s.eps", + opts.logbasename, opts.threads_data[i].name); + fprintf(gnuplot_script, + "set terminal postscript enhanced color\n" + "set output '%s'\n" + "set grid\n" + "set key outside right\n" + "set title \"Measured %s Loop stats\"\n" + "set xlabel \"Loop start time [msec]\"\n" + "set ylabel \"Run Time [msec]\"\n" + "set y2label \"Load [nb loop]\"\n" + "set y2tics \n" + "plot ", tmp, opts.threads_data[i].name); + + fprintf(gnuplot_script, + "\"%s-%s.log\" u ($5/1000000):2 w l" + " title \"load \" axes x1y2, ", + opts.logbasename, opts.threads_data[i].name); + + fprintf(gnuplot_script, + "\"%s-%s.log\" u ($5/1000000):3 w l" + " title \"run \", ", + opts.logbasename, opts.threads_data[i].name); + + fprintf(gnuplot_script, + "\"%s-%s.log\" u ($5/1000000):4 w l" + " title \"period \" ", + opts.logbasename, opts.threads_data[i].name); + + fprintf(gnuplot_script, "\n"); + + fprintf(gnuplot_script, "set terminal wxt\nreplot\n"); + fclose(gnuplot_script); + } + + } + /* Sync timer resources with start time */ clock_gettime(CLOCK_MONOTONIC, &t_start); diff --git a/src/rt-app_parse_config.c b/src/rt-app_parse_config.c index a1f212b..07fbea8 100644 --- a/src/rt-app_parse_config.c +++ b/src/rt-app_parse_config.c @@ -488,6 +488,10 @@ parse_thread_data(char *name, struct json_object *obj, int index, data->sched_prio = get_int_value_from(obj, "priority", TRUE, prior_def); + /* deadline params */ + data->runtime = get_int_value_from(obj, "runtime", TRUE, 0); + data->period = get_int_value_from(obj, "period", TRUE, data->runtime); + data->deadline = get_int_value_from(obj, "period", TRUE, data->period); /* cpuset */ cpuset_obj = get_in_object(obj, "cpus", TRUE); diff --git a/src/rt-app_types.h b/src/rt-app_types.h index a331fe7..274017e 100644 --- a/src/rt-app_types.h +++ b/src/rt-app_types.h @@ -116,6 +116,8 @@ typedef struct _thread_data_t { cpu_set_t *cpuset; char *cpuset_str; + unsigned long runtime, deadline, period; + int loop; int nphases; phase_data_t *phases; @@ -163,14 +165,12 @@ typedef struct _rtapp_options_t { typedef struct _timing_point_t { int ind; + unsigned long perf; + unsigned long duration; unsigned long period; - unsigned long exec; - unsigned long rel_start_time; - unsigned long abs_start_time; + unsigned long start_time; unsigned long end_time; - unsigned long deadline; - unsigned long duration; - long slack; + unsigned long rel_start_time; } timing_point_t; #endif // _RTAPP_TYPES_H_ diff --git a/src/rt-app_utils.c b/src/rt-app_utils.c index d35e9ce..af3ce71 100644 --- a/src/rt-app_utils.c +++ b/src/rt-app_utils.c @@ -138,15 +138,14 @@ void log_timing(FILE *handler, timing_point_t *t) { fprintf(handler, - "%d\t%lu\t%lu\t%lu\t%lu\t%lu\t%lu\t%ld", + "%d\t%lu\t%lu\t%lu\t%lu\t%lu\t%lu", t->ind, + t->perf, + t->duration, t->period, - t->exec, - t->rel_start_time, - t->abs_start_time, + t->start_time, t->end_time, - t->duration, - t->slack + t->rel_start_time ); fprintf(handler, "\n"); } |