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


Ignore:
Timestamp:
2019-01-07T12:56:22Z (6 years ago)
Author:
Vojtech Horky <vojtech.horky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c2db02a
Parents:
a787081
Message:

hbench: add tiny wrapper around stopwatch_t

This prepares the harness for future extensions when more than wallclock
time would be prepared. The data would be stored inside the new
structure and the actual benchmarks would not need to be modified at all
(they really should not care which metrics are collected).

File:
1 edited

Legend:

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

    ra787081 rebb0835  
    1919 * benchmark function to the benchmark_t.
    2020 *
    21  * The benchmarking function has to accept for arguments:
    22  *  @li stopwatch_t: store the measured data there
     21 * The benchmarking function has to accept four arguments:
     22 *  @li benchmeter_t: call benchmeter_start and benchmeter_stop around the
     23 *      actual benchmarking code
    2324 *  @li uint64_t: size of the workload - typically number of inner loops in
    2425 *      your benchmark (used to self-calibrate benchmark size)
     
    2829 * Typically, the structure of the function is following:
    2930 * @code{c}
    30  * static bool runner(stopwatch_t *stopwatch, uint64_t size,
     31 * static bool runner(benchmeter_t *meter, uint64_t size,
    3132 *     char *error, size_t error_size)
    3233 * {
    33  *      stopwatch_start(stopwatch);
     34 *      benchmeter_start(meter);
    3435 *      for (uint64_t i = 0; i < size; i++) {
    3536 *              // measured action
    3637 *      }
    37  *      stopwatch_stop(stopwatch);
     38 *      benchmeter_stop(meter);
    3839 *
    3940 *      return true;
Note: See TracChangeset for help on using the changeset viewer.