0

for a seemingly large code for AES when I profile the code using gprof with following command

cc file1.c file2.c -pg
./a.out
gprof a.out gmon.out > analysis.txt
 cat analysis.txt

the output file shows time as 0 for all function calls

Flat profile:

Each sample counts as 0.01 seconds.
 no time accumulated

  %   cumulative   self              self     total           
 time   seconds   seconds    calls  Ts/call  Ts/call  name    
  0.00      0.00     0.00      576     0.00     0.00  galois_multiply
  0.00      0.00     0.00       40     0.00     0.00  getSBoxValue
  0.00      0.00     0.00       33     0.00     0.00  PrintArr
  0.00      0.00     0.00       11     0.00     0.00  AddRoundKey
  0.00      0.00     0.00       10     0.00     0.00  core
  0.00      0.00     0.00       10     0.00     0.00  getRconValue
  0.00      0.00     0.00       10     0.00     0.00  myrotate
  0.00      0.00     0.00       10     0.00     0.00  shiftRow
  0.00      0.00     0.00       10     0.00     0.00  subByte
  0.00      0.00     0.00        9     0.00     0.00  mixColumn
  0.00      0.00     0.00        1     0.00     0.00  ReadInput
  0.00      0.00     0.00        1     0.00     0.00  expandKey

am I missing somthing.. kindly advise,

  • I tried using eclipse tptp, but couldnt figure out a way to profice c code using eclipse, any ideas in that direction would also be appreciated

  • Is there any tool online using which I can upload my code and extract the detailed analysis report?

Himanshu Sourav
  • 700
  • 1
  • 10
  • 35
  • 1
    possible duplicate of [gprof reports no time accumulated](http://stackoverflow.com/questions/1030829/gprof-reports-no-time-accumulated) – Leeor Apr 27 '14 at 11:29
  • It probably means your program didn't take much time for gprof to report anything meaningful. When you executed it (./a.out), did it take some time to run?a – P.P Apr 27 '14 at 11:32
  • @Leeor- I saw that question, platform used there is OSX whereas m working on linux, the user switched to SHARK for solving this issue, but sadly I do not have that option being on a linux system. – Himanshu Sourav Apr 27 '14 at 11:37
  • no Blue Moon it didn't take any noticeable time to execute... – Himanshu Sourav Apr 27 '14 at 11:38
  • You may use `valgrind --tools=callgrind yourprogram` on Linux. There's a nice graphical visualizer for it called [KCacheGrind](http://kcachegrind.sourceforge.net/html/Home.html). – n. m. could be an AI Apr 27 '14 at 11:43
  • @ n.m. Does it give timing details for every function like gprof..? Timing details and number of calls are important for me to extract – Himanshu Sourav Apr 27 '14 at 12:28
  • gprof tells time by sampling the program counter every 10ms, which is every 10^7 nanoseconds. That is probably a long time in your processor, so the program may complete in less than that time. The simplest way to time a program (overall) is put an outer loop around it of, say, 10^6 iterations, and see how many seconds it takes. That tells you how many microseconds are spent in each iteration. – Mike Dunlavey Apr 27 '14 at 16:08

0 Answers0