Linux Perf
tsc.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __PERF_TSC_H
3 #define __PERF_TSC_H
4 
5 #include <linux/types.h>
6 
7 #include "event.h"
8 
11  u32 time_mult;
12  u64 time_zero;
13 };
14 struct perf_event_mmap_page;
15 
16 int perf_read_tsc_conversion(const struct perf_event_mmap_page *pc,
17  struct perf_tsc_conversion *tc);
18 
19 u64 perf_time_to_tsc(u64 ns, struct perf_tsc_conversion *tc);
20 u64 tsc_to_perf_time(u64 cyc, struct perf_tsc_conversion *tc);
21 u64 rdtsc(void);
22 
23 struct perf_event_mmap_page;
24 struct perf_tool;
25 struct machine;
26 
27 int perf_event__synth_time_conv(const struct perf_event_mmap_page *pc,
28  struct perf_tool *tool,
29  perf_event__handler_t process,
30  struct machine *machine);
31 
32 #endif
int perf_read_tsc_conversion(const struct perf_event_mmap_page *pc, struct perf_tsc_conversion *tc)
Definition: tsc.c:12
int(* perf_event__handler_t)(struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, struct machine *machine)
Definition: event.h:664
u16 time_shift
Definition: tsc.h:10
def ns(sec, nsec)
Definition: tool.h:44
u64 tsc_to_perf_time(u64 cyc, struct perf_tsc_conversion *tc)
Definition: tsc.c:18
static struct perf_tool tool
Definition: builtin-diff.c:362
u64 perf_time_to_tsc(u64 ns, struct perf_tsc_conversion *tc)
Definition: tsc.c:7
u64 rdtsc(void)
Definition: tsc.c:41
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)
Definition: tsc.c:50