Skip to content

Commit

Permalink
Added support for simulated/embedded gprof output
Browse files Browse the repository at this point in the history
* This format is seen in simulation of certain embedded
  systems.

* This format does not include a `time` column and contains
  an additional measurement units column underneath (see line
  89 of included example).

* Provided example and test in `tests/prof/embedded.prof`.
  • Loading branch information
DepthDeluxe authored and Colin Heinzmann committed Oct 3, 2023
1 parent cdeea9e commit 5f10e4b
Show file tree
Hide file tree
Showing 2 changed files with 462 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gprof2dot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1154,14 +1154,16 @@ def translate(self, mo):
r'^index\s+%time\s+self\s+descendents\s+called\+self\s+name\s+index\s*$|' +
r'^\s+called/total\s+children\s*$|' +
# GNU gprof header
r'^index\s+%\s+time\s+self\s+children\s+called\s+name\s*$'
r'^index\s+%\s+(time\s+)?self\s+children\s+called\s+name\s*$'
)

_cg_ignore_re = re.compile(
# spontaneous
r'^\s+<spontaneous>\s*$|'
# internal calls (such as "mcount")
r'^.*\((\d+)\)$'
r'^.*\((\d+)\)$|'
# unit measurement field provided after the header
r'^\s+\([a-zA-Z]\)\s+\([a-zA-Z]\)\s+$'
)

_cg_primary_re = re.compile(
Expand Down
Loading

0 comments on commit 5f10e4b

Please sign in to comment.