Break a demangled symbol into path components for flamegraph hierarchy.
(symbol)
| 435 | |
| 436 | |
| 437 | def symbol_to_path(symbol): |
| 438 | """Break a demangled symbol into path components for flamegraph hierarchy.""" |
| 439 | symbol = re.sub(r"::h[0-9a-f]{8,16}$", "", symbol) |
| 440 | parts = symbol.split("::") |
| 441 | if len(parts) > 4: |
| 442 | parts = parts[:3] + ["::".join(parts[3:])] |
| 443 | return parts |
| 444 | |
| 445 | |
| 446 | def generate_flamegraph(folded_stacks, output_path, title): |
no test coverage detected