2

perf is a tool which accesses the performance counter registers of an machine and gives out metrics to user to analyze the system performance.

What I am curious about is, when I read the parts of code. I see perf reading something from a memory mapped area (I feel it reads an area which is been written by the kernel), it is also reading /proc/modules, but I could not find any code related to actual read of hardware registers of machine.

  • How does perf actually record its samples?
  • How does it identify what function is an executable is executing?
  • How does it know the symbols?

Does the kernel also have a module of perf inside (apart from /tools to convey the application 'perf' running in user space)?

Can anyone brief me about the internal working in detail?

Thomas Dickey
  • 75,040
  • 9
  • 171
  • 268
kakeh
  • 483
  • 7
  • 16
  • Have you look at the perf documentation and source code yet ? https://github.com/torvalds/linux/tree/master/tools/perf – steve Aug 11 '15 at 08:46
  • 1
    yeah i am currently going through it, but quite confused with its modularity, i see some new things like kernel maps, module creations etc, any way thanks for suggestion, its documentation stresses more on usage of tool rather than its actual working – kakeh Aug 11 '15 at 08:50

0 Answers0