-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<>
characters in C++ types get munged
#46
Comments
Also, demangled C++ types can have |
Fixing this issue would be very useful. It's quite hard to read templated functions at the moment. Thank you @tavianator for the patch: it appears to turn angle brackets into round brackets, which is a nice temporary solution. Even better, in my opinion, would be to add a switch to completely strip template parameters: this would shorten the names, and the loss of information would be negligible in many cases. 'gprof2dot' can do it with the '-s' option. @brendangregg , any input on this? |
This might have been fixed since the issue was filed, as I see flamegraph.pl currently has: 572 # clean up SVG breaking characters:
573 $stack =~ tr/<>/()/; |
So, I was wrong: the angle brackets are turned into parentheses exactly by the line that you mentioned. Unfortunately (at least with perf) they don't actually show up unless you also remove line 216 in $func =~ tr/<>//d; In my tests, removing this line shows them as parentheses, while also removing line 573 of My suggestion to add a switch to strip the template parameters still stands; I'm using a sed script now, and I find the output much clearer. Thanks a lot. |
I have a similar issue with Rust, with has the same syntax that C++ for the generics. |
The |
I just pushed the patch earlier (thanks), and this is hopefully fixed. I also added a new test file, test/perf-js-stacks-01.txt, and the corresponding test/results files, which are checked by the test.sh program. This new test file has many <> chars in. If you have some rust or C++ profile output in particular that should behave, it would be good to add sample output (you may need to redact it) in a similar way under test/. It can be just a few stacks (like the one I just added). Eg, to fix the "(anonymous namespace)::" issue it's going to be helpful to have a variety of output in test/ so we can check what regexp is going to work... |
I have a rust example. What do you want exactly? |
Just the "perf script" output, and you can edit/truncate it down as much as you like. See under test/ -- some are the full output (including header), some are just a couple of stacks. You can also just create a new ticket with "rust example" and paste the "perf script" output in and I'll add it to tests. thanks! |
in a PR? |
either a PR or just pasted in a ticket is fine |
Just did #109 |
C++ template types have lots of
<
s and>
s in them. But they get filtered out bystackcollapse-perf.pl
(and possibly others, didn't check), and the resulting SVG has things likeinstead of
The following patch fixes this, but I assume has unintended consequences:
The text was updated successfully, but these errors were encountered: