DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] rte_get_tsc_cycles function slowly increase ?
@ 2021-07-02  9:36  =?gb18030?B?0KHP6dfT?=
  0 siblings, 0 replies; only message in thread
From: =?gb18030?B?0KHP6dfT?= @ 2021-07-02  9:36 UTC (permalink / raw)
  To: =?gb18030?B?ZGV2?=

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb18030", Size: 1007 bytes --]

hi all,


rte_get_tsc_cycles function slowly increase, gettimeofday function is normally increase.

The following pseudo-code is my test example:
``` uint64_t hz = rte_get_tsc_hz(); uint64_t start_cycles = rte_get_tsc_cycles();           // running on first cpuuint64_t start_time = gettimeofday();                   // running on first cpu <perform operations&gt;                                    // running for 1 day or 2 day uint64_t end_cycles = rte_get_tsc_cycles();             // running on second cpuuint64_t end_time = gettimeofday();                     // running on first cpu
elapsed1_s = (end_cycles - start_cycles) / hz;elapsed2_s = (end_time - start_time);
``` 



I found a&nbsp;&nbsp;phenomenon&nbsp;that&nbsp;elapsed1_s is&nbsp;inaccurate,&nbsp;elapsed2_s is&nbsp;accurate. and the gap between elapsed2_s and&nbsp;elapsed1_s has&nbsp;increasingly widened.&nbsp;&nbsp;


why? how to explain the&nbsp;phenomenon or fix the problem.




Hope that helps! Regards, 
wang.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-05  6:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-02  9:36 [dpdk-dev] rte_get_tsc_cycles function slowly increase ?  =?gb18030?B?0KHP6dfT?=

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).