numam-spdk/test/common
Shuhei Matsumoto 2139be1598 lib/thread: spdk_thread_poll() measures run time per call by reading end TSC
Update spdk_thread_poll() to count SPDK thread stats correctly on multiple
SPDK threads per reactor configuration.

spdk_thread_poll() gets start time and reads TSC at end as end time,
and then gets delta between them as run time. Run time is added to idle
time or busy time according to the result of polling.

Reactor overhead is included into the next thread which calls
spdk_thread_poll() now.

spdk_thread_poll() saves the end time to the current thread to use it
as the start time of the next thread.

Unit test framework for this patch and the next patch need to access
thread->tsc_last. In the next patch, reactor will use the end time of
the current thread to the start time of the next thread in reactor_run()
to realize the idea.

Hence add an new API spdk_thread_get_last_tsc(). The corresponding
variable is named as tsc_last and it is good and is aligned with
DPDK (DPDK has used tsc_start and tsc_end as variable name). But
last_tsc will be better as API name because the last TSC value is
easier to understand.

Then add necessary unit test and update the unit test framework.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I5e465e9283c032acb427576d0c90f9e1414f2271
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1048
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2020-03-25 07:52:53 +00:00
..
config vm_setup: add abigail for fedora machines. 2020-03-18 08:02:30 +00:00
lib lib/thread: spdk_thread_poll() measures run time per call by reading end TSC 2020-03-25 07:52:53 +00:00
applications.sh test/common: Introduce new test flag for enabling debug app runs 2020-02-27 10:15:40 +00:00
autotest_common.sh test/fuse: make the --with-fuse option be consistent with configure 2020-03-23 09:36:46 +00:00
skipped_build_files.txt sock/uring: Add the async network I/O support for socket 2020-03-20 08:41:28 +00:00
skipped_tests.txt test/iscsi: add application for target fuzz testing. 2020-03-13 08:53:46 +00:00