L2缓存行未命中计数
作者:互联网
我想在运行一个特定程序时计算L2缓存未命中的总数.是否有任何方法可以在L2缓存中找到缓存未命中?
我知道,Core i7 CPU的性能计数器事件类型“L2_LINES_OUT”可用于Counts L2缓存线被驱逐,但不知道如何使用它?
我正在使用linux和Intel i7 IvyBridge机器.
任何指针或链接将受到高度赞赏.
解决方法:
根据this summary,您可以使用l2_rqsts子事件:
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
您可以使用 – (all_demand_data_rd – demand_data_rd_hit)来计算需求未命中数
标签:c-3,linux,performance-testing,cpu-cache,cpu-architecture 来源: https://codeday.me/bug/20190629/1323500.html