logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

benchmp, benchmp_getstate, benchmp_interval, start, stop, get_n, set_n, gettime, settime, get_enough,

Author

       Carl Staelin and Larry McVoy

       Comments, suggestions, and bug reports are always welcome.

(c)1998 Larry McVoy                                  $Date:$                                   lmbenchtiming(3)

Description

       The  single  most  important  element of a good benchmarking system is the quality and reliability of its
       measurement system.  lmbench's timing subsystem  manages  the  experimental  timing  process  to  produce
       accurate  results  in  the  least  possible time.  lmbench includes methods for measuring and eliminating
       several factors that influence  the accuracy of timing measurements, such as the resolution of the system
       clock.

       lmbench gets accurate  results  by  considering  clock  resolution,  auto-sizing  the  duration  of  each
       benchmark, and conducting multiple experiments.

       voidbenchmp(initialize,benchmark,cleanup,enough,parallel,warmup,repetitions,cookie)
              measures  the  performance of benchmark repeatedly and reports the median result.  benchmp creates
              parallel sub-processes which run benchmark in  parallel.   This  allows  lmbench  to  measure  the
              system's  ability to scale as the number of client processes increases.  Each sub-process executes
              initialize before starting the benchmarking cycle.  It will call benchmark several times in  order
              to  collect  repetitions results.  After all the benchmark results have been collected, cleanup is
              called to cleanup any resources which may have been allocated by initialize or benchmark.cookie
              is a void pointer to a hunk of memory that can be used to store any parameters or  state  that  is
              needed by the benchmark.

       voidbenchmp_getstate()
              returns  a  void pointer to the lmbench-internal state used during benchmarking.  The state is not
              to be used or accessed directly by clients, but rather would be passed into benchmp_interval.iter_tbenchmp_interval(void*state)
              returns the number of times the benchmark should execute its benchmark  loop  during  this  timing
              interval.   This  is used only for weird benchmarks which cannot implement the benchmark body in a
              function which can return, such as the page fault handler.  Please see lat_sig.c for sample usage.

       voidstart(structtimeval*begin)
              starts a timing interval.  If begin is non-null, save the start time in begin.uint64stop(structtimeval*begin,structtimeval*end)
              stops a timing interval, returning the number of elapsed micro-seconds.

       uint64get_n()
              returns the number of times loop_body was executed during the timing interval.

       voidset_n(uint64n)
              sets the number of times loop_body was executed during the timing interval.

       uint64gettime()
              returns the number of micro-seconds in the timing interval.

       voidsettime(uint64u)
              sets the number of micro-seconds in the timing interval.

       uint64get_enough(uint64enough)
              return the time in micro-seconds needed to accurately measure a timing interval.

       uint64t_overhead()
              return the time in micro-seconds needed to measure time.

       doublel_overhead()
              return the time in micro-seconds needed to do a simple loop.

Futures

       Development of lmbench is continuing.

Name

       benchmp,  benchmp_getstate,  benchmp_interval,  start,  stop, get_n, set_n, gettime, settime, get_enough,
       t_overhead, l_overhead - the lmbench timing subsystem

See Also

lmbench(8), lmbench(3), reporting(3), results(3).

Synopsis

#includetypedefu_longiter_t;typedef(*bench_f)(iter_titerations,void*cookie);typedef(*support_f)(iter_titerations,void*cookie);voidbenchmp(support_finitialize,bench_fbenchmark,support_fcleanup,intenough,intparallel,intwarmup,intrepetitions,void*cookie);void*benchmp_getstate();iter_tbenchmp_interval(void*state);voidstart(structtimeval*begin);uint64stop(structtimeval*begin,structtimeval*end);uint64get_n();voidset_n(uint64n);uint64gettime();voidsettime(uint64u);uint64get_enough(uint64enough);uint64t_overhead();doublel_overhead();

Variables

       There are three environment variables that can be used to modify the lmbench  timing  subsystem:  ENOUGH,
       TIMING_O,  and LOOP_O.  The environment variables can be used to directly set the results of get_enough,t_overhead, and l_overhead.  When running a large number of benchmarks, or repeating the same benchmark
       many times, this can save time by eliminating the necessity of recalculating these values for each run.

See Also