diff options
-rw-r--r-- | doc/tutorial.txt | 15 | ||||
-rw-r--r-- | src/rt-app.c | 5 | ||||
-rw-r--r-- | src/rt-app_parse_config.c | 2 | ||||
-rw-r--r-- | src/rt-app_types.h | 2 |
4 files changed, 20 insertions, 4 deletions
diff --git a/doc/tutorial.txt b/doc/tutorial.txt index a4455b6..54488a0 100644 --- a/doc/tutorial.txt +++ b/doc/tutorial.txt @@ -137,6 +137,10 @@ Default value is "/dev/null". used to create IO-bounded and memory-bounded busy loop. Default value is 4194304(4MB). +* cumulative_slack : Boolean. Accumulate slack (see below) measured during + successive timer events in a phase. Default value is False (time between the + end of last event and the end of the phase). + *** default global object: "global" : { "duration" : -1, @@ -150,7 +154,8 @@ used to create IO-bounded and memory-bounded busy loop. Default value is "ftrace" : false, "gnuplot" : false, "io_device" : "/dev/null" - "mem_buffer_size" : 4194304 + "mem_buffer_size" : 4194304, + "cumulative_slack" : false } **** tasks object **** @@ -499,8 +504,8 @@ metrics are: - start/end : absolute start and end time of a phase. Same time base is used in ftrace - rel_st: start time of a phase relatively to the beg of the use case -- slack: for periodic phases (phases that ends with a timer), time between the - end of last event and the end of the phase, e.g. +- slack: if global option "cumulative_slack" (see above) is false, time between + the end of last event and the end of the phase, e.g. taskA ...|-- run5 --|- sleep5 -|-- run5--|..timer20.|-- run5 --|- sleep5 -|-- run6 --|.timer20.| <--------------- period 20 --------------> <--------------- period 20 --------------> @@ -513,6 +518,10 @@ metrics are: <--------------- period 20 --------------> <slack-5> + if global option "cumulative_slack" is true, all the intermediate slacks of a + phase with multiple timers are accumulated and reported when the phase + completes + - c_duration: sum of the configured duration of run/runtime events - c_period: sum of the timer(s) period(s) - wu_lat: sum of wakeup latencies after timer events diff --git a/src/rt-app.c b/src/rt-app.c index fb4b37d..a7a1eb4 100644 --- a/src/rt-app.c +++ b/src/rt-app.c @@ -332,7 +332,10 @@ static int run_event(event_data_t *event, int dry_run, rdata->res.timer.t_next = timespec_add(&rdata->res.timer.t_next, &t_period); clock_gettime(CLOCK_MONOTONIC, &t_now); t_slack = timespec_sub(&rdata->res.timer.t_next, &t_now); - ldata->slack = timespec_to_usec_long(&t_slack); + if (opts.cumulative_slack) + ldata->slack += timespec_to_usec_long(&t_slack); + else + ldata->slack = timespec_to_usec_long(&t_slack); if (timespec_lower(&t_now, &rdata->res.timer.t_next)) { clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &rdata->res.timer.t_next, NULL); clock_gettime(CLOCK_MONOTONIC, &t_now); diff --git a/src/rt-app_parse_config.c b/src/rt-app_parse_config.c index fbc4612..2b27f64 100644 --- a/src/rt-app_parse_config.c +++ b/src/rt-app_parse_config.c @@ -784,6 +784,7 @@ parse_global(struct json_object *global, rtapp_options_t *opts) opts->pi_enabled = 0; opts->io_device = strdup("/dev/null"); opts->mem_buffer_size = DEFAULT_MEM_BUF_SIZE; + opts->cumulative_slack = 0; return; } @@ -872,6 +873,7 @@ parse_global(struct json_object *global, rtapp_options_t *opts) "/dev/null"); opts->mem_buffer_size = get_int_value_from(global, "mem_buffer_size", TRUE, DEFAULT_MEM_BUF_SIZE); + opts->cumulative_slack = get_bool_value_from(global, "cumulative_slack", TRUE, 0); } diff --git a/src/rt-app_types.h b/src/rt-app_types.h index 718ce77..1eb9467 100644 --- a/src/rt-app_types.h +++ b/src/rt-app_types.h @@ -196,6 +196,8 @@ typedef struct _rtapp_options_t { int die_on_dmiss; int mem_buffer_size; char *io_device; + + int cumulative_slack; } rtapp_options_t; typedef struct _timing_point_t { |