I am sampling the performance of my program with perf.
This works for me:
$ perf record -g ./bench
...
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.023 MB perf.data (93 samples) ]
$ ls -al perf.data
-rw------- 1 bram bram 26848 Oct 25 10:22 perf.data
But now I want to start and stop the collection at specific points in my program. Yet if I do:
$ perf record -g -e cycles --filter="start render_image" ./bench
--filter option should follow a -e tracepoint option
I'm stumped, because the filter flag does follow the -e option. What's going on here?
I am also puzzled by the small size of perf.data, is it really only 93 samples collected? It ran for a few seconds.
Lastly, I am assuming that '-e cycles' is the default event?
UPDATE: As explained by Arnabjyoti Kalita, there is a special category of events call Tracepoints. They only show up in 'perf list' for me, if I run perf as root.
Too bad perf seems to be able to start/stop collection only if you trace that type of event, and not the default cpu cycles.