• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/processor-trace/libipt/src/

Lines Matching refs:time

38 void pt_time_init(struct pt_time *time)
40 if (!time)
43 memset(time, 0, sizeof(*time));
47 uint32_t *lost_cyc, const struct pt_time *time)
49 if (!tsc || !time)
52 *tsc = time->tsc;
55 *lost_mtc = time->lost_mtc;
57 *lost_cyc = time->lost_cyc;
59 if (!time->have_tsc)
65 int pt_time_query_cbr(uint32_t *cbr, const struct pt_time *time)
67 if (!cbr || !time)
70 if (!time->have_cbr)
73 *cbr = time->cbr;
130 int pt_time_update_tsc(struct pt_time *time,
136 if (!time || !packet)
139 time->have_tsc = 1;
140 time->have_tma = 0;
141 time->have_mtc = 0;
142 time->tsc = time->base = packet->tsc;
143 time->ctc = 0;
144 time->fc = 0ull;
146 /* We got the full time; we recover from previous losses. */
147 time->lost_mtc = 0;
148 time->lost_cyc = 0;
153 int pt_time_update_cbr(struct pt_time *time,
161 if (!time || !packet)
168 time->have_cbr = 1;
169 time->cbr = cbr;
174 int pt_time_update_tma(struct pt_time *time,
181 if (!time || !packet || !config)
185 if (!time->have_tsc)
189 if (time->have_tma)
193 if (time->have_mtc)
207 time->have_tma = 1;
208 time->base -= fc;
209 time->fc += fc;
226 time->have_mtc = 1;
229 time->ctc = time->ctc_cyc = ctc & ctc_mask;
234 int pt_time_update_mtc(struct pt_time *time,
243 if (!time || !packet || !config)
246 have_tsc = time->have_tsc;
247 have_tma = time->have_tma;
248 have_mtc = time->have_mtc;
252 * Later MTCs will ensure that no time is lost - provided TMA provides
259 base = time->base;
260 last_ctc = time->ctc;
266 if (time->fc || time->lost_cyc || !have_mtc)
267 time->ctc_cyc = ctc;
270 time->have_mtc = 1;
271 time->fc = 0ull;
272 time->ctc = ctc;
275 time->lost_cyc = 0;
327 time->lost_mtc += 1;
336 time->tsc = time->base = base;
359 static int pt_time_adjust_cyc(uint64_t *cyc, const struct pt_time *time,
366 if (!time || !config || !fcr)
369 last_ctc = time->ctc_cyc;
370 ctc = time->ctc;
408 int pt_time_update_cyc(struct pt_time *time,
414 if (!time || !packet || !config)
418 time->lost_cyc += 1;
423 fc = time->fc;
427 errcode = pt_time_adjust_cyc(&cyc, time, config, fcr);
434 time->fc = fc;
435 time->tsc = time->base + fc;
508 /* A TSC outside of PSB+ may indicate loss of time. We do not use it