Changeset 3fea752 in mainline for uspace/app/tester/tester.c


Ignore:
Timestamp:
2019-01-28T07:46:58Z (5 years ago)
Author:
Vojtech Horky <vojtech.horky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
67bcd81
Parents:
182487c6 (diff), 871cff9a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge changes to benchmarking tool (PR #151)

This merges refactoring and other changes to the perf/hbench tool.

The changes include:

  • Factor out all the duplicate code in individual benchmarks into a common harness
  • Properly compute average throughput
    • Added an awful function to compute square root until proper implementation is available (for the precision we need it is quite sufficient) [sqrt is needed to compute standard deviation]
  • Added option to dump data to CSV for further processing
  • Added option to specify minimal duration of a loop and number of runs to execute.
  • Added simple benchmark for fibril mutexes
  • Merged benchmarks from bnchmark application and removed it
    • These benchmarks are FS-related and IMHO are quite badly designed (they really stress only the block cache and not the FS on top of it; but still they might be useful as IPC benchmark of large data volumes)
  • Renamed perf to hbench to stress that it is a benchmarking application rather than a generic performance measurement tool (compared to perf in GNU/Linux)
  • Extended documentation a little bit
  • Added function for measuring wall-clock time (internally pass-through to uptime but available for other applications as the right API for this in HelenOS)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tester/tester.c

    r182487c6 r3fea752  
    3535 */
    3636
     37#include <assert.h>
    3738#include <stdio.h>
    3839#include <stddef.h>
     
    4041#include <str.h>
    4142#include <io/log.h>
     43#include <types/casting.h>
    4244#include "tester.h"
    4345
     
    144146        }
    145147
    146         unsigned int _len = (unsigned int) len;
    147         if ((_len != len) || (((int) _len) < 0)) {
    148                 printf("Command length overflow\n");
    149                 return;
    150         }
     148        assert(can_cast_size_t_to_int(len) && "test name length overflow");
    151149
    152150        for (test = tests; test->name != NULL; test++)
    153                 printf("%-*s %s%s\n", _len, test->name, test->desc,
     151                printf("%-*s %s%s\n", (int) len, test->name, test->desc,
    154152                    (test->safe ? "" : " (unsafe)"));
    155153
    156         printf("%-*s Run all safe tests\n", _len, "*");
     154        printf("%-*s Run all safe tests\n", (int) len, "*");
    157155}
    158156
Note: See TracChangeset for help on using the changeset viewer.