Commit bd1e8c2a authored by Kamil Godzwon's avatar Kamil Godzwon Committed by Tomasz Zawadzki
Browse files

perf/nvmf: fix target_avg_power accounting in nvmf benchmarks



Currently, this average is calculated from all the files which
include “avg” and “pm” in their names. This match, however,
is too greedy.

collect-bmc-pm creates separate files for each power sensor.
With RAPL enabled, files per cpu socket|package and dram are
created as well.

On most our platforms, we get a single DCMI sensor (or dedicated
one in SDR in case DCMI is not supported) which accounts power
from the entire system. While having an avg reading from such
a global sensor, we can’t combine it with avg of other components
without ending up with an off result.

Use data from DCIM sensor, if not available, use data from other
components as SDR. As a fallback use socket/dram data sensors.

Signed-off-by: default avatarKamil Godzwon <kamilx.godzwon@intel.com>
Change-Id: Ia61bdb14453c374898ce1b6bcba34c09746825ad
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/19075


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarMichal Berger <michal.berger@intel.com>
Reviewed-by: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-by: default avatarMarek Chomnicki <marek.chomnicki@intel.com>
Reviewed-by: default avatarPawel Piatek <pawelx.piatek@intel.com>
parent cadfb3f7
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -132,7 +132,22 @@ def parse_results(results_dir, csv_file):
        job_name = re.sub(r"_\d+CPU", "", job_name)
        job_result_files = [x for x in json_files if x.startswith(job_name)]
        sar_result_files = [x for x in sar_files if x.startswith(job_name)]
        pm_result_files = [x for x in pm_files if x.startswith(job_name)]

        # Collect all pm files for the current job
        job_pm_files = [x for x in pm_files if x.startswith(job_name)]

        # Filter out data from DCMI sensors and socket/dram sensors
        dcmi_sensors = [x for x in job_pm_files if "DCMI" in x]
        socket_dram_sensors = [x for x in job_pm_files if "DCMI" not in x and ("socket" in x or "dram" in x)]
        sdr_sensors = list(set(job_pm_files) - set(dcmi_sensors) - set(socket_dram_sensors))

        # Determine the final list of pm_result_files, if DCMI file is present, use it as a primary source
        # of power consumption data. If not, use SDR sensors data if available. If SDR sensors are not available,
        # use socket and dram sensors as a fallback.
        pm_result_files = dcmi_sensors or sdr_sensors
        if not pm_result_files and socket_dram_sensors:
            logging.warning("No DCMI or SDR data found for %s, using socket and dram data sensors as a fallback" % job_name)
            pm_result_files = socket_dram_sensors

        logging.info("Matching result files for current fio config %s:" % job_name)
        for j in job_result_files: