Setup the build directory with gprof flags
meson setup build -Dc_args="-pg" -Dc_link_args="-pg"
Compile the project
meson compile -C build
Run the testcase to generate 'gmon.out'
./build/thunar/thunar
Analyze with gprof
gprof ./build/thunar/thunar gmon.out > analysis.txt