Advertisement
cutecoder

Simple file reader in NCurses (gprof output)

Sep 4th, 2023 (edited)
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.95 KB | None | 0 0
  1. Flat profile:
  2.  
  3. Each sample counts as 0.01 seconds.
  4. % cumulative self self total
  5. time seconds seconds calls ns/call ns/call name
  6. 50.09 0.01 0.01 93022 107.68 107.68 do_refresh
  7. 50.09 0.02 0.01 main
  8. 0.00 0.02 0.00 93022 0.00 0.00 handle_char
  9. 0.00 0.02 0.00 92654 0.00 0.00 draw_lines
  10. 0.00 0.02 0.00 1 0.00 0.00 read_file
  11.  
  12. % the percentage of the total running time of the
  13. time program used by this function.
  14.  
  15. cumulative a running sum of the number of seconds accounted
  16. seconds for by this function and those listed above it.
  17.  
  18. self the number of seconds accounted for by this
  19. seconds function alone. This is the major sort for this
  20. listing.
  21.  
  22. calls the number of times this function was invoked, if
  23. this function is profiled, else blank.
  24.  
  25. self the average number of milliseconds spent in this
  26. ms/call function per call, if this function is profiled,
  27. else blank.
  28.  
  29. total the average number of milliseconds spent in this
  30. ms/call function and its descendents per call, if this
  31. function is profiled, else blank.
  32.  
  33. name the name of the function. This is the minor sort
  34. for this listing. The index shows the location of
  35. the function in the gprof listing. If the index is
  36. in parenthesis it shows where it would appear in
  37. the gprof listing if it were to be printed.
  38. Copyright (C) 2012-2023 Free Software Foundation, Inc.
  39.  
  40. Copying and distribution of this file, with or without modification,
  41. are permitted in any medium without royalty provided the copyright
  42. notice and this notice are preserved.
  43. Call graph (explanation follows)
  44.  
  45.  
  46. granularity: each sample hit covers 2 byte(s) for 49.91% of 0.02 seconds
  47.  
  48. index % time self children called name
  49. <spontaneous>
  50. [1] 100.0 0.01 0.01 main [1]
  51. 0.01 0.00 93022/93022 do_refresh [2]
  52. 0.00 0.00 93022/93022 handle_char [3]
  53. 0.00 0.00 1/1 read_file [5]
  54. 0.00 0.00 1/92654 draw_lines [4]
  55. -----------------------------------------------
  56. 0.01 0.00 93022/93022 main [1]
  57. [2] 50.0 0.01 0.00 93022 do_refresh [2]
  58. -----------------------------------------------
  59. 0.00 0.00 93022/93022 main [1]
  60. [3] 0.0 0.00 0.00 93022 handle_char [3]
  61. 0.00 0.00 92653/92654 draw_lines [4]
  62. -----------------------------------------------
  63. 0.00 0.00 1/92654 main [1]
  64. 0.00 0.00 92653/92654 handle_char [3]
  65. [4] 0.0 0.00 0.00 92654 draw_lines [4]
  66. -----------------------------------------------
  67. 0.00 0.00 1/1 main [1]
  68. [5] 0.0 0.00 0.00 1 read_file [5]
  69. -----------------------------------------------
  70.  
  71. This table describes the call tree of the program, and was sorted by
  72. the total amount of time spent in each function and its children.
  73.  
  74. Each entry in this table consists of several lines. The line with the
  75. index number at the left hand margin lists the current function.
  76. The lines above it list the functions that called this function,
  77. and the lines below it list the functions this one called.
  78. This line lists:
  79. index A unique number given to each element of the table.
  80. Index numbers are sorted numerically.
  81. The index number is printed next to every function name so
  82. it is easier to look up where the function is in the table.
  83.  
  84. % time This is the percentage of the `total' time that was spent
  85. in this function and its children. Note that due to
  86. different viewpoints, functions excluded by options, etc,
  87. these numbers will NOT add up to 100%.
  88.  
  89. self This is the total amount of time spent in this function.
  90.  
  91. children This is the total amount of time propagated into this
  92. function by its children.
  93.  
  94. called This is the number of times the function was called.
  95. If the function called itself recursively, the number
  96. only includes non-recursive calls, and is followed by
  97. a `+' and the number of recursive calls.
  98.  
  99. name The name of the current function. The index number is
  100. printed after it. If the function is a member of a
  101. cycle, the cycle number is printed between the
  102. function's name and the index number.
  103.  
  104.  
  105. For the function's parents, the fields have the following meanings:
  106.  
  107. self This is the amount of time that was propagated directly
  108. from the function into this parent.
  109.  
  110. children This is the amount of time that was propagated from
  111. the function's children into this parent.
  112.  
  113. called This is the number of times this parent called the
  114. function `/' the total number of times the function
  115. was called. Recursive calls to the function are not
  116. included in the number after the `/'.
  117.  
  118. name This is the name of the parent. The parent's index
  119. number is printed after it. If the parent is a
  120. member of a cycle, the cycle number is printed between
  121. the name and the index number.
  122.  
  123. If the parents of the function cannot be determined, the word
  124. `<spontaneous>' is printed in the `name' field, and all the other
  125. fields are blank.
  126.  
  127. For the function's children, the fields have the following meanings:
  128.  
  129. self This is the amount of time that was propagated directly
  130. from the child into the function.
  131.  
  132. children This is the amount of time that was propagated from the
  133. child's children to the function.
  134.  
  135. called This is the number of times the function called
  136. this child `/' the total number of times the child
  137. was called. Recursive calls by the child are not
  138. listed in the number after the `/'.
  139.  
  140. name This is the name of the child. The child's index
  141. number is printed after it. If the child is a
  142. member of a cycle, the cycle number is printed
  143. between the name and the index number.
  144.  
  145. If there are any cycles (circles) in the call graph, there is an
  146. entry for the cycle-as-a-whole. This entry shows who called the
  147. cycle (as parents) and the members of the cycle (as children.)
  148. The `+' recursive calls entry shows the number of function calls that
  149. were internal to the cycle, and the calls entry for each member shows,
  150. for that member, how many times it was called from other members of
  151. the cycle.
  152. Copyright (C) 2012-2023 Free Software Foundation, Inc.
  153.  
  154. Copying and distribution of this file, with or without modification,
  155. are permitted in any medium without royalty provided the copyright
  156. notice and this notice are preserved.
  157. Index by function name
  158.  
  159. [2] do_refresh [3] handle_char [5] read_file
  160. [4] draw_lines [1] main
  161.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement