summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f7b1640)
Contributed by Nils Carlson.
#ifndef UST_CLOCK_H
#define UST_CLOCK_H
#ifndef UST_CLOCK_H
#define UST_CLOCK_H
#include <sys/time.h>
#include <ust/kcompat/kcompat.h>
#include <sys/time.h>
#include <ust/kcompat/kcompat.h>
For merging traces with the kernel, a time source compatible with that of
the kernel is necessary.
For merging traces with the kernel, a time source compatible with that of
the kernel is necessary.
+ Instead of gettimeofday(), we are now using clock_gettime for better
+ precision and monotonicity.
+
*/
#define TRACE_CLOCK_GENERIC
*/
#define TRACE_CLOCK_GENERIC
static __inline__ u64 trace_clock_read64(void)
{
static __inline__ u64 trace_clock_read64(void)
{
- gettimeofday(&tv, NULL);
- retval = tv.tv_sec;
- retval *= 1000000;
- retval += tv.tv_usec;
+ clock_gettime(CLOCK_MONOTONIC, &ts);
+ retval = ts.tv_sec;
+ retval *= 1000000000;
+ retval += ts.tv_nsec;
static __inline__ u64 trace_clock_frequency(void)
{
static __inline__ u64 trace_clock_frequency(void)
{
}
static __inline__ u32 trace_clock_freq_scale(void)
}
static __inline__ u32 trace_clock_freq_scale(void)
libust_la_LIBADD = \
-lpthread \
libust_la_LIBADD = \
-lpthread \
$(top_builddir)/snprintf/libustsnprintf.la \
$(top_builddir)/libustcomm/libustcomm.la
$(top_builddir)/snprintf/libustsnprintf.la \
$(top_builddir)/libustcomm/libustcomm.la