Add pcm measurement to nvmf tests
PCM - Processor Counter Monitor is an application to monitor performance and energy metrics of Intel® Core™, Xeon®, Atom™ and Xeon Phi™ processors. Using this measure tool will help us to capture memory bandwidth consumed on Intel processors. Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com> Change-Id: Ie580d2aad6ddd98c5256df65f65e478dd78317e5 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/541 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Karol Latecki <karol.latecki@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
e5bf4f061a
commit
db65d58359
@ -86,3 +86,18 @@ as a runtime environment parameter.
|
|||||||
# Test Results
|
# Test Results
|
||||||
When the test completes, you will find a csv file (nvmf_results.csv) containing the results in the target node
|
When the test completes, you will find a csv file (nvmf_results.csv) containing the results in the target node
|
||||||
directory /tmp/results.
|
directory /tmp/results.
|
||||||
|
|
||||||
|
#Processor Counter Monitor (PCM)
|
||||||
|
PCM Tools provides a number of command-line utilities for real-time monitoring.
|
||||||
|
Before using PCM Tools in nvmf perf scripts it needs to be installed on Target machine.
|
||||||
|
PCM source and instructions are available on https://github.com/opcm/pcm.
|
||||||
|
To enable PCM in perf test you need to add Target setting in config.json file:
|
||||||
|
```
|
||||||
|
"pcm_settings": ["pcm_directory", "measure_cpu", "measure_memory", delay_time, measure_interval, sample_count]
|
||||||
|
```
|
||||||
|
example:
|
||||||
|
```
|
||||||
|
"pcm_settings": ["/tmp/pcm", true, true, 10, 1, 30]
|
||||||
|
```
|
||||||
|
Example above will run PCM measure for cpu and memory, with start delay 10s, sample every 1 second,
|
||||||
|
and 30 samples for cpu measure. PCM memory do not support sample count.
|
||||||
|
@ -35,14 +35,20 @@ class Server:
|
|||||||
|
|
||||||
class Target(Server):
|
class Target(Server):
|
||||||
def __init__(self, name, username, password, mode, nic_ips, transport="rdma",
|
def __init__(self, name, username, password, mode, nic_ips, transport="rdma",
|
||||||
use_null_block=False, sar_settings=None):
|
use_null_block=False, sar_settings=None, pcm_settings=None):
|
||||||
|
|
||||||
super(Target, self).__init__(name, username, password, mode, nic_ips, transport)
|
super(Target, self).__init__(name, username, password, mode, nic_ips, transport)
|
||||||
self.null_block = bool(use_null_block)
|
self.null_block = bool(use_null_block)
|
||||||
self.enable_sar = False
|
self.enable_sar = False
|
||||||
|
self.enable_pcm_memory = False
|
||||||
|
self.enable_pcm = False
|
||||||
|
|
||||||
if sar_settings:
|
if sar_settings:
|
||||||
self.enable_sar, self.sar_delay, self.sar_interval, self.sar_count = sar_settings
|
self.enable_sar, self.sar_delay, self.sar_interval, self.sar_count = sar_settings
|
||||||
|
|
||||||
|
if pcm_settings:
|
||||||
|
self.pcm_dir, self.enable_pcm, self.enable_pcm_memory, self.pcm_delay, self.pcm_interval, self.pcm_count = pcm_settings
|
||||||
|
|
||||||
self.script_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
|
self.script_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
|
||||||
self.spdk_dir = os.path.abspath(os.path.join(self.script_dir, "../../../"))
|
self.spdk_dir = os.path.abspath(os.path.join(self.script_dir, "../../../"))
|
||||||
|
|
||||||
@ -176,6 +182,18 @@ class Target(Server):
|
|||||||
self.log_print(line)
|
self.log_print(line)
|
||||||
fh.write(out)
|
fh.write(out)
|
||||||
|
|
||||||
|
def measure_pcm_memory(self, results_dir, pcm_file_name):
|
||||||
|
time.sleep(self.pcm_delay)
|
||||||
|
pcm_memory = subprocess.Popen("%s/pcm-memory.x %s -csv=%s/%s" % (self.pcm_dir, self.pcm_interval,
|
||||||
|
results_dir, pcm_file_name), shell=True)
|
||||||
|
time.sleep(self.pcm_count)
|
||||||
|
pcm_memory.kill()
|
||||||
|
|
||||||
|
def measure_pcm(self, results_dir, pcm_file_name):
|
||||||
|
time.sleep(self.pcm_delay)
|
||||||
|
subprocess.run("%s/pcm.x %s -i=%s -csv=%s/%s" % (self.pcm_dir, self.pcm_interval, self.pcm_count,
|
||||||
|
results_dir, pcm_file_name), shell=True, check=True)
|
||||||
|
|
||||||
|
|
||||||
class Initiator(Server):
|
class Initiator(Server):
|
||||||
def __init__(self, name, username, password, mode, nic_ips, ip, transport="rdma",
|
def __init__(self, name, username, password, mode, nic_ips, ip, transport="rdma",
|
||||||
@ -327,11 +345,11 @@ runtime={run_time}
|
|||||||
|
|
||||||
class KernelTarget(Target):
|
class KernelTarget(Target):
|
||||||
def __init__(self, name, username, password, mode, nic_ips, transport="rdma",
|
def __init__(self, name, username, password, mode, nic_ips, transport="rdma",
|
||||||
use_null_block=False, sar_settings=None,
|
use_null_block=False, sar_settings=None, pcm_settings=None,
|
||||||
nvmet_bin="nvmetcli", **kwargs):
|
nvmet_bin="nvmetcli", **kwargs):
|
||||||
|
|
||||||
super(KernelTarget, self).__init__(name, username, password, mode, nic_ips, transport,
|
super(KernelTarget, self).__init__(name, username, password, mode, nic_ips, transport,
|
||||||
use_null_block, sar_settings)
|
use_null_block, sar_settings, pcm_settings)
|
||||||
self.nvmet_bin = nvmet_bin
|
self.nvmet_bin = nvmet_bin
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
@ -455,11 +473,11 @@ class KernelTarget(Target):
|
|||||||
class SPDKTarget(Target):
|
class SPDKTarget(Target):
|
||||||
|
|
||||||
def __init__(self, name, username, password, mode, nic_ips, transport="rdma",
|
def __init__(self, name, username, password, mode, nic_ips, transport="rdma",
|
||||||
use_null_block=False, sar_settings=None,
|
use_null_block=False, sar_settings=None, pcm_settings=None,
|
||||||
num_shared_buffers=4096, num_cores=1, **kwargs):
|
num_shared_buffers=4096, num_cores=1, **kwargs):
|
||||||
|
|
||||||
super(SPDKTarget, self).__init__(name, username, password, mode, nic_ips, transport,
|
super(SPDKTarget, self).__init__(name, username, password, mode, nic_ips, transport,
|
||||||
use_null_block, sar_settings)
|
use_null_block, sar_settings, pcm_settings)
|
||||||
self.num_cores = num_cores
|
self.num_cores = num_cores
|
||||||
self.num_shared_buffers = num_shared_buffers
|
self.num_shared_buffers = num_shared_buffers
|
||||||
|
|
||||||
@ -743,6 +761,18 @@ if __name__ == "__main__":
|
|||||||
t = threading.Thread(target=target_obj.measure_sar, args=(target_results_dir, sar_file_name))
|
t = threading.Thread(target=target_obj.measure_sar, args=(target_results_dir, sar_file_name))
|
||||||
threads.append(t)
|
threads.append(t)
|
||||||
|
|
||||||
|
if target_obj.enable_pcm:
|
||||||
|
pcm_file_name = "_".join(["pcm_cpu", str(block_size), str(rw), str(io_depth)])
|
||||||
|
pcm_file_name = ".".join([pcm_file_name, "csv"])
|
||||||
|
t = threading.Thread(target=target_obj.measure_pcm, args=(target_results_dir, pcm_file_name,))
|
||||||
|
threads.append(t)
|
||||||
|
|
||||||
|
if target_obj.enable_pcm_memory:
|
||||||
|
pcm_file_name = "_".join(["pcm_memory", str(block_size), str(rw), str(io_depth)])
|
||||||
|
pcm_file_name = ".".join([pcm_file_name, "csv"])
|
||||||
|
t = threading.Thread(target=target_obj.measure_pcm_memory, args=(target_results_dir, pcm_file_name,))
|
||||||
|
threads.append(t)
|
||||||
|
|
||||||
for t in threads:
|
for t in threads:
|
||||||
t.start()
|
t.start()
|
||||||
for t in threads:
|
for t in threads:
|
||||||
|
Loading…
Reference in New Issue
Block a user