--- /dev/null
+#!/bin/awk -f
+
+BEGIN {
+ OFS=" & "
+ print "Test", "Load", "Minimum", "Average", "Maximun", "Standard Dev.", "25th %", "Median", "75th %"
+}
+
+/Test:/ {
+ sub (/^[^ ]* /, "")
+ test=$0
+}
+
+/Minimum/ { min=$3 }
+/Maximum/ { max=$3 }
+/Average/ { avg=$3 }
+/Standard/ { std=$4 }
+
+/25th/ { p25=$4 }
+/Median/ { med=$3 }
+/75th/ { p75=$4 }
+
+/Histogram/ {
+ print test, COMMENT, min, avg, max, std, p25, med, p75
+}
+# for p in 0 100; do ./gettable.awk -v COMMENT=$p% test-$p%.log; done > result.csv
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include "stat.h"
#include "test.h"
/* static variables */
char *progname = NULL;
-char *version = "1.1";
+char *version = "1.2";
double abe_per = 0;
+int delay = 0;
int do_stat = 0;
int excl_first = 0;
int hist_bin = 10;
int usage (int ret)
{
FILE *fd = ret ? stderr : stdout;
- fprintf (fd, "usage: %s [-b int] [-h] [-n int] [-o file] [-s]\n", progname);
+ fprintf (fd, "usage: %s [-a int] [-b int] [-d int] [-e int] [-h] [-n int] [-o file] [-s]\n", progname);
fprintf (fd, " -a: avoid aberrand valies (%g%%)\n", abe_per);
+ fprintf (fd, " -d: delay process start for (%ds)\n", delay);
fprintf (fd, " -b: nb bins for histogram (%d)\n", hist_bin);
fprintf (fd, " -e: exclude %d first tests\n", excl_first);
fprintf (fd, " -h: help message\n");
}
hist_bin = atoi (arg);
break;
+ case 'd':
+ arg = (arg[2]) ? arg + 2 : (--argc > 0) ? *(++argv) : NULL;
+ if (arg == NULL) {
+ fprintf (stderr, "%s: no delay specified\n", progname);
+ return usage (1);
+ }
+ delay = atoi (arg);
+ break;
case 'e':
arg = (arg[2]) ? arg + 2 : (--argc > 0) ? *(++argv) : NULL;
if (arg == NULL) {
dts_t *buffer = (dts_t *) calloc (nb, sizeof (dts_t));
assert (buffer);
+ if (delay > 0) {
+ printf ("Delay start for %ds\n", delay);
+ for (int i = 0; i < 100 * delay; i++) {
+ usleep (10 * 1000);
+ }
+ }
+
printf ("Test: %s\n", (message) ? message : "unknown");
if (test (buffer, nb)) {
--- /dev/null
+#!/bin/sh
+
+export pid
+
+function run() {
+ for test in mutex semaphore thread mq pipe udp; do
+ ./getinfo.sh
+ pid=-1
+ { ./$test.exe -d 1 -n 10000 -s -o $test-$1.dat; \
+ kill -2 $(ps -e | awk '/[h]ackbench/ || /[s]leep/ { print $1 }') 2>/dev/null; } &
+ case "$1" in
+ 0%) sleep 60;;
+ 50%) ./hackbench -p -g 1 -f 1 -T 1 -P 1 -s $((100 * 1000)) -l $((2 * 1000 * 1000));;
+ 100%) ./hackbench -p -g 20 -l $((100 * 1000));;
+ esac
+ echo "Cleaning..."
+ sleep 1
+ done
+}
+
+for p in 0 50 100; do
+ run $p% | tee test-$p%.log
+done