Changeset e7f9a09 in mainline for uspace/app/hbench/doc/doxygroups.h


Ignore:
Timestamp:
2019-01-21T13:20:31Z (5 years ago)
Author:
Vojtech Horky <vojtech.horky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d17cf8c
Parents:
94ebebf
Message:

hbench: less parameters to benchmark runners

Merge stopwatch as well as error message buffer into one structure to
simplify benchmark runner signature.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/hbench/doc/doxygroups.h

    r94ebebf re7f9a09  
    1919 * benchmark function to the benchmark_t.
    2020 *
    21  * The benchmarking function has to accept four arguments:
    22  *  @li benchmeter_t: call benchmeter_start and benchmeter_stop around the
     21 * The benchmarking function has to accept two arguments:
     22 *  @li bench_run_t: call bench_run_start and bench_run_stop around the
    2323 *      actual benchmarking code
    2424 *  @li uint64_t: size of the workload - typically number of inner loops in
    2525 *      your benchmark (used to self-calibrate benchmark size)
    26  *  @li char * and size_t giving you access to buffer for storing error message
    27  *  if the benchmark fails (return false from the function itself then)
    2826 *
    2927 * Typically, the structure of the function is following:
    3028 * @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)
    3330 * {
    34  *      benchmeter_start(meter);
     31 *      bench_run_start(run);
    3532 *      for (uint64_t i = 0; i < size; i++) {
    3633 *              // measured action
     34 *              if (something_fails) {
     35 *                  return bench_run_fail(run, "oops: %s (%d)", str_error(rc), rc);
     36 *              }
    3737 *      }
    38  *      benchmeter_stop(meter);
     38 *      bench_run_stop(run);
    3939 *
    4040 *      return true;
Note: See TracChangeset for help on using the changeset viewer.