Your guess is correct. You can use the primary program to track the number of page errors caused by your application.
I recommend that you read this tutorial to learn how to use this tool.
To establish only use:
You are looking for the page-fault event . You can install (in ubuntu or another apt distribution):
sudo apt-get install linux-tools-common linux-base
sudo apt-get install linux-tools-YOUR-KERNEL number
You can get your kernel number with: uname -r
As an example, this command launches the main tool in the "ls" command:
perf record -e page-faults:u -F 250 ls
( "ls" , )
perf report