librfn
An ad-hoc utility library
Data Structures | Enumerations | Functions
libbench.h File Reference

Micro benchmark suite for some librfn features. More...

#include <assert.h>
#include <stdio.h>
#include <string.h>
#include "librfn.h"

Go to the source code of this file.

Data Structures

struct  benchmark_results_t
 

Enumerations

enum  {
  BENCHMARK_SINGLE, BENCHMARK_PAIRED, BENCHMARK_SIMPLE_RUN, BENCHMARK_ATOMIC_RUN,
  BENCHMARK_MAX
}
 

Functions

void benchmark_init (benchmark_results_t *results, fibre_t *wakeup)
 
int benchmark_run_once (benchmark_results_t *results)
 
const char * benchmark_get_result (benchmark_results_t *results, int n, stats_t *s)
 
void benchmark_show_results (benchmark_results_t *results)
 
void benchmark_show_csv (benchmark_results_t *results, FILE *f)
 

Detailed Description

Micro benchmark suite for some librfn features.

libbench is example code that performs benchmarks on certain librfn features including the fibre scheduler.

Note that the benchmark suite measures elapsed time, rather than CPU load, and for this reason does not use the benchmark module of librfn (because the benchmark module is designed to estimate CPU load for DSP activities).

Definition in file libbench.h.

Enumeration Type Documentation

anonymous enum
Enumerator
BENCHMARK_SINGLE 
BENCHMARK_PAIRED 
BENCHMARK_SIMPLE_RUN 
BENCHMARK_ATOMIC_RUN 
BENCHMARK_MAX 

Definition at line 32 of file libbench.h.

Function Documentation

const char* benchmark_get_result ( benchmark_results_t results,
int  n,
stats_t s 
)

Definition at line 213 of file libbench.c.

void benchmark_init ( benchmark_results_t results,
fibre_t wakeup 
)

Definition at line 151 of file libbench.c.

int benchmark_run_once ( benchmark_results_t results)

Definition at line 159 of file libbench.c.

void benchmark_show_csv ( benchmark_results_t results,
FILE *  f 
)

Definition at line 236 of file libbench.c.

void benchmark_show_results ( benchmark_results_t results)

Definition at line 223 of file libbench.c.