numam-spdk/include/spdk
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
..
accel_engine.h subsystem/accel: add entry point for .write_config_json 2020-02-18 08:05:34 +00:00
assert.h include: move standard includes into spdk/stdinc.h 2017-05-08 10:11:01 -07:00
barrier.h barrier: cleanup the file 2019-03-15 19:32:55 +00:00
base64.h util/base64: Extend b64 decode to calculate exact len 2020-02-03 11:39:49 +00:00
bdev_module.h bdev: Add spdk_bdev_io_get_nvme_fused_status function 2020-01-27 17:39:52 +00:00
bdev_zone.h bdev/zone: scattered zone append 2020-02-20 09:53:03 +00:00
bdev.h bdev: Add spdk_bdev_get_acwu function 2020-01-27 17:39:52 +00:00
bit_array.h util: added bit array bitmask load, store and clear 2018-12-14 15:34:53 +00:00
blob_bdev.h blob_bdev: add spdk_bdev_create_bs_dev_from_desc 2019-09-18 02:59:59 +00:00
blob.h lib/blob: add option to enable extent pages 2020-01-27 18:06:43 +00:00
blobfs_bdev.h blobfs/fuse: put FUSE code in module blobfs_bdev 2019-10-15 16:25:09 +00:00
blobfs.h blobfs: add result for set_cache_size 2019-11-07 00:33:25 +00:00
conf.h include/conf: add comments for public APIs 2018-02-26 11:59:09 -05:00
cpuset.h cpuset: Expose internal of struct spdk_cpuset in header file 2019-07-04 00:30:22 +00:00
crc16.h util/crc16: Add spdk_crc16_t10dif_copy to use in read strip and write insert 2018-12-20 17:52:29 +00:00
crc32.h util: Move architecture detection to crc32c.c 2019-02-04 19:14:22 +00:00
dif.h dif: Add spdk_dix_remap_ref_tag to remap ref. tag for separate metadata payload 2019-07-11 11:14:22 +00:00
endian.h include: move standard includes into spdk/stdinc.h 2017-05-08 10:11:01 -07:00
env_dpdk.h env: add a new function for printing memory layout 2019-12-13 11:05:57 +00:00
env.h env: add spdk_pci_device_get_type 2019-10-24 17:04:04 +00:00
event.h app: added --json-ignore-init-errors 2020-02-13 09:53:02 +00:00
fd.h include/fd.h: add comments for pubclic APIs 2018-01-04 12:12:10 -05:00
file.h util: add a new file operation API 2019-05-15 18:54:27 +00:00
ftl.h lib/ftl: Create l2p on l2p_path file if set in config 2020-03-06 10:28:21 +00:00
gpt_spec.h bdev/gpt: dump partition name 2017-07-12 18:12:52 -04:00
histogram_data.h histograms: add function to merge histograms 2018-11-15 23:03:26 +00:00
ioat_spec.h ioat_spec: fix gcc9 warning 2019-06-17 14:09:03 +00:00
ioat.h ioat: add APIs to only build descriptors 2019-02-18 07:44:17 +00:00
iscsi_spec.h iscsi: fix layout of logout request reason field 2017-09-22 16:11:11 -04:00
json.h json: add utilities function enabling itaration over JSON object 2018-10-18 16:07:37 +00:00
jsonrpc.h jsonrpc: always allocate response for request 2019-07-19 20:56:54 +00:00
likely.h include: move standard includes into spdk/stdinc.h 2017-05-08 10:11:01 -07:00
log.h lib/log: passing va_list to user-provided log call 2019-10-09 14:35:51 +00:00
lvol.h lvol: ensure enum for lvol clear method is the same as blobstore 2019-02-28 20:50:27 +00:00
memory.h memory.h: move to public headers 2020-03-19 08:50:45 +00:00
mmio.h mmio: add functions for 1 and 2 byte I/O accesses 2017-10-13 10:46:00 -04:00
nbd.h nbd: Remove unused spdk_event forward declaration 2019-04-23 20:22:55 +00:00
net.h net: make the net initialization in a correct way 2018-12-20 01:37:50 +00:00
notify.h lib/notify: rename spdk_notify_get_events to spdk_notify_foreach_event 2019-05-07 06:11:27 +00:00
nvme_intel.h nvme: pad struct spdk_nvme_intel_marketing_description_page 2019-06-05 02:46:50 +00:00
nvme_ocssd_spec.h ocssd: add chunk notification log struct 2018-09-27 01:30:45 +00:00
nvme_ocssd.h ocssd: add chunk notification log struct 2018-09-27 01:30:45 +00:00
nvme_spec.h nvme: fix simple typo in a comment in the spec header 2020-03-24 15:56:32 +00:00
nvme.h nvme: extend ctrlr opts with admin queue size 2020-03-12 09:04:18 +00:00
nvmf_cmd.h nvmf: Move custom admin command handler implementation to nvmf_tgt 2020-02-12 12:07:04 +00:00
nvmf_fc_spec.h nvme: define SPDK_NVME_NQN_FIELD_SIZE 2019-12-23 08:44:10 +00:00
nvmf_spec.h nvmf: remove min number of admin queue entries from spec file 2020-03-12 09:04:18 +00:00
nvmf_transport.h nvmf: use global VALUE_4KB value 2020-03-19 08:50:45 +00:00
nvmf.h lib/nvmf: Make spdk_nvmf_poll_group_destroy() asynchronous 2020-03-17 08:49:00 +00:00
opal_spec.h nvme/opal: use static locking ranges table 2020-03-25 07:52:28 +00:00
opal.h nvme/opal: consolidate two get_locking_ranges APIs into one 2020-03-25 07:52:28 +00:00
pci_ids.h pci_ids: add virtio-vhost-user device id 2019-06-03 20:11:22 +00:00
pipe.h pipe: Add a utility for buffering data from sockets 2019-11-20 09:35:32 +00:00
queue_extras.h queue_extras: use SPDK_CONTAINEROF 2019-10-07 15:06:01 +00:00
queue.h queue: redefine TAILQ_REMOVE for scan-build 2019-07-26 19:28:31 +00:00
reduce.h lib/reduce: change and move the max IOVEC define for reduce 2019-07-29 04:36:59 +00:00
rpc.h rpc: add spdk_rpc_verify_methods() 2019-11-06 15:19:48 +00:00
scsi_spec.h scsi: fix SCSI reservation typos 2019-05-30 21:42:36 +00:00
scsi.h lib/scsi: Pass SCSI task to SCSI layer to get DIF context 2019-11-21 08:01:29 +00:00
sock.h sock/posix: Zero copy send 2020-01-27 17:42:24 +00:00
stdinc.h env: Check supported iommu address width before using iova-mode=va 2019-11-27 07:08:32 +00:00
string.h string: spdk_strtol to delegate additional error checking 2019-01-29 00:10:57 +00:00
thread.h lib/thread: spdk_thread_poll() measures run time per call by reading end TSC 2020-03-25 07:52:53 +00:00
trace.h trace: shorten max name from 44 to 24 characters 2019-05-02 08:41:56 +00:00
util.h lib/util: Add spdk_sn32_lt/gt() to compare two numbers based on serial number arithmetic 2020-03-19 08:51:31 +00:00
uuid.h util/uuid: add a new uuid copy API. 2018-12-06 22:25:09 +00:00
version.h version: 20.04 pre 2020-01-31 12:35:05 +00:00
vhost.h vhost: add completion callback to lib init 2019-05-02 17:06:34 +00:00
vmd.h lib/vmd: detach devices during shutdown 2020-02-04 16:50:25 +00:00