From 60c5bc23115728ee7d848b429a1918e1871568eb Mon Sep 17 00:00:00 2001 From: "Joseph P. White" Date: Fri, 27 Sep 2019 16:08:05 -0400 Subject: [PATCH] Add support for Intel IvyBridge counters and generic intel ones. --- src/supremm/plugins/CpuPerfCounters.py | 14 +++++++++++++- src/supremm/plugins/MemBwTimeseries.py | 11 ++++++++++- src/supremm/plugins/UncoreCounters.py | 11 ++++++++++- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/supremm/plugins/CpuPerfCounters.py b/src/supremm/plugins/CpuPerfCounters.py index 1fd54073..503ede29 100644 --- a/src/supremm/plugins/CpuPerfCounters.py +++ b/src/supremm/plugins/CpuPerfCounters.py @@ -25,6 +25,10 @@ "perfevent.hwcounters.L1D_REPL.value", "perfevent.hwcounters.FP_COMP_OPS_EXE_SSE_FP.value"] +GENERIC_INTEL_METRICS = ["perfevent.hwcounters.UNHALTED_REFERENCE_CYCLES.value", + "perfevent.hwcounters.INSTRUCTIONS_RETIRED.value", + "perfevent.hwcounters.L1D_REPLACEMENT.value"] + AMD_INTERLAGOS_METRICS = ["perfevent.hwcounters.CPU_CLK_UNHALTED.value", "perfevent.hwcounters.RETIRED_INSTRUCTIONS.value", "perfevent.hwcounters.DATA_CACHE_MISSES_DC_MISS_STREAMING_STORE.value", @@ -35,7 +39,7 @@ class CpuPerfCounters(Plugin): name = property(lambda x: "cpuperf") mode = property(lambda x: "firstlast") - requiredMetrics = property(lambda x: [SNB_METRICS, NHM_METRICS, NHM_ALT_METRICS, AMD_INTERLAGOS_METRICS]) + requiredMetrics = property(lambda x: [SNB_METRICS, NHM_METRICS, NHM_ALT_METRICS, GENERIC_INTEL_METRICS, AMD_INTERLAGOS_METRICS]) optionalMetrics = property(lambda x: []) derivedMetrics = property(lambda x: []) @@ -78,6 +82,7 @@ def results(self): if nhosts < 1: return {"error": ProcessingError.INSUFFICIENT_HOSTDATA} + hasFlops = True flops = numpy.zeros(self._totalcores) cpiref = numpy.zeros(self._totalcores) cpldref = numpy.zeros(self._totalcores) @@ -94,8 +99,15 @@ def results(self): cpiref[coreindex:coreindex + len(data[0])] = 1.0 * data[0] / data[1] cpldref[coreindex:coreindex + len(data[0])] = 1.0 * data[0] / data[2] coreindex += len(data[0]) + elif len(data) == len(GENERIC_INTEL_METRICS): + hasFlops = False + cpiref[coreindex:coreindex + len(data[0])] = 1.0 * data[0] / data[1] + cpldref[coreindex:coreindex + len(data[0])] = 1.0 * data[0] / data[2] + coreindex += len(data[0]) else: return {"error": ProcessingError.INSUFFICIENT_DATA} results = {"flops": calculate_stats(flops), "cpiref": calculate_stats(cpiref), "cpldref": calculate_stats(cpldref)} + if not hasFlops: + del results['flops'] return results diff --git a/src/supremm/plugins/MemBwTimeseries.py b/src/supremm/plugins/MemBwTimeseries.py index 741b54a5..1fdadb95 100644 --- a/src/supremm/plugins/MemBwTimeseries.py +++ b/src/supremm/plugins/MemBwTimeseries.py @@ -16,6 +16,15 @@ "perfevent.hwcounters.snbep_unc_imc3__UNC_M_CAS_COUNT_RD.value", "perfevent.hwcounters.snbep_unc_imc3__UNC_M_CAS_COUNT_WR.value"] +IVB_METRICS = ["perfevent.hwcounters.ivbep_unc_imc0__UNC_M_CAS_COUNT_RD.value", + "perfevent.hwcounters.ivbep_unc_imc0__UNC_M_CAS_COUNT_WR.value", + "perfevent.hwcounters.ivbep_unc_imc1__UNC_M_CAS_COUNT_RD.value", + "perfevent.hwcounters.ivbep_unc_imc1__UNC_M_CAS_COUNT_WR.value", + "perfevent.hwcounters.ivbep_unc_imc2__UNC_M_CAS_COUNT_RD.value", + "perfevent.hwcounters.ivbep_unc_imc2__UNC_M_CAS_COUNT_WR.value", + "perfevent.hwcounters.ivbep_unc_imc3__UNC_M_CAS_COUNT_RD.value", + "perfevent.hwcounters.ivbep_unc_imc3__UNC_M_CAS_COUNT_WR.value"] + NHM_METRICS = ["perfevent.hwcounters.UNC_LLC_MISS_READ.value", "perfevent.hwcounters.UNC_LLC_MISS_WRITE.value"] @@ -24,7 +33,7 @@ class MemBwTimeseries(Plugin): name = property(lambda x: "membw") mode = property(lambda x: "timeseries") - requiredMetrics = property(lambda x: [SNB_METRICS, NHM_METRICS]) + requiredMetrics = property(lambda x: [SNB_METRICS, IVB_METRICS, NHM_METRICS]) optionalMetrics = property(lambda x: []) derivedMetrics = property(lambda x: []) diff --git a/src/supremm/plugins/UncoreCounters.py b/src/supremm/plugins/UncoreCounters.py index 4b3bdc6e..5f4dac0d 100644 --- a/src/supremm/plugins/UncoreCounters.py +++ b/src/supremm/plugins/UncoreCounters.py @@ -15,6 +15,15 @@ "perfevent.hwcounters.snbep_unc_imc3__UNC_M_CAS_COUNT_RD.value", "perfevent.hwcounters.snbep_unc_imc3__UNC_M_CAS_COUNT_WR.value"] +IVB_METRICS = ["perfevent.hwcounters.ivbep_unc_imc0__UNC_M_CAS_COUNT_RD.value", + "perfevent.hwcounters.ivbep_unc_imc0__UNC_M_CAS_COUNT_WR.value", + "perfevent.hwcounters.ivbep_unc_imc1__UNC_M_CAS_COUNT_RD.value", + "perfevent.hwcounters.ivbep_unc_imc1__UNC_M_CAS_COUNT_WR.value", + "perfevent.hwcounters.ivbep_unc_imc2__UNC_M_CAS_COUNT_RD.value", + "perfevent.hwcounters.ivbep_unc_imc2__UNC_M_CAS_COUNT_WR.value", + "perfevent.hwcounters.ivbep_unc_imc3__UNC_M_CAS_COUNT_RD.value", + "perfevent.hwcounters.ivbep_unc_imc3__UNC_M_CAS_COUNT_WR.value"] + NHM_METRICS = ["perfevent.hwcounters.UNC_LLC_MISS_READ.value", "perfevent.hwcounters.UNC_LLC_MISS_WRITE.value"] @@ -25,7 +34,7 @@ class UncoreCounters(Plugin): name = property(lambda x: "uncperf") mode = property(lambda x: "firstlast") - requiredMetrics = property(lambda x: [SNB_METRICS, NHM_METRICS, INTERLAGOS_METRICS]) + requiredMetrics = property(lambda x: [SNB_METRICS, IVB_METRICS, NHM_METRICS, INTERLAGOS_METRICS]) optionalMetrics = property(lambda x: []) derivedMetrics = property(lambda x: [])