tsc.h (498495dba268b20e8eadd7fe93c140c68b6cc9d2) tsc.h (ea49e01cfabd73c94a61649cd04fa524a2beff3c)
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __PERF_TSC_H
3#define __PERF_TSC_H
4
5#include <linux/types.h>
6
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
9struct perf_tsc_conversion {
10 u16 time_shift;
11 u32 time_mult;
12 u64 time_zero;
13};
7struct perf_tsc_conversion {
8 u16 time_shift;
9 u32 time_mult;
10 u64 time_zero;
11};
12
14struct perf_event_mmap_page;
15
16int perf_read_tsc_conversion(const struct perf_event_mmap_page *pc,
17 struct perf_tsc_conversion *tc);
18
19u64 perf_time_to_tsc(u64 ns, struct perf_tsc_conversion *tc);
20u64 tsc_to_perf_time(u64 cyc, struct perf_tsc_conversion *tc);
21u64 rdtsc(void);
22
13struct perf_event_mmap_page;
14
15int perf_read_tsc_conversion(const struct perf_event_mmap_page *pc,
16 struct perf_tsc_conversion *tc);
17
18u64 perf_time_to_tsc(u64 ns, struct perf_tsc_conversion *tc);
19u64 tsc_to_perf_time(u64 cyc, struct perf_tsc_conversion *tc);
20u64 rdtsc(void);
21
23struct perf_event_mmap_page;
24struct perf_tool;
25struct machine;
26
27int 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
22#endif // __PERF_TSC_H