Changeset e7f9a09 in mainline for uspace/app/hbench/doc/doxygroups.h
- Timestamp:
- 2019-01-21T13:20:31Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d17cf8c
- Parents:
- 94ebebf
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/hbench/doc/doxygroups.h
r94ebebf re7f9a09 19 19 * benchmark function to the benchmark_t. 20 20 * 21 * The benchmarking function has to accept fourarguments:22 * @li bench meter_t: call benchmeter_start and benchmeter_stop around the21 * The benchmarking function has to accept two arguments: 22 * @li bench_run_t: call bench_run_start and bench_run_stop around the 23 23 * actual benchmarking code 24 24 * @li uint64_t: size of the workload - typically number of inner loops in 25 25 * your benchmark (used to self-calibrate benchmark size) 26 * @li char * and size_t giving you access to buffer for storing error message27 * if the benchmark fails (return false from the function itself then)28 26 * 29 27 * Typically, the structure of the function is following: 30 28 * @code{c} 31 * static bool runner(benchmeter_t *meter, uint64_t size, 32 * char *error, size_t error_size) 29 * static bool runner(bench_run_t *run, uint64_t size) 33 30 * { 34 * bench meter_start(meter);31 * bench_run_start(run); 35 32 * for (uint64_t i = 0; i < size; i++) { 36 33 * // measured action 34 * if (something_fails) { 35 * return bench_run_fail(run, "oops: %s (%d)", str_error(rc), rc); 36 * } 37 37 * } 38 * bench meter_stop(meter);38 * bench_run_stop(run); 39 39 * 40 40 * return true;
Note:
See TracChangeset
for help on using the changeset viewer.