Add the following into ''thunar/thunar/Makefile.am'': thunar_CFLAGS +=-pg Build thunar ./autogen.sh && make Start thunar thunar/.libs/thunar Start gprof: gprof thunar/.libs/thunar gmon.out > analysis.txt Reproduce the use-case to test, than quit thunar and check the result.