Commit c8e4e0b5 authored by Ruben Laso Rodríguez's avatar Ruben Laso Rodríguez
Browse files

First implementation of hw counters monitoring for Arm.

parent 4e2622c2
......@@ -83,7 +83,7 @@ namespace samples {
// Here we define special configuration for each group
if (group == MEM_SAMPLE) { // Memory
// Config for latency monitoring
// fds[0].hw.config1 = samples::minimum_latency;
fds[0].hw.config1 = samples::minimum_latency;
fds[0].hw.precise_ip = 2;
}
......@@ -125,13 +125,13 @@ namespace samples {
if (fds[i].fd == -1) {
if (errno == EOPNOTSUPP) {
err(EXIT_FAILURE, "Cannot attach event %s. Event is not supported. %s", fds[i].name,
pfm_strerror(errno));
err(EXIT_FAILURE, "Cannot attach event %s in CPU %d. Event is not supported. %s", fds[i].name,
cpu, pfm_strerror(errno));
} else if (fds[i].hw.precise_ip) {
err(EXIT_FAILURE, "Cannot attach event %s: precise mode may not be supported. %s",
fds[group].name, pfm_strerror(errno));
err(EXIT_FAILURE, "Cannot attach event %s in CPU %d: precise mode may not be supported. %s",
fds[group].name, cpu, pfm_strerror(errno));
}
err(EXIT_FAILURE, "Cannot attach event %s. %s", fds[i].name, pfm_strerror(errno));
err(EXIT_FAILURE, "Cannot attach event %s in CPU %d. %s", fds[i].name, cpu, pfm_strerror(errno));
} else {
if (VERBOSE_LVL >= VERB_LVL4) {
std::cout << "Event " << fds[i].name << " successfully opened." << '\n';
......@@ -400,9 +400,7 @@ namespace samples {
total_supported_events++;
}
if (pmu_info.is_dfl && pmu_info.num_cntrs > MAX_HW_COUNTERS) {
MAX_HW_COUNTERS = pmu_info.num_cntrs;
}
MAX_HW_COUNTERS = std::max(MAX_HW_COUNTERS, pmu_info.num_cntrs);
if constexpr (NUM_GROUPS > MAX_BROADWELL_CTRS) { // Computed at compile time
if (pmu == PFM_PMU_INTEL_BDW || pmu == PFM_PMU_INTEL_BDW_EP) {
......
......@@ -17,9 +17,9 @@
namespace samples {
enum sample_type_t {
MEM_SAMPLE = 0,
INS_SAMPLE = 0,
MEM_SAMPLE,
REQ_SAMPLE,
INS_SAMPLE,
#ifndef JUST_INS
FP_SCALAR_SAMPLE, // multiply by 1 to get flops
FP_128B_D_SAMPLE, // multiply by 2 to get flops
......@@ -139,9 +139,9 @@ namespace samples {
size_t map_size;
const std::array<const char * const, NUM_GROUPS> events = { "MEM_TRANS_RETIRED:LATENCY_ABOVE_THRESHOLD",
"OFFCORE_REQUESTS:ALL_DATA_RD",
"INST_RETIRED"
const std::array<const char * const, NUM_GROUPS> events = { "perf::INSTRUCTIONS",
"perf::CACHE-REFERENCES",
"perf::PERF_COUNT_HW_CACHE_NODE"
#ifndef JUST_INS
,
"FP_ARITH:SCALAR_DOUBLE:SCALAR_SINGLE",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment