Is there perf profiler tool for Mac to trace all page faults? I'm looking to install perf which is a kernel profiling tool for Linux.

Basically I'm trying to trace all page faults, so I run equivalent of:

sudo perf record -e page-faults -ag


Is it possible to install/use above tool on Mac? If not, what's the equivalent tool to achieve similar results (tracing all page faults with stack traces).
No - there is no linux kernel to profile on OS X - so that tool is a fish out of water. OS X probably ships with everything you need though.

On macOS / OS X - there is a mach_kernel in use. It's exhaustively documented at: https://developer.apple.com/library/prerelease/content/documentation/Darwin/Conceptual/KernelProgramming/About/About.html

Additionally, you might be fine profiling the BSD based unix layer with the supplied command line tools. It really depends on which operations or aspect of system performance you wish to measure or debug.

To the specific topic of page faults, you can get cumulative statistics from top and vm_stat and then dig into specific processes using either dtrace or Instruments - which is a free tool part of Xcode on the app store and has a graphical interface for profiling the system calls per process or as a system.