Use the LLC_VICTIMS CBox event with event code 0x37. You can use a umask of 0x0F to count the total number of valid cache lines that were victimized on an LLC fill. But if you want to count only dirty victims, which are written back to memory, use a umask of 0x01. The events can also be filtered by the home node ID of the victims as discussed in the uncore manual.
It appears to me that LLC_VICTIMS doesn't count all LLC evictions, but only LLC replacement victims.
"EventName": "UNC_C_LLC_VICTIMS.M_STATE", "EventName": "UNC_C_LLC_VICTIMS.E_STATE", "EventName": "UNC_C_LLC_VICTIMS.S_STATE", "EventName": "UNC_C_LLC_VICTIMS.F_STATE"
There are many events with different state(M , E , S , F). Can you please explain what does mean by state.
These are the possible coherence states of a victim line (the LLC in Haswell-EP and Haswell-EX uses the MESIF coherence protocol). For example, UNC_C_LLC_VICTIMS.M_STATE represents the event of victimizing a dirty line (i.e., in the M state) from the LLC.
Thanks for your reply.
But I just want to know, what is the actual difference in LLC_miss and LLC_victim counter.
Can I use L3_miss instead of LLC_victim?
And one more thing if I am using cbox counter then should I use all cboxes[0-17] caching agent for measuring TOR_occupancy, RxR_occupancy and LLC_victim. if yes then it will give so much overhead.
There is no event called "LLC_miss," but you're probably referring to one of the events that has "LLC_miss" in their name.
Anyway, all cacheable misses in the LLC on Haswell cause a fill in the LLC, and so they can be counted using both events. In addition, all LLC fills occur only because a request missed in the LLC. However, since the LLC is shared between multiple agents (such as cores), it may receive multiple requests to the same line from different agents. Each of these requests count as a miss, but there is only one fill.
There could be other differences depending on the exact LLC miss event.