Spdk/scripts
Michal Berger 36e573fc6b scripts/common: Introduce cache for the pci devices
Expose a cache of pci devices in form of an assoc array that could be
looked up during the runtime of a script like setup.sh.

In case of setup.sh, caching speeds up execution quite visibly:

config run, no caching:
real    0m4.488s
user    0m1.440s
sys     0m1.260s

config run, caching in use:
real    0m2.876s
user    0m0.365s
sys     0m0.420s

Note that for initial config runs, binding controllers to proper
drivers is the actual bottleneck.

status run, no caching:
real    0m1.877s
user    0m1.252s
sys     0m0.984s

status run, caching in use:
real    0m0.371s
user    0m0.242s
sys     0m0.204s

reset run, no caching:
real    0m2.559s
user    0m1.409s
sys     0m1.322s

reset run, caching in use:
real    0m0.960s
user    0m0.432s
sys     0m0.419s

Additionally, in case common tools, e.g. lspci, are missing, fallback to
sysfs to pick all needed devices from the pci bus. Targeted for Linux
systems only.

Change-Id: Ib69ef724b9f09eca0cbb9b88f1c363edc1efd5dc
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1845
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-05-07 08:23:52 +00:00
..
ceph test: Shellcheck - correct rule: Consider using { cmd1; cmd2; } 2019-11-22 13:51:15 +00:00
perf scripts/perf: Enable percentile 999 measurements in fio config 2020-04-17 07:31:55 +00:00
rpc nvme: Add the priority field in struct spdk_nvme_transport_id 2020-04-24 15:53:34 +00:00
spdkcli module/raid: make raid_level an enum instead of plain integer 2019-11-01 14:34:32 +00:00
vagrant scripts/vagrant: fix exporting array in bash script 2020-04-28 13:47:46 +00:00
check_format.sh test: shellcheck - ignore SC2010 2020-01-17 14:07:39 +00:00
common.sh scripts/common: Introduce cache for the pci devices 2020-05-07 08:23:52 +00:00
config_converter.py global: rename copy to accel 2020-02-18 08:05:34 +00:00
detect_cc.sh make: Allow CC and CXX to contain spaces 2020-04-07 08:37:57 +00:00
dpdk_mem_info.py scripts: add a parser for the dpdk memory stats. 2020-01-24 05:46:43 +00:00
eofnl scripts/check_format: check trailing whitespace 2017-10-24 17:35:23 -04:00
fio.py scripts/fio.py: add argparse for command line parameters 2019-06-03 04:34:10 +00:00
gdb_macros.py scripts: Use range instead of xrange 2019-02-13 22:54:15 +00:00
gen_ftl.sh lib/ftl: Functional tests 2020-01-15 12:24:44 +00:00
gen_nvme.sh rpc: Rename construct_nvme_bdev to bdev_nvme_attach_controller 2019-09-18 21:53:25 +00:00
genconfig.py genconfig.py: allow numbers in config option names 2020-02-20 14:40:19 +00:00
histogram.py histograms: add script for parsing histogram data 2019-01-24 14:14:32 +00:00
iostat.py script: add iostat.py to check bdev iostat 2020-01-22 13:51:41 +00:00
pkgdep.sh scripts/pkgdep: Fix failing symlink creation during python instalation 2020-04-16 08:08:40 +00:00
posix.txt build: Automatically detect use of POSIX includes 2017-05-08 13:20:37 -07:00
prep_benchmarks.sh test: Shellcheck - correct rule: $/${} is unnecessary on arithmetic variables. 2019-11-07 23:04:10 +00:00
qat_setup.sh qat_setup: Fix logic check against service's exit status 2020-04-02 07:03:47 +00:00
rpc_http_proxy.py scripts: Add SSL certificate option in rpc_http_proxy 2020-05-05 08:04:00 +00:00
rpc.py nvme: Add the priority field in struct spdk_nvme_transport_id 2020-04-24 15:53:34 +00:00
setup.sh scripts/common: Introduce cache for the pci devices 2020-05-07 08:23:52 +00:00
spdkcli.py spdkcli: fix pylint warnings 2019-10-22 17:23:00 +00:00