Gprof: specific function time

I want to know the time spent by a certain function in my program. For this purpose I use gprof. I used the following command to get the time for a specific function, but the log file displays the results for all functions present in the program. Please help me in this regard.

gprof -F FunctionName  Executable gmon.out>log 
+1
source share
1 answer

You almost repeat another question about the execution time of a function .

, (- ), - , (, ). .

clock_gettime (2) CLOCK_REALTIME , , CLOCK_THREAD_CPUTIME_ID

gprof (1) ( -pg) profil (3) , SIGPROF (. (7)) (, 10 ) , setitimer (2) TIMER_PROF; . wikipage gprof , .

( ), ( heisenbugs).

, ( !). , , , . , . - CPU.

gprof - -F , , - (, GNU awk), .

, . , .

; , g++ -flto -O2, ( , ).

, superscalar micro-architecture , , , , , .. .., - undefined. .

+3

Source: https://habr.com/ru/post/1694288/


All Articles