5 #include <linux/perf_event.h> 7 #include "../../perf.h" 8 #include <linux/types.h> 9 #include "../../util/debug.h" 10 #include "../../util/tsc.h" 25 cap_user_time_zero = pc->cap_user_time_zero;
27 if (pc->lock == seq && !(seq & 1))
30 pr_debug(
"failed to get perf_event_mmap_page lock\n");
35 if (!cap_user_time_zero)
43 unsigned int low, high;
45 asm volatile(
"rdtsc" :
"=a" (low),
"=d" (high));
47 return low | ((u64)high) << 32;
69 if (err == -EOPNOTSUPP)
74 pr_debug2(
"Synthesizing TSC conversion information\n");
80 return process(tool, &event, NULL, machine);
int(* perf_event__handler_t)(struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, struct machine *machine)
struct perf_tsc_conversion tc
#define pr_debug2(fmt,...)
struct time_conv_event time_conv
#define pr_debug(fmt,...)
static struct perf_tool tool
int perf_event__synth_time_conv(const struct perf_event_mmap_page *pc, struct perf_tool *tool, perf_event__handler_t process, struct machine *machine)
struct perf_event_header header
int perf_read_tsc_conversion(const struct perf_event_mmap_page *pc, struct perf_tsc_conversion *tc)