From: =?gb18030?B?0KHP6dfT?= <wang010366@vip.qq.com>
To: =?gb18030?B?ZGV2?= <dev@dpdk.org>
Subject: [dpdk-dev] rte_get_tsc_cycles function slowly increase ?
Date: Fri, 2 Jul 2021 17:36:18 +0800 [thread overview]
Message-ID: <tencent_EBD6894DB61A9785C0B77974BAE47DE42407@qq.com> (raw)
[-- 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> // 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 phenomenon that elapsed1_s is inaccurate, elapsed2_s is accurate. and the gap between elapsed2_s and elapsed1_s has increasingly widened.
why? how to explain the phenomenon or fix the problem.
Hope that helps! Regards,
wang.
reply other threads:[~2021-07-05 6:58 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tencent_EBD6894DB61A9785C0B77974BAE47DE42407@qq.com \
--to=wang010366@vip.qq.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).