/tmp/l4check/full_tree/trunk/l4/pkg/rt_mon/include/clock.h File Reference

macros for getting time values More...

#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.


Detailed Description

macros for getting time values

Date:
11/15/2004
Author:
Martin Pohlack <mp26@os.inf.tu-dresden.de>

Define Documentation

#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)


Function Documentation

L4_INLINE void rt_mon_calibrate_clock ( int  clock  ) 

Calibrates scalers etc. for the use of the corresponding clock.

Parameters:
clock clock type to calibrate for

References RT_MON_FAST_THREAD_TIME, and RT_MON_TSC_TO_US_TIME.


Generated on Wed Apr 11 06:43:00 2012 for rt_mon - runtime monitoring by  doxygen 1.5.6