Merge tag 'input-for-v6.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-block.git] / tools / perf / util / tsc.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
0b437860
AH
2#ifndef __PERF_TSC_H
3#define __PERF_TSC_H
4
5#include <linux/types.h>
6
81e70d7e
LY
7#include "event.h"
8
2a28e230
AH
9struct perf_tsc_conversion {
10 u16 time_shift;
11 u32 time_mult;
12 u64 time_zero;
78a93d4c
LY
13 u64 time_cycles;
14 u64 time_mask;
15
16 bool cap_user_time_zero;
17 bool cap_user_time_short;
2a28e230 18};
ea49e01c 19
2a28e230
AH
20struct perf_event_mmap_page;
21
22int perf_read_tsc_conversion(const struct perf_event_mmap_page *pc,
23 struct perf_tsc_conversion *tc);
0b437860
AH
24
25u64 perf_time_to_tsc(u64 ns, struct perf_tsc_conversion *tc);
26u64 tsc_to_perf_time(u64 cyc, struct perf_tsc_conversion *tc);
a6a69db4 27u64 rdtsc(void);
bc2373a5 28double arch_get_tsc_freq(void);
0b437860 29
81e70d7e
LY
30size_t perf_event__fprintf_time_conv(union perf_event *event, FILE *fp);
31
ea49e01c 32#endif // __PERF_TSC_H