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
If a sigterm is raised once we have installed our own handler but threads
are not already created, we deadlock in the shutdown function.
So, we don't wait anymore for thread until all threads has been created
which is not a big issue because we don't really care of gathering all
logs and traces before exiting rt-app in this case as the use case has
not started yet.
Reported-by: Daniel Lezcano <daniel.lezcano(a)linaro.org>
Signed-off-by: Vincent Guittot <vincent.guittot(a)linaro.org>
---
change since v1:
- add sig_atomic_t for variables used in signal handler
src/rt-app.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/rt-app.c b/src/rt-app.c
index f14f228..5379ced 100644
--- a/src/rt-app.c
+++ b/src/rt-app.c
@@ -29,9 +29,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <sys/resource.h>
static int errno;
-static volatile int continue_running;
+static volatile sig_atomic_t continue_running;
static pthread_t *threads;
static int nthreads;
+static volatile sig_atomic_t running_threads;
static int p_load;
rtapp_options_t opts;
@@ -353,6 +354,10 @@ static void
shutdown(int sig)
{
int i;
+
+ if(!continue_running)
+ return;
+
/* notify threads, join them, then exit */
continue_running = 0;
@@ -364,7 +369,7 @@ shutdown(int sig)
}
/* wait up all waiting threads */
- for (i = 0; i < nthreads; i++)
+ for (i = 0; i < running_threads; i++)
{
pthread_join(threads[i], NULL);
}
@@ -634,6 +639,7 @@ int main(int argc, char* argv[])
/* allocated threads */
nthreads = opts.nthreads;
threads = malloc(nthreads * sizeof(pthread_t));
+ running_threads = 0;
/* install a signal handler for proper shutdown */
signal(SIGQUIT, shutdown);
@@ -664,6 +670,7 @@ int main(int argc, char* argv[])
log_ftrace(ft_data.marker_fd, "main creates threads\n");
}
+ /* Init global running_variable */
continue_running = 1;
/* Needs to calibrate 'calib_cpu' core */
@@ -835,6 +842,7 @@ int main(int argc, char* argv[])
(void*) tdata))
goto exit_err;
}
+ running_threads = nthreads;
if (opts.duration > 0) {
sleep(opts.duration);
--
1.9.1
If a sigterm is raised once we have installed our own handler but threads
are not already created, we deadlock in the shutdown function.
So, we don't wait anymore for thread until all threads has been created
which is not a big issue because we don't really care of gathering all
logs and traces before exiting rt-app in this case as the use case has
not started yet.
Reported-by: Daniel Lezcano <daniel.lezcano(a)linaro.org>
Signed-off-by: Vincent Guittot <vincent.guittot(a)linaro.org>
---
src/rt-app.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/rt-app.c b/src/rt-app.c
index f14f228..bbc8594 100644
--- a/src/rt-app.c
+++ b/src/rt-app.c
@@ -32,6 +32,7 @@ static int errno;
static volatile int continue_running;
static pthread_t *threads;
static int nthreads;
+static int running_threads;
static int p_load;
rtapp_options_t opts;
@@ -353,6 +354,10 @@ static void
shutdown(int sig)
{
int i;
+
+ if(!continue_running)
+ return;
+
/* notify threads, join them, then exit */
continue_running = 0;
@@ -364,7 +369,7 @@ shutdown(int sig)
}
/* wait up all waiting threads */
- for (i = 0; i < nthreads; i++)
+ for (i = 0; i < running_threads; i++)
{
pthread_join(threads[i], NULL);
}
@@ -634,6 +639,7 @@ int main(int argc, char* argv[])
/* allocated threads */
nthreads = opts.nthreads;
threads = malloc(nthreads * sizeof(pthread_t));
+ running_threads = 0;
/* install a signal handler for proper shutdown */
signal(SIGQUIT, shutdown);
@@ -664,6 +670,7 @@ int main(int argc, char* argv[])
log_ftrace(ft_data.marker_fd, "main creates threads\n");
}
+ /* Init global running_variable */
continue_running = 1;
/* Needs to calibrate 'calib_cpu' core */
@@ -835,6 +842,7 @@ int main(int argc, char* argv[])
(void*) tdata))
goto exit_err;
}
+ running_threads = nthreads;
if (opts.duration > 0) {
sleep(opts.duration);
--
1.9.1
Hi All,
I faced a couple of issues with rt-app:
1) rt-app rt-app/doc/examples/video-short.jso
I have the following error:
[rt-app] <error> [json] Error while parsing input JSON
2) rt-app rt-app/doc/examples/browser-short.js
When hitting the Ctrl+C while in the:
[rt-app] <notice> Calibrate ns per loop
That leads to:
[513468.106751] Unhandled fault: alignment fault (0x92000021) at
0x0000007f9d0fa7ec
Bus error
-- Daniel
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog