| 212 | } |
| 213 | |
| 214 | float PmuEvents::L3RefillCount() const { |
| 215 | // Important: this was discovered in the context of the above experiments, |
| 216 | // which also tested the _RD variants of these counters. So it's possible that |
| 217 | // it's just not needed here with the default (non _RD) counters. |
| 218 | // |
| 219 | // Some CPUs implement LL_CACHE_MISS[_RD], some implement |
| 220 | // L3D_CACHE_REFILL[_RD]. It seems that either one of these two counters is |
| 221 | // zero, or they roughly both agree with each other. Therefore, taking the max |
| 222 | // of them is a reasonable way to get something more portable across various |
| 223 | // CPUs. |
| 224 | return static_cast<float>( |
| 225 | std::max(priv->l3d_cache_refill.Count(), priv->ll_cache_miss.Count())); |
| 226 | } |
| 227 | |
| 228 | float PmuEvents::L1TLBRefillCount() const { |
| 229 | return static_cast<float>(priv->l1d_tlb_refill.Count()); |