Commit 5d82cd2b authored by Karol Latecki's avatar Karol Latecki Committed by Tomasz Zawadzki
Browse files

scripts/nvmf_perf: update PCM measurements



Update PCM binary paths and executable names are these have
changed some time ago.
Update README.md with an explanation about int variables
for "pcm_settings" option.

Signed-off-by: default avatarKarol Latecki <karol.latecki@intel.com>
Change-Id: I8270766ff2c429623a29e4c12427a3dd7e45f229
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13511


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarMichal Berger <michal.berger@intel.com>
parent b0997a59
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -115,9 +115,14 @@ Optional, common:
  Wait for "x" seconds before starting measurements, then do "z" samples
  with "y" seconds intervals between them. Default: disabled.
- pcm_settings - [path, int(x), int(y), int(z)];
  Enable [PCM](https://github.com/opcm/pcm.git) measurements on Tartet side.
  Enable [PCM](https://github.com/opcm/pcm.git) measurements on Target side.
  Measurements include CPU, memory and power consumption. "path" points to a
  directory where pcm executables are present. Default: disabled.
  directory where pcm executables are present.
  "x" - time to wait before starting measurements (suggested it equals to fio
  ramp_time).
  "y" - time interval between measurements.
  "z" - number of measurement samples.
  Default: disabled.
- enable_bandwidth - [bool, int]. Wait a given number of seconds and run
  bwm-ng until the end of test to measure bandwidth utilization on network
  interfaces. Default: disabled.
+4 −3
Original line number Diff line number Diff line
@@ -650,14 +650,15 @@ class Target(Server):

    def measure_pcm_memory(self, results_dir, pcm_file_name):
        time.sleep(self.pcm_delay)
        cmd = ["%s/pcm-memory.x" % self.pcm_dir, "%s" % self.pcm_interval, "-csv=%s/%s" % (results_dir, pcm_file_name)]
        cmd = ["%s/build/bin/pcm-memory" % self.pcm_dir, "%s" % self.pcm_interval, "-csv=%s/%s" % (results_dir, pcm_file_name)]
        pcm_memory = subprocess.Popen(cmd)
        time.sleep(self.pcm_count)
        pcm_memory.terminate()

    def measure_pcm(self, results_dir, pcm_file_name):
        time.sleep(self.pcm_delay)
        cmd = ["%s/pcm.x" % self.pcm_dir, "%s" % self.pcm_interval, "-i=%s" % self.pcm_count, "-csv=%s/%s" % (results_dir, pcm_file_name)]
        cmd = ["%s/build/bin/pcm" % self.pcm_dir, "%s" % self.pcm_interval, "-i=%s" % self.pcm_count,
               "-csv=%s/%s" % (results_dir, pcm_file_name)]
        subprocess.run(cmd)
        df = pd.read_csv(os.path.join(results_dir, pcm_file_name), header=[0, 1])
        df = df.rename(columns=lambda x: re.sub(r'Unnamed:[\w\s]*$', '', x))
@@ -667,7 +668,7 @@ class Target(Server):

    def measure_pcm_power(self, results_dir, pcm_power_file_name):
        time.sleep(self.pcm_delay)
        out = self.exec_cmd(["%s/pcm-power.x" % self.pcm_dir, "%s" % self.pcm_interval, "-i=%s" % self.pcm_count])
        out = self.exec_cmd(["%s/build/bin/pcm-power" % self.pcm_dir, "%s" % self.pcm_interval, "-i=%s" % self.pcm_count])
        with open(os.path.join(results_dir, pcm_power_file_name), "w") as fh:
            fh.write(out)