简体   繁体   中英

L2 cache lines miss count

I want to calculate total no of L2 cache miss while I am running one particular program A. Is there any way to find cache miss in L2 cache ?

I got to know, Core i7 CPU's performance counter event types "L2_LINES_OUT " is available to Counts L2 cache lines evicted, but don't know how to use it ?

I am using linux and Intel i7 IvyBridge machine.

Any pointer or link will be highly appreciated .

According to this summary , you can use the l2_rqsts subevents:

0x01: (name=demand_data_rd_hit) Demand Data Read requests that hit L2 cache
0x03: (name=all_demand_data_rd) Demand Data Read requests
0x04: (name=rfo_hit) RFO requests that hit L2 cache
0x08: (name=rfo_miss) RFO requests that miss L2 cache
0x0c: (name=all_rfo) RFO requests to L2 cache
0x10: (name=code_rd_hit) L2 cache hits when fetching instructions, code reads.
0x20: (name=code_rd_miss) L2 cache misses when fetching instructions
0x30: (name=all_code_rd) L2 code requests
0x40: (name=pf_hit) Requests from the L2 hardware prefetchers that hit L2 cache
0x80: (name=pf_miss) Requests from the L2 hardware prefetchers that miss L2 cache
0xc0: (name=all_pf) Requests from L2 hardware prefetchers 

You can just use - (all_demand_data_rd - demand_data_rd_hit) to count the demand misses

The IBM documentation here might be helpful.

It describes various expressions for many different metrics on Ivybridge. The one you want appears to be

 *Instruction fetch from L2 cache miss rate*
 100.0 * X_L2_RQSTS_IFETCH_MISS / X_L2_RQSTS_IFETCHES

搜索PAPI,它是一个工具,您可以使用它来读取要收集L2缓存未命中的代码段之前和之后的PMU。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM