summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormike-holmes <mike.holmes@linaro.org>2013-09-28 22:43:10 -0400
committermike-holmes <mike.holmes@linaro.org>2013-09-28 22:43:10 -0400
commitea62552744de794c7b7c26e7b099bddf41bcb960 (patch)
tree08e136146569212ad554f69a3adb97fd45bb4335
parentc2eb0c3d7ce1857ab0815106be68ed3727849d0d (diff)
output format
-rw-r--r--latency.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/latency.c b/latency.c
index da861e6..40de3d9 100644
--- a/latency.c
+++ b/latency.c
@@ -249,6 +249,7 @@ int main(int argc, char* argv[])
counter_t clockspersec = 0ull;
counter_t max_latency_ns = 10000ull;
int c=0;
+ int any_failure=0;
while ((c = getopt (argc, argv, "tr:c:b:s:f:l:")) != -1) {
switch(c) {
@@ -355,7 +356,7 @@ int main(int argc, char* argv[])
++(curdata->deadline_missed);
if (trace_on) {
ssize_t result = write(marker_fd, "Max latency exceeded\n", 17);
-
+ any_failure=1;
/* Terminate so that we can view the trace.
cat /sys/kernel/debug/tracing/trace | less */
result = write(trace_fd, "0", 1);
@@ -383,11 +384,11 @@ int main(int argc, char* argv[])
munlockall();
- cout << "test_result:outofrange=" << hot.outofrange << "units:none"<< endl;
- cout << "test_result:deadline missed=" << hot.deadline_missed << endl;
- cout << "test_result:minrange=" << hot.minrange << " = " << tous(hot.minrange,clockspersec) << "units:µs" << endl;
- cout << "test_result:maxrange=" << hot.maxrange << " = " << tous(hot.maxrange,clockspersec) << "units:µs" << endl;
- cout << "test_result:average=" << (runtime * clockspersec / loops) << " = " << tous(runtime * clockspersec / loops,clockspersec) << "units:µs" << endl;
+ cout << "test_result:outofrange=" << hot.outofrange << " count " << "FAIL" << endl;
+ cout << "test_result:deadline_missed=" << hot.deadline_missed << " count " << "FAIL" << endl;
+ cout << "test_result:minrange=" << hot.minrange << " = " << tous(hot.minrange,clockspersec) << " us" << "INFO" << endl;
+ cout << "test_result:maxrange=" << hot.maxrange << " = " << tous(hot.maxrange,clockspersec) << " us" << "INFO" << endl;
+ cout << "test_result:average=" << tous(runtime * clockspersec / loops,clockspersec) << " us" << "INFO" << endl;
if(statsfile.size()) {
@@ -403,7 +404,12 @@ int main(int argc, char* argv[])
outfile.close();
}
-
+ if ( any_failure ) {
+ printf("test_result:FAIL\n";
+ }
+ else{
+ printf("test_result:PASS\n";
+ }
return 0;
}