This simply adds xml function calls to allow the dumping of results and samples
into an xml file.
Compilation is conditional to LIB_XML.
Signed-off-by: Gilles Carry <[EMAIL PROTECTED]>
---
testcases/realtime/func/matrix_mult/matrix_mult.c | 59 ++++++++++++++++++++-
1 files changed, 58 insertions(+), 1 deletions(-)
diff --git a/testcases/realtime/func/matrix_mult/matrix_mult.c
b/testcases/realtime/func/matrix_mult/matrix_mult.c
index 4d6196d..c379a1e 100644
--- a/testcases/realtime/func/matrix_mult/matrix_mult.c
+++ b/testcases/realtime/func/matrix_mult/matrix_mult.c
@@ -43,6 +43,9 @@
#include <librttest.h>
#include <libjvmsim.h>
#include <libstats.h>
+#ifdef LIB_XML
+#include <libxml.h>
+#endif
#define MAX_CPUS 8192
#define PRIO 43
@@ -316,6 +319,56 @@ void main_thread(void)
criteria);
printf("Result: %s\n", ret ? "FAIL" : "PASS");
+#ifdef LIB_XML
+ if (! xml_dump)
+ return;
+
+ {
+ xml_stream_t *xs;
+
+ /* XML dump */
+ xs = xml_stream_init("matrix_mult", "ltp-run", "matrix-mult");
+ if (!xs) {
+ fprintf(stderr, "Warning: could not save results as
xml\n");
+ return;
+ }
+ xml_entry(xs, "title", "Matrix Multiplication (SMP
Performance)");
+ xml_start_tag(xs, "parameters");
+ xml_entry(xs, "iterations", "%ld", iterations);
+ xml_entry(xs, "calc-per-iter", "%ld", ops);
+ xml_end_tag(xs, "parameters");
+
+ xml_start_tag(xs, "sequential");
+ xml_entry(xs, "min", "%ld",smin);
+ xml_entry(xs, "max", "%ld",smax);
+ xml_entry(xs, "avg", "%.4f",savg);
+ xml_entry(xs, "stddev", "%.4f",stats_stddev(&sdat));
+
+ xml_stats_container_save(xs, "Matrix Multiplication Sequential
Execution Runtime Scatter Plot",
+ "Iteration", "Runtime (us)", &sdat, "points");
+ xml_stats_container_save(xs, "Matrix Multiplicatoin Sequential
Execution Runtime Histogram",
+ "Runtime (us)", "Samples", &shist, "steps");
+
+ xml_end_tag(xs, "sequential");
+ xml_start_tag(xs, "concurrent");
+ xml_entry(xs, "min", "%ld",cmin);
+ xml_entry(xs, "max", "%ld",cmax);
+ xml_entry(xs, "avg", "%.4f",cavg);
+ xml_entry(xs, "stddev", "%.4f",stats_stddev(&cdat));
+ xml_stats_container_save(xs, "Matrix Multiplication Concurrent
Execution Runtime Scatter Plot",
+ "Iteration", "Runtime (us)", &cdat,
"points");
+ xml_stats_container_save(xs, "Matrix Multiplication Concurrent
Execution Runtime Histogram",
+ "Iteration", "Runtime (us)", &chist,
"steps");
+ xml_end_tag(xs, "concurrent");
+ xml_start_tag(xs, "ratio");
+ xml_entry(xs, "min", "%.4f",(float)smin/cmin);
+ xml_entry(xs, "max", "%.4f",(float)smax/cmax);
+ xml_entry(xs, "avg", "%.4f",(float)savg/cavg);
+ xml_end_tag(xs, "ratio");
+ xml_stream_close (xs, "ltp-run");
+ }
+#endif
+
return;
}
@@ -323,7 +376,11 @@ int main(int argc, char *argv[])
{
setup();
pass_criteria = PASS_CRITERIA;
- rt_init("jl:i:h", parse_args, argc, argv);
+ test_name = "matrix_mult";
+ if (rt_init("jl:i:h", parse_args, argc, argv)) {
+ usage();
+ exit(1);
+ }
numcpus = sysconf(_SC_NPROCESSORS_ONLN);
/* the minimum avg concurrent multiplier to pass */
criteria = pass_criteria * numcpus;
--
1.5.5.GIT
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list