Here a two small fixes that make FlameGraph handle demangled symbols better. The first uses semicolons instead of commas to separate frames in the flamegraph.pl input, so avoid an ambiguity with a frame like foo(int, int). The second escapes <> in the output after the string is truncated. Currently it truncates after escaping, and I have seen cases where the string is truncated half-way through an escape sequence, causing malformed output.
Use a semicolon to separate frames
Use a semicolon instead of a comma to separate frames in the
flamegraph input. Commas can appear in demangled C++ function
names (e.g. foo(int, int) ) so using commas to separate frames
can confuse the parser.
Escape strings after they have been truncated.
Don't truncate strings after they have been escaped. If you do,
there is a chance you will happen to truncate half-way through
an escape sequence, causing malformed output.