Azinix

timing.h File Reference

Utilities for performing timing. More...

#include <stdio.h>
#include <ctype.h>
#include <math.h>
#include <assert.h>
#include <time.h>

Go to the source code of this file.

Data Structures

struct  util_timing_t
 An encapsulation of a pair of u_int32_t's used to manipulate times. More...

Defines

#define rdmsr(msr, val1, val2)
#define wrmsr(msr, val1, val2)
#define rdtsc(low, high)   __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high))
#define rdtscl(low)   __asm__ __volatile__("rdtsc" : "=a" (low) : : "edx")
#define rdtscll(val)   __asm__ __volatile__("rdtsc" : "=A" (val))
#define write_tsc(val1, val2)   wrmsr(0x10, val1, val2)
#define rdpmc(counter, low, high)

Typedefs

typedef util_timing_t util_timing_t

Variables

double PROCESSOR_FREQUENCY


Detailed Description

Utilities for performing timing.

Definition in file timing.h.


Define Documentation

#define rdmsr ( msr,
val1,
val2   ) 

Value:

__asm__ __volatile__("rdmsr" \
                          : "=a" (val1), "=d" (val2) : "c" (msr))

Definition at line 60 of file timing.h.

#define rdpmc ( counter,
low,
high   ) 

Value:

__asm__ __volatile__("rdpmc" \
                          : "=a" (low), "=d" (high) \
                          : "c" (counter))

Definition at line 80 of file timing.h.

#define rdtsc ( low,
high   )     __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high))

Definition at line 69 of file timing.h.

#define rdtscl ( low   )     __asm__ __volatile__("rdtsc" : "=a" (low) : : "edx")

Definition at line 72 of file timing.h.

#define rdtscll ( val   )     __asm__ __volatile__("rdtsc" : "=A" (val))

Definition at line 75 of file timing.h.

#define write_tsc ( val1,
val2   )     wrmsr(0x10, val1, val2)

Definition at line 78 of file timing.h.

#define wrmsr ( msr,
val1,
val2   ) 

Value:

__asm__ __volatile__("wrmsr" \
                          : /* no outputs */ \
                          : "c" (msr), "a" (val1), "d" (val2))

Definition at line 64 of file timing.h.


Typedef Documentation

typedef struct util_timing_t util_timing_t

Definition at line 45 of file timing.h.


Variable Documentation

double PROCESSOR_FREQUENCY

Definition at line 12 of file util.c.