tsc.h 728 B

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