- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
I want to record the LLC cache occupancy inline, where I want to add some codes to do it in DPDK. I tried to use rdmsr/rdpmc instruction to get performance counters, but I cannot find a way to record LLC cache occupancy. I guess part of the reason is that I am new to this field and the Intel Programming Manual is a little complicated to me. I cannot find the event number for LLC cache occupancy in the manual. My CPU core is Intel(R) Xeon(R) CPU E5-2650 v4.
Another alternative way I think is to use PCM api: https://github.com/opcm/pcm. Since it provides C++ API, I have to write an independent program to monitor the cache occupancy. The codes are here:
std::vector<int> cores; // a vector of cores to be monitored PCM * m = PCM::getInstance(); CoreCounterState b[12][2]; for (int cid : cores) b[cid][0] = getCoreCounterState(cid); for (int t = 0; running; t^=1){ // get data for (int cid : cores){ b[cid][t^1] = getCoreCounterState(cid); } uint64_t inst, l3miss, l2hit, l3hit, l3occupancy, local_mem _bw; for (int i = 0; i < cores.size(); i++){ int cid = cores; inst = getInstructionsRetired(b[cid], b[cid][t^1]); l3miss = getL3CacheMisses(b[cid] , b[cid][t^1]); l2hit = getL2CacheHits(b[cid] , b[cid][t^1]); l3hit = getL3CacheHits(b[cid] , b[cid][t^1]); l3occupancy = getL3CacheOccupancy(b[cid][t^1]); local_mem_bw = getLocalMemoryBW(b[cid] , b[cid][t^1]); } }
However, the performance of this program is quite low, about 1000 records/second. It is far slower than the DPDK processing rate. Could anyone please tell me why or any problem in this code?
I also tried to look at the codes in Intel CMT/CAT monitoring. But there is little documentation on how to use the API provided, and I also don't know the performance.
In a word, could I monitor LLC cache occupancy inline with fast performance? Or alternatively, could I monitor it using another program with fast performance?
Thank you!
Junzhi Gong
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page