Changeset ebb0835 in mainline for uspace/app/hbench/malloc


Ignore:
Timestamp:
2019-01-07T12:56:22Z (7 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).

Location:
uspace/app/hbench/malloc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/hbench/malloc/malloc1.c

    ra787081 rebb0835  
    3636#include "../hbench.h"
    3737
    38 static bool runner(stopwatch_t *stopwatch, uint64_t size,
     38static bool runner(benchmeter_t *meter, uint64_t size,
    3939    char *error, size_t error_size)
    4040{
    41         stopwatch_start(stopwatch);
     41        benchmeter_start(meter);
    4242        for (uint64_t i = 0; i < size; i++) {
    4343                void *p = malloc(1);
     
    5050                free(p);
    5151        }
    52         stopwatch_stop(stopwatch);
     52        benchmeter_stop(meter);
    5353
    5454        return true;
  • uspace/app/hbench/malloc/malloc2.c

    ra787081 rebb0835  
    3535#include "../hbench.h"
    3636
    37 static bool runner(stopwatch_t *stopwatch, uint64_t niter,
     37static bool runner(benchmeter_t *meter, uint64_t niter,
    3838    char *error, size_t error_size)
    3939{
    40         stopwatch_start(stopwatch);
     40        benchmeter_start(meter);
    4141
    4242        void **p = malloc(niter * sizeof(void *));
     
    6767        free(p);
    6868
    69         stopwatch_stop(stopwatch);
     69        benchmeter_stop(meter);
    7070
    7171        return true;
Note: See TracChangeset for help on using the changeset viewer.