Comments (12)
Also, demangled C++ types can have (anonymous namespace)::
in them, which makes the $func =~ s/\(.*//;
line suspect as well.
from flamegraph.
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?
from flamegraph.
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/<>/()/;
from flamegraph.
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 stackcollapse-perf.pl
:
$func =~ tr/<>//d;
In my tests, removing this line shows them as parentheses, while also removing line 573 of flamegraph.pl
correctly shows them as angle brackets. I didn't try with input from other profilers, though.
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.
from flamegraph.
I have a similar issue with Rust, with has the same syntax that C++ for the generics. <...>
gets turned into ()
. If I remove the $stack =~ tr/<>/()/;
line mentioned above, the <>
are kept as expected. From the comments it seems like it's to protect SVG, but I don't have any issues with this fix.
from flamegraph.
The <>
characters are xml encoded, so I don't think it's a problem https://github.com/brendangregg/FlameGraph/blob/master/flamegraph.pl#L1022-L1023
from flamegraph.
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...
from flamegraph.
I have a rust example. What do you want exactly? perf.data
+ output svg?
from flamegraph.
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!
from flamegraph.
in a PR?
from flamegraph.
either a PR or just pasted in a ticket is fine
from flamegraph.
Just did #109
from flamegraph.
Related Issues (20)
- Failure on `Hello, world!` with `ERROR No stack counts found` HOT 2
- Error while using stack collapse for pmc on freebsd
- bjdump: /tmp/perf-$pid.map: File format not recognized ▒
- Capturing stacks on Amazon Linux 2 kernel 4.14 and 5.10 HOT 1
- Segment Fault and report errors when I using perf script -F ...,trace HOT 3
- Trace file recreated and new file has a 'n' added to the end of the name after running
- Adjust --minwidth options HOT 1
- Warn for low sample counts HOT 1
- How can it get some time internal flamegraph HOT 2
- Producing proper Flame Charts
- flamegraph hierarchical disorder HOT 1
- Supporting real number for samples data
- CPU flamegraphs using perf show wrong sample counts HOT 1
- show layer usage percent locally in zoom
- hot/cold FlameGraph 目前可以使用进行性能测试分析么?
- Is gprof currently supported?
- Suggestion: ./flamegraph.pl start with no parameters
- Add option to exclude 'search' functionality
- Unable to obtain the complete function call stack of `__memset_avx2_erms`.
- Not aggregating stacks for threads HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flamegraph.