3 ms·
Perf uses hardware performance counters to interrupt on some instructions and records their program counter: http://stackoverflow.com/questions/28661430/how-doe
by osgx 10y ago
Perf uses hardware performance counters to interrupt on some instructions and records their program counter: http://stackoverflow.com/questions/28661430/how-does-a-system-wide-profiler-e-g-perf-correlate-counters-with-instructions http://stackoverflow.com/questions/28661430/how-does-a-syste.... It uses symbol lists from ELF files to find functions for every recorded program counter (http://www.brendangregg.com/perf.html#Symbols http://www.brendangregg.com/perf.html#Symbols), like nm (https://sourceware.org/binutils/docs/binutils/nm.html https://sourceware.org/binutils/docs/binutils/nm.html), and can also use debugging information to get source file names and lines like addr2line (https://sourceware.org/binutils/docs/binutils/addr2line.html https://sourceware.org/binutils/docs/binutils/addr2line.html).