Back to index

glibc  2.9
Defines | Typedefs
hp-timing.h File Reference
#include <string.h>
#include <sys/param.h>
#include <stdio-common/_itoa.h>
#include <atomic.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define HP_TIMING_AVAIL   (1)
#define HP_TIMING_INLINE   (1)
#define HP_TIMING_ZERO(Var)   (Var) = (0)
#define HP_TIMING_NOW(Var)
#define HP_TIMING_DIFF_INIT()
#define HP_TIMING_DIFF(Diff, Start, End)   (Diff) = ((End) - (Start))
#define HP_TIMING_ACCUM(Sum, Diff)
#define HP_TIMING_ACCUM_NT(Sum, Diff)   (Sum) += (Diff)
#define HP_TIMING_PRINT(Buf, Len, Val)

Typedefs

typedef unsigned long long int hp_timing_t

Define Documentation

#define HP_TIMING_ACCUM (   Sum,
  Diff 
)
Value:
do {                                                                 \
    hp_timing_t __diff = (Diff) - GLRO(dl_hp_timing_overhead);              \
    __arch_atomic_exchange_and_add_64 (&(Sum), __diff);                       \
  } while (0)

Definition at line 131 of file hp-timing.h.

#define HP_TIMING_ACCUM_NT (   Sum,
  Diff 
)    (Sum) += (Diff)

Definition at line 138 of file hp-timing.h.

#define HP_TIMING_AVAIL   (1)

Definition at line 72 of file hp-timing.h.

#define HP_TIMING_DIFF (   Diff,
  Start,
  End 
)    (Diff) = ((End) - (Start))

Definition at line 127 of file hp-timing.h.

#define HP_TIMING_DIFF_INIT ( )
Value:
do {                                                                 \
    if (GLRO(dl_hp_timing_overhead) == 0)                            \
      {                                                                     \
       int __cnt = 5;                                                       \
       GLRO(dl_hp_timing_overhead) = ~0ull;                                 \
       do                                                            \
         {                                                           \
	    hp_timing_t __t1, __t2;                                         \
           HP_TIMING_NOW (__t1);                                     \
           HP_TIMING_NOW (__t2);                                     \
           if (__t2 - __t1 < GLRO(dl_hp_timing_overhead))                   \
             GLRO(dl_hp_timing_overhead) = __t2 - __t1;              \
         }                                                           \
       while (--__cnt > 0);                                          \
      }                                                                     \
  } while (0)

Definition at line 108 of file hp-timing.h.

#define HP_TIMING_INLINE   (1)

Definition at line 75 of file hp-timing.h.

#define HP_TIMING_NOW (   Var)
Value:
do {                                                           \
        union { long long ll; long ii[2]; } _var;                     \
       long tmp;                                               \
        __asm__ __volatile__ (                                        \
              "1:    mfspr  %0,269;"                           \
              "      mfspr  %1,268;"                           \
              "      mfspr  %2,269;"                           \
              "      cmpw   %0,%2;"                                   \
              "      bne    1b;"                               \
              : "=r" (_var.ii[0]), "=r" (_var.ii[1]) , "=r" (tmp)     \
              : : "cr0"                                        \
              );                                               \
       Var = _var.ll;                                                 \
  } while (0)

Definition at line 89 of file hp-timing.h.

#define HP_TIMING_PRINT (   Buf,
  Len,
  Val 
)
Value:
do {                                                                 \
    char __buf[20];                                                  \
    char *__cp = _itoa (Val, __buf + sizeof (__buf), 10, 0);                \
    size_t __len = (Len);                                            \
    char *__dest = (Buf);                                            \
    while (__len-- > 0 && __cp < __buf + sizeof (__buf))                    \
      *__dest++ = *__cp++;                                           \
    memcpy (__dest, " ticks", MIN (__len, sizeof (" ticks")));  \
  } while (0)

Definition at line 141 of file hp-timing.h.

#define HP_TIMING_ZERO (   Var)    (Var) = (0)

Definition at line 81 of file hp-timing.h.


Typedef Documentation

typedef unsigned long long int hp_timing_t

Definition at line 78 of file hp-timing.h.