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?

  • Have you look at the perf documentation and source code yet ? github.com/torvalds/linux/tree/master/tools/perf – steve Aug 11 '15 at 8: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 8:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.