Lines Matching refs:tc

18 u64 perf_time_to_tsc(u64 ns, struct perf_tsc_conversion *tc)  in perf_time_to_tsc()  argument
22 t = ns - tc->time_zero; in perf_time_to_tsc()
23 quot = t / tc->time_mult; in perf_time_to_tsc()
24 rem = t % tc->time_mult; in perf_time_to_tsc()
25 return (quot << tc->time_shift) + in perf_time_to_tsc()
26 (rem << tc->time_shift) / tc->time_mult; in perf_time_to_tsc()
29 u64 tsc_to_perf_time(u64 cyc, struct perf_tsc_conversion *tc) in tsc_to_perf_time() argument
33 if (tc->cap_user_time_short) in tsc_to_perf_time()
34 cyc = tc->time_cycles + in tsc_to_perf_time()
35 ((cyc - tc->time_cycles) & tc->time_mask); in tsc_to_perf_time()
37 quot = cyc >> tc->time_shift; in tsc_to_perf_time()
38 rem = cyc & (((u64)1 << tc->time_shift) - 1); in tsc_to_perf_time()
39 return tc->time_zero + quot * tc->time_mult + in tsc_to_perf_time()
40 ((rem * tc->time_mult) >> tc->time_shift); in tsc_to_perf_time()
44 struct perf_tsc_conversion *tc) in perf_read_tsc_conversion() argument
52 tc->time_mult = pc->time_mult; in perf_read_tsc_conversion()
53 tc->time_shift = pc->time_shift; in perf_read_tsc_conversion()
54 tc->time_zero = pc->time_zero; in perf_read_tsc_conversion()
55 tc->time_cycles = pc->time_cycles; in perf_read_tsc_conversion()
56 tc->time_mask = pc->time_mask; in perf_read_tsc_conversion()
57 tc->cap_user_time_zero = pc->cap_user_time_zero; in perf_read_tsc_conversion()
58 tc->cap_user_time_short = pc->cap_user_time_short; in perf_read_tsc_conversion()
68 if (!tc->cap_user_time_zero) in perf_read_tsc_conversion()
87 struct perf_tsc_conversion tc; in perf_event__synth_time_conv() local
92 err = perf_read_tsc_conversion(pc, &tc); in perf_event__synth_time_conv()
100 event.time_conv.time_mult = tc.time_mult; in perf_event__synth_time_conv()
101 event.time_conv.time_shift = tc.time_shift; in perf_event__synth_time_conv()
102 event.time_conv.time_zero = tc.time_zero; in perf_event__synth_time_conv()
103 event.time_conv.time_cycles = tc.time_cycles; in perf_event__synth_time_conv()
104 event.time_conv.time_mask = tc.time_mask; in perf_event__synth_time_conv()
105 event.time_conv.cap_user_time_zero = tc.cap_user_time_zero; in perf_event__synth_time_conv()
106 event.time_conv.cap_user_time_short = tc.cap_user_time_short; in perf_event__synth_time_conv()
118 struct perf_record_time_conv *tc = (struct perf_record_time_conv *)event; in perf_event__fprintf_time_conv() local
121 ret = fprintf(fp, "\n... Time Shift %" PRI_lu64 "\n", tc->time_shift); in perf_event__fprintf_time_conv()
122 ret += fprintf(fp, "... Time Muliplier %" PRI_lu64 "\n", tc->time_mult); in perf_event__fprintf_time_conv()
123 ret += fprintf(fp, "... Time Zero %" PRI_lu64 "\n", tc->time_zero); in perf_event__fprintf_time_conv()
130 if (event_contains(*tc, time_cycles)) { in perf_event__fprintf_time_conv()
132 tc->time_cycles); in perf_event__fprintf_time_conv()
134 tc->time_mask); in perf_event__fprintf_time_conv()
136 tc->cap_user_time_zero); in perf_event__fprintf_time_conv()
138 tc->cap_user_time_short); in perf_event__fprintf_time_conv()