Barrelfish
|
Bench library. More...
Functions | |
__BEGIN_DECLS void | bench_init (void) |
Initialize benchmarking library. More... | |
cycles_t | bench_avg (cycles_t *array, size_t len) |
Compute averages. More... | |
cycles_t | bench_variance (cycles_t *array, size_t len) |
Compute variance. More... | |
void | bench_stddev (cycles_t *array, size_t len, uint8_t correction, cycles_t *ret_avg, cycles_t *ret_stddev) |
computes the standard deviation s^2 of the sample data More... | |
cycles_t | bench_min (cycles_t *array, size_t len) |
Compute minimum. More... | |
cycles_t | bench_max (cycles_t *array, size_t len) |
Compute maximum. More... | |
cycles_t | bench_tscoverhead (void) |
cycles_t | bench_time_diff (cycles_t tsc_start, cycles_t tsc_end) |
computes the differences of two time stamps with respecting overflow More... | |
bench_ctl_t * | bench_ctl_init (enum bench_ctl_mode mode, size_t dimensions, size_t min_runs) |
void | bench_ctl_destroy (bench_ctl_t *ctl) |
void | bench_ctl_dry_runs (bench_ctl_t *ctl, size_t dry_runs) |
bool | bench_ctl_add_run (bench_ctl_t *ctl, cycles_t *result) |
void | bench_ctl_dump_csv (bench_ctl_t *ctl, const char *prefix, uint64_t tscperus) |
void | bench_ctl_dump_csv_bincounting (bench_ctl_t *ctl, size_t dimension, size_t bin_count, cycles_t min, cycles_t max, const char *prefix, cycles_t tscperus) |
Bench library.
Compute averages.
If certain datapoints should be ignored, they should be marked with #BENCH_IGNORE_WATERMARK
bool bench_ctl_add_run | ( | bench_ctl_t * | ctl, |
cycles_t * | result | ||
) |
Add results from one run of the benchmark.
ctl | Control handle |
result | Pointer to the 'dimensions' values of this run |
void bench_ctl_destroy | ( | bench_ctl_t * | ctl | ) |
Frees all resources associated with this benchmark control instance. Should be called after the benchmark is done and the results are dumped.
ctl | Control handle |
void bench_ctl_dry_runs | ( | bench_ctl_t * | ctl, |
size_t | dry_runs | ||
) |
Add a fixed number of dry runs whose results should not be recorded. Should be called before any calls to bench_ctl_add_run().
ctl | Control handle |
dry_runs | Number of dry runs |
void bench_ctl_dump_csv | ( | bench_ctl_t * | ctl, |
const char * | prefix, | ||
uint64_t | tscperus | ||
) |
Dump results of the benchmark to the standard output. One line per run, the lines will be prefixed with prefix, the values separeted using commas.
ctl | Control handle |
prefix | String to be printed before each line |
void bench_ctl_dump_csv_bincounting | ( | bench_ctl_t * | ctl, |
size_t | dimension, | ||
size_t | bin_count, | ||
cycles_t | min, | ||
cycles_t | max, | ||
const char * | prefix, | ||
cycles_t | tscperus | ||
) |
Use bincounting to reduce the amount of data that is printed. One line per bin (bin_count + 2 for those below and above the specified range) with two columns each is emited at most. Lines for empty bins are omitted except for above and below. The first column contains the start of the range for this bin (or below/above for the border cases), while the second column contains the number of values in that bin.
ctl | Control handle |
dimenison | Index of the value in the run |
bin_count | Number of bins to create |
min | Minimum of range to be represented by bins |
max | Maximum of range to be represented by bins |
prefix | String to be printed before each line |
tscperus | cpu ticks per micro-second |
bench_ctl_t* bench_ctl_init | ( | enum bench_ctl_mode | mode, |
size_t | dimensions, | ||
size_t | min_runs | ||
) |
Initialize a benchmark control instance.
mode | Mode of the benchmark (enum bench_ctl_mode) |
dimensions | Number of values each run produces |
min_runs | Minimal number of runs to be executed |
__BEGIN_DECLS void bench_init | ( | void | ) |
Initialize benchmarking library.
Compute maximum.
If certain datapoints should be ignored, they should be marked with #BENCH_IGNORE_WATERMARK
Compute minimum.
If certain datapoints should be ignored, they should be marked with #BENCH_IGNORE_WATERMARK
void bench_stddev | ( | cycles_t * | array, |
size_t | len, | ||
uint8_t | correction, | ||
cycles_t * | ret_avg, | ||
cycles_t * | ret_stddev | ||
) |
computes the standard deviation s^2 of the sample data
array | array of data to analyze |
len | size of the array |
correction | apply Bessel's correction (using N-1 instead of N) |
ret_avg | returns the average of the sample |
ret_stddev | returns the standard deviation squared of the sample |
discard some initiali observations
computes the differences of two time stamps with respecting overflow
This function also accounts for the overhead when taking timestamps
tsc_start | timestamp of start |
tsc_end | timestamp of end |
cycles_t bench_tscoverhead | ( | void | ) |
Return the measured tsc overhead