mirror of
https://github.com/mmueller41/mxtasking.git
synced 2026-01-21 12:42:57 +01:00
Use the same HW performance counter as on Genode.
This commit is contained in:
@@ -6,23 +6,23 @@ using namespace benchmark;
|
||||
* Counter "Instructions Retired"
|
||||
* Counts when the last uop of an instruction retires.
|
||||
*/
|
||||
[[maybe_unused]] PerfCounter Perf::INSTRUCTIONS = {"instr", PERF_TYPE_HARDWARE, PERF_COUNT_HW_INSTRUCTIONS};
|
||||
[[maybe_unused]] PerfCounter Perf::INSTRUCTIONS = {"instr", 4, 192};
|
||||
|
||||
/**
|
||||
*/
|
||||
[[maybe_unused]] PerfCounter Perf::CYCLES = {"cycles", PERF_TYPE_HARDWARE, PERF_COUNT_HW_CPU_CYCLES};
|
||||
[[maybe_unused]] PerfCounter Perf::CYCLES = {"cycles", 4, 0x76};
|
||||
|
||||
/**
|
||||
*/
|
||||
[[maybe_unused]] PerfCounter Perf::L1_MISSES = {"l1-miss", PERF_TYPE_HW_CACHE,
|
||||
PERF_COUNT_HW_CACHE_L1D | (PERF_COUNT_HW_CACHE_OP_READ << 8) |
|
||||
[[maybe_unused]] PerfCounter Perf::L1_MISSES = {"l1i-miss", PERF_TYPE_HW_CACHE,
|
||||
PERF_COUNT_HW_CACHE_L1I | (PERF_COUNT_HW_CACHE_OP_READ << 8) |
|
||||
(PERF_COUNT_HW_CACHE_RESULT_MISS << 16)};
|
||||
|
||||
/**
|
||||
* Counter "LLC Misses"
|
||||
* Accesses to the LLC in which the data is not present(miss).
|
||||
*/
|
||||
[[maybe_unused]] PerfCounter Perf::LLC_MISSES = {"llc-miss", PERF_TYPE_HARDWARE, PERF_COUNT_HW_CACHE_MISSES};
|
||||
[[maybe_unused]] PerfCounter Perf::LLC_MISSES = {"l1d-miss", PERF_TYPE_HW_CACHE, PERF_COUNT_HW_CACHE_L1D | (PERF_COUNT_HW_CACHE_OP_READ << 8) | (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)};
|
||||
|
||||
[[maybe_unused]] PerfCounter Perf::DTLB_READ_MISSES = {"dtlb-read-miss", PERF_TYPE_HW_CACHE, 0x10003};
|
||||
[[maybe_unused]] PerfCounter Perf::DTLB_STORE_MISSES = {"dtlb-store-miss", PERF_TYPE_HW_CACHE, 0x10103};
|
||||
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
_perf_event_attribute.size = sizeof(perf_event_attr);
|
||||
_perf_event_attribute.config = event_id;
|
||||
_perf_event_attribute.disabled = true;
|
||||
_perf_event_attribute.inherit = 1;
|
||||
_perf_event_attribute.inherit = 0;
|
||||
_perf_event_attribute.exclude_kernel = false;
|
||||
_perf_event_attribute.exclude_hv = false;
|
||||
_perf_event_attribute.read_format = PERF_FORMAT_TOTAL_TIME_ENABLED | PERF_FORMAT_TOTAL_TIME_RUNNING;
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
{
|
||||
const auto multiplexing_correction = static_cast<double>(_data.time_enabled - _prev.time_enabled) /
|
||||
static_cast<double>(_data.time_running - _prev.time_running);
|
||||
return static_cast<double>(_data.value - _prev.value) * multiplexing_correction;
|
||||
return static_cast<double>(_data.value - _prev.value);
|
||||
}
|
||||
|
||||
[[nodiscard]] const std::string &name() const { return _name; }
|
||||
|
||||
Reference in New Issue
Block a user