Use pthread_cond_broadcast instead of pthread_cond_signal in order to wake up all instances of a thread
Signed-off-by: Vincent Guittot vincent.guittot@linaro.org --- src/rt-app.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/rt-app.c b/src/rt-app.c index d2945e1..4376313 100644 --- a/src/rt-app.c +++ b/src/rt-app.c @@ -198,7 +198,7 @@ static int run_event(event_data_t *event, int dry_run, { log_debug("resume %s ", rdata->name); pthread_mutex_lock(&(ddata->res.mtx.obj)); - pthread_cond_signal(&(rdata->res.cond.obj)); + pthread_cond_broadcast(&(rdata->res.cond.obj)); pthread_mutex_unlock(&(ddata->res.mtx.obj)); break; }
Add the thread's index in the log and plot filename in order to have one set of files per instance.
Change since v1: - fix filename in used gnuplot files
Signed-off-by: Vincent Guittot vincent.guittot@linaro.org --- src/rt-app.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/src/rt-app.c b/src/rt-app.c index 4376313..a867214 100644 --- a/src/rt-app.c +++ b/src/rt-app.c @@ -557,10 +557,11 @@ int main(int argc, char* argv[]) tdata->lock_pages = opts.lock_pages;
if (opts.logdir) { - snprintf(tmp, PATH_LENGTH, "%s/%s-%s.log", + snprintf(tmp, PATH_LENGTH, "%s/%s-%s-%d.log", opts.logdir, opts.logbasename, - tdata->name); + tdata->name, + tdata->ind); tdata->log_handler = fopen(tmp, "w"); if (!tdata->log_handler) { log_error("Cannot open logfile %s", tmp); @@ -591,9 +592,10 @@ int main(int argc, char* argv[])
for (i=0; i<nthreads; i++) { fprintf(gnuplot_script, - ""%s-%s.log" u ($5/1000):4 w l" + ""%s-%s-%d.log" u ($5/1000):4 w l" " title "thread [%s] (%s)"", opts.logbasename, opts.threads_data[i].name, + opts.threads_data[i].ind, opts.threads_data[i].name, opts.threads_data[i].sched_policy_descr);
@@ -624,7 +626,7 @@ int main(int argc, char* argv[])
for (i=0; i<nthreads; i++) { fprintf(gnuplot_script, - ""%s-%s.log" u ($5/1000):3 w l" + ""%s-%s-%d.log" u ($5/1000):3 w l" " title "thread [%s] (%s)"", opts.logbasename, opts.threads_data[i].name, opts.threads_data[i].name, @@ -641,8 +643,8 @@ int main(int argc, char* argv[])
/* 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); + snprintf(tmp, PATH_LENGTH, "%s/%s-%s-%d.plot", + opts.logdir, opts.logbasename, opts.threads_data[i].name, opts.threads_data[i].ind ); gnuplot_script = fopen(tmp, "w+"); snprintf(tmp, PATH_LENGTH, "%s-%s.eps", opts.logbasename, opts.threads_data[i].name); @@ -659,19 +661,19 @@ int main(int argc, char* argv[]) "plot ", tmp, opts.threads_data[i].name);
fprintf(gnuplot_script, - ""%s-%s.log" u ($5/1000000):2 w l" + ""%s-%s-%d.log" u ($5/1000000):2 w l" " title "load " axes x1y2, ", - opts.logbasename, opts.threads_data[i].name); + opts.logbasename, opts.threads_data[i].name, opts.threads_data[i].ind);
fprintf(gnuplot_script, - ""%s-%s.log" u ($5/1000000):3 w l" + ""%s-%s-%d.log" u ($5/1000000):3 w l" " title "run ", ", - opts.logbasename, opts.threads_data[i].name); + opts.logbasename, opts.threads_data[i].name, opts.threads_data[i].ind);
fprintf(gnuplot_script, - ""%s-%s.log" u ($5/1000000):4 w l" + ""%s-%s-%d.log" u ($5/1000000):4 w l" " title "period " ", - opts.logbasename, opts.threads_data[i].name); + opts.logbasename, opts.threads_data[i].name, opts.threads_data[i].ind);
fprintf(gnuplot_script, "\n");