perf

Profiling my program with linux perf and different call graph modes gives different results

不想你离开。 提交于 2021-02-07 04:35:13
问题 I want to profile my c++ program with linux perf. For this I used the three following commands and I do not understand why I get three completely different reports. perf record --call-graph dwarf ./myProg perf report perf record --call-graph fp ./myProg perf report perf record --call-graph lbr ./myProg perf report Also I do not understand why the main function is not the highest function in the list. The logic of my program is the following, the main function calls the getPogDocumentFromFile

Is cycle count itself reliable on program timing?

你说的曾经没有我的故事 提交于 2021-01-28 21:33:10
问题 I am currently trying to develop a judging system that measure not only time and memory use but also more deeper information such as cache misses and etc., which I assume the hardware counters (using perf) are perfect for it. But for the timing part, I wonder if using purely the cycle count to determine execution speed is reliable enough? Hope to know about the pros and cons about this decision. 回答1: So you're proposing measuring CPU cycles, instead of seconds? Sounds somewhat reasonable. For

Perf stat equivalent for Mac OS?

╄→尐↘猪︶ㄣ 提交于 2021-01-24 07:14:15
问题 Is there a perf stat equivalent on Mac OS? I would like to do the same thing for a CLI command and googling is not yielding anything. 回答1: There was Instruments tool in Mac OS X to profile applications including with hardware PMU. Default is to do sampling profiler for CPU usage. Some docs: https://en.wikipedia.org/wiki/Instruments_(software) https://help.apple.com/instruments/mac/current/ It also has command line variant: https://help.apple.com/instruments/mac/current/#/devb14ffaa5 Open

Perf stat equivalent for Mac OS?

北城余情 提交于 2021-01-24 07:13:28
问题 Is there a perf stat equivalent on Mac OS? I would like to do the same thing for a CLI command and googling is not yielding anything. 回答1: There was Instruments tool in Mac OS X to profile applications including with hardware PMU. Default is to do sampling profiler for CPU usage. Some docs: https://en.wikipedia.org/wiki/Instruments_(software) https://help.apple.com/instruments/mac/current/ It also has command line variant: https://help.apple.com/instruments/mac/current/#/devb14ffaa5 Open

Log memory accesses that cause major page faults

痴心易碎 提交于 2021-01-22 06:46:26
问题 Does anyone know how to get the memory accesses (pointers) that cause page faults? I'm interested mostly in the major page faults. A bit of background about what I'm trying to achieve. I have an application with a large memory footprint (a database) and I want to correlate paging with the accesses to the large data structures (such as tables, indexes which are allocated using mmap()). The mappings of the process are easy to retrieve from /proc//maps. Now, if I have the memory accesses that