MCPcopy Create free account
hub / github.com/F-Stack/f-stack / estimate_tsc_freq

Function estimate_tsc_freq

dpdk/lib/eal/common/eal_common_timer.c:38–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38static uint64_t
39estimate_tsc_freq(void)
40{
41#define CYC_PER_10MHZ 1E7
42 RTE_LOG(WARNING, EAL, "WARNING: TSC frequency estimated roughly"
43 " - clock timings may be less accurate.\n");
44 /* assume that the rte_delay_us_sleep() will sleep for 1 second */
45 uint64_t start = rte_rdtsc();
46 rte_delay_us_sleep(US_PER_S);
47 /* Round up to 10Mhz. 1E7 ~ 10Mhz */
48 return RTE_ALIGN_MUL_NEAR(rte_rdtsc() - start, CYC_PER_10MHZ);
49}
50
51void
52set_tsc_freq(void)

Callers 1

set_tsc_freqFunction · 0.85

Calls 2

rte_rdtscFunction · 0.50
rte_delay_us_sleepFunction · 0.50

Tested by

no test coverage detected