Hi Juri,
This series mainly intends to introduce calibration mechanism and simplify the
grammar used in JSON files. [4, 5, 6] of this series are exceptions but also
put in this series since the following grammar simplification patches are
highly dependent on those features and removal of command line interface
done in [4, 5, 6].
This series are also found in:
ssh://git@git.linaro.org/people/picheng.chen/rt-app.git calibration_grammar_series
Vincent Guittot (9):
make load frequency independent
fix calibration issue on mt8173
describe resource names in plain string
add run and sleep resource types
add phase feature
remove support of command line interface
simplify grammar of JSON files
make global object optional
make resource object optional
README.in | 79 +-------
src/rt-app.c | 451 +++++++++++++++++++++++++-----------------
src/rt-app_args.c | 328 +------------------------------
src/rt-app_args.h | 3 -
src/rt-app_parse_config.c | 492 +++++++++++++++++++++++++++-------------------
src/rt-app_types.h | 63 +++---
src/rt-app_utils.c | 64 +++++-
src/rt-app_utils.h | 3 +
8 files changed, 666 insertions(+), 817 deletions(-)
--
1.9.1
From: Colin Ian King <colin.king(a)canonical.com>
clang's scan-build detected the following error "Undefined or
garbage value returned to caller" because ret is not intialised.
Signed-off-by: Colin Ian King <colin.king(a)canonical.com>
---
idlestat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/idlestat.c b/idlestat.c
index 4d773f4..ede98a0 100644
--- a/idlestat.c
+++ b/idlestat.c
@@ -1229,7 +1229,7 @@ static int idlestat_file_for_each_line(const char *path, void *data,
int (*handler)(const char *, void *))
{
FILE *f;
- int ret;
+ int ret = 0;
if (!handler)
return -1;
--
2.5.0
rt-app considers all key starting by "run" in the "phases" object as a run
event. But rt-app also allows to not create a "phases" object if there is only
one phase. In this latter case, the events are directly put at the "thread"
object level where the deadline parameters are also set. In such configuration,
the "runtime" key that is used for the runtime parameter of a deadline thread
is also filtered as a "run" event whereas it should not.
In order to remove any potential mix between deadline parameters and events,
we rename the deadline parameters in the .json file: "dl-period",
"dl-deadline", "dl-runtime".
For backward compatibility reason, rt-app will continue to check the presence
of "period", "deadline" and "runtime" keys at the thread level iff new keys
have not been found.
"dl-period", "dl-runtime" and "dl-deadline" are used by to set sched_setattr's
paramters which use nanosecond unit. All other rt-app parameters uses
microsecond unit which makes the description of a deadline thread quite
confusing as described in the example below:
"thread0" : {
"policy" : "SCHED_DEADLINE",
"dl-period" : 100000000,
"dl-deadline" : 20000000,
"dl-runtime" : 10000000,
"run" : 10000,
"timer" : { "ref" : "unique", "period" : 100000 }
},
In addition, deadline scheduler doesn't accept a runtime smaller than 1 usec
(at least in the v4.3 kernel). So we can align all the parameters of the json
file to usec unit in order to have consistant values in the description of a
thread.
The usec unit only applies to "dl-period", "dl-runtime" and "dl-deadline" but
"period", "deadline" and "runtime" still use ns to keep backward
compatibility.
Signed-off-by: Vincent Guittot <vincent.guittot(a)linaro.org>
---
doc/tutorial.txt | 12 ++++++------
src/rt-app.c | 2 +-
src/rt-app_parse_config.c | 12 +++++++++---
3 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/doc/tutorial.txt b/doc/tutorial.txt
index c1be953..6dc9a44 100644
--- a/doc/tutorial.txt
+++ b/doc/tutorial.txt
@@ -163,14 +163,14 @@ is used if not defined
must be aligned with the range allowed by the policy. The default priority is
0 for sched_other class and 10 for other classes
-* runtime : Integer: Define the runtime budget for deadline scheduling class.
-Default value is 0.
+* dl-runtime : Integer: Define the runtime budget for deadline scheduling class.
+Default value is 0. The unit is usec.
-* period : Integer. Define the period duration for deadline scheduling class.
-Default value is runtime.
+* dl-period : Integer. Define the period duration for deadline scheduling class.
+Default value is runtime. The unit is usec.
-* deadline : Integer. Define the deadline parameter for deadline scheduling
-class. Default value is period.
+* dl-deadline : Integer. Define the deadline parameter for deadline scheduling
+class. Default value is period. The unit is usec.
* cpus: Array of Integer. Define the CPU affinity of the thread. Default
value is all CPUs of the system. An example : "cpus" : [0, 2, 3]
diff --git a/src/rt-app.c b/src/rt-app.c
index 5379ced..fef12d8 100644
--- a/src/rt-app.c
+++ b/src/rt-app.c
@@ -479,7 +479,7 @@ void *thread_body(void *arg)
attr.sched_policy = SCHED_DEADLINE;
attr.sched_priority = 0;
attr.sched_runtime = data->runtime;
- attr.sched_deadline = data->deadline;
+ attr.sched_deadline = data->deadline;
attr.sched_period = data->period;
log_notice("[%d] period: %lu, exec: %lu, deadline: %lu",
diff --git a/src/rt-app_parse_config.c b/src/rt-app_parse_config.c
index ef802f1..af18910 100644
--- a/src/rt-app_parse_config.c
+++ b/src/rt-app_parse_config.c
@@ -659,9 +659,15 @@ parse_thread_data(char *name, struct json_object *obj, int index,
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);
+ data->runtime = get_int_value_from(obj, "dl-runtime", TRUE, 0) * 1000;
+ if (!data->runtime)
+ data->runtime = get_int_value_from(obj, "runtime", TRUE, 0);
+ data->period = get_int_value_from(obj, "dl-period", TRUE, 0) * 1000;
+ if (!data->period)
+ data->period = get_int_value_from(obj, "period", TRUE, data->runtime);
+ data->deadline = get_int_value_from(obj, "dl-deadline", TRUE, 0) * 1000;
+ if (!data->period)
+ data->deadline = get_int_value_from(obj, "deadline", TRUE, data->period);
/* cpuset */
cpuset_obj = get_in_object(obj, "cpus", TRUE);
--
1.9.1