Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
benchmark.c File Reference
#include <stdio.h>
#include <unistd.h>
#include <math.h>
#include "config.h"
#include "system.h"
#include "benchmark.h"

Go to the source code of this file.

Macros

#define show_progress(total_time, progress_time)
 

Functions

unsigned int calculate_timespace (long load, struct config *config)
 
void start_benchmark (struct config *config)
 

Macro Definition Documentation

#define show_progress (   total_time,
  progress_time 
)
Value:
if (config->output != stdout) { \
fprintf(stdout, "Progress: %02lu %%\r", \
(progress_time * 100) / total_time); \
fflush(stdout); \
}

Definition at line 29 of file benchmark.c.

Function Documentation

unsigned int calculate_timespace ( long  load,
struct config config 
)

compute how many rounds of calculation we should do to get the given load time

Parameters
loadaimed load time in µs
Return values
roundsof calculation

Definition at line 45 of file benchmark.c.

void start_benchmark ( struct config config)

benchmark generates a specific sleep an load time with the performance governor and compares the used time for same calculations done with the configured powersave governor

Parameters
configconfig values for the benchmark

Definition at line 91 of file benchmark.c.