Back to index

glibc  2.9
Functions
prof-freq.c File Reference
#include <sys/time.h>
#include <libc-internal.h>
#include <kernel-features.h>
#include <ldsodefs.h>

Go to the source code of this file.

Functions

int __profile_frequency (void)

Function Documentation

Definition at line 27 of file prof-freq.c.

{
#ifdef __ASSUME_AT_CLKTCK
  return GLRO(dl_clktck);
#else
  if (GLRO(dl_clktck) != 0)
    return GLRO(dl_clktck);

  struct itimerval tim;

  tim.it_interval.tv_sec = 0;
  tim.it_interval.tv_usec = 1;
  tim.it_value.tv_sec = 0;
  tim.it_value.tv_usec = 0;

  __setitimer (ITIMER_REAL, &tim, 0);
  __setitimer (ITIMER_REAL, 0, &tim);

  if (tim.it_interval.tv_usec < 2)
    return 0;

  return 1000000 / tim.it_interval.tv_usec;
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function: