#include <l4/rt_mon/types.h>
#include <l4/sigma0/kip.h>
#include <l4/util/rdtsc.h>
#include <l4/util/thread_time.h>
Go to the source code of this file.
Defines | |
#define | RT_MON_GET_TIME(clock_type, time_val) |
Functions | |
L4_INLINE void | rt_mon_calibrate_clock (int clock) |
Calibrates scalers etc. for the use of the corresponding clock. |
#define RT_MON_GET_TIME | ( | clock_type, | |||
time_val | ) |
Value:
do \ { \ switch (clock_type) \ { \ case RT_MON_THREAD_TIME: \ { \ int ret; \ l4_threadid_t next; \ l4_umword_t prio; \ /* should not fail, as thread always exists */ \ ret = fiasco_get_cputime(l4_myself(), &next, &(time_val), &prio); \ break; \ } \ case RT_MON_TSC_TIME: \ (time_val) = l4_rdtsc(); \ break; \ case RT_MON_TSC_TO_US_TIME: \ (time_val) = l4_tsc_to_us(l4_rdtsc()); \ break; \ case RT_MON_FAST_THREAD_TIME: \ (time_val) = l4_tsc_to_us(l4util_thread_time(l4sigma0_kip())); \ break; \ case RT_MON_FAST_THREAD_TIME_TSC: \ (time_val) = l4util_thread_time(l4sigma0_kip()); \ break; \ default: \ LOG("corrupted CLOCKTYPE"); \ } \ } while (0)
L4_INLINE void rt_mon_calibrate_clock | ( | int | clock | ) |
Calibrates scalers etc. for the use of the corresponding clock.
clock | clock type to calibrate for |
References RT_MON_FAST_THREAD_TIME, and RT_MON_TSC_TO_US_TIME.