Skip to content

Commit

Permalink
Merge pull request #210 from jpwhite4/more_hwperf
Browse files Browse the repository at this point in the history
Add support for Intel IvyBridge counters and generic intel ones.
  • Loading branch information
jpwhite4 authored Sep 30, 2019
2 parents 52aeb4e + 60c5bc2 commit 24ec36f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
14 changes: 13 additions & 1 deletion src/supremm/plugins/CpuPerfCounters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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: [])

Expand Down Expand Up @@ -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)
Expand All @@ -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
11 changes: 10 additions & 1 deletion src/supremm/plugins/MemBwTimeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand All @@ -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: [])

Expand Down
11 changes: 10 additions & 1 deletion src/supremm/plugins/UncoreCounters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand All @@ -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: [])

Expand Down

0 comments on commit 24ec36f

Please sign in to comment.