diff options
-rw-r--r-- | latency.c | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -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; } |