您可以使用PERF访问硬件性能计数器:
$ perf stat -e dTLB-load-misses,iTLB-load-misses /path/to/command
例如:
$ perf stat -e dTLB-load-misses,iTLB-load-misses /bin/ls > /dev/null
Performance counter stats for '/bin/ls':
5,775 dTLB-load-misses
1,059 iTLB-load-misses
0.001897682 seconds time elapsed