So @Wesley Wiser -- I'm trying to get self-profile data out from the compiler and not seeing anything. When I run with
-Zself-profile, basically, nothing seems to be being created.
The files should be named
perf-* in current directory?
The name changed about a month ago but yes, the files should be in your working directory
Are you invoking rustc directly or via cargo?
via cargo, but when I use the
-v option it does seem to be passing
rustc --crate-name style components/style/lib.rs --color never --crate-type lib --emit=dep-info,metadata,link -C debuginfo=2 -Zself-profile ...
Then, yeah, it should be enabled and outputting the current directory
No chance you got a
warning: failed to create profiler right?
no, I don't see that
I also tried @Wesley Wiser just doing
I must be doing something dumb
You're not on a really old version of rustc are you?
The profiler is tied into
rustc::session::build_session_with_source_map() so I don't think there's a codepath which ignores the option
I just built it
the commit is from June 18
It doesn't sound like you're doing anything dumb :slight_smile:
Unfortunately we don't have any
trace!()ing around the profiler initialization.
I will look into this tonight and get back to you
I am seeing some output now
the file names do not have
pid in them though
I think they're
ok,I have no idea why I wasn't seeing files before
but now I do
now I have to remember how to postprocess the data :)
@Wesley Wiser do you know what kinds of stuff winds up getting included in "macro expansion"
A lot it looks like
I'm going to be afk for a few hours but I'll check back later tonight.
@Wesley Wiser ok, thanks
I'm going to try and figure out the flame graph stuff
isn't there some way to view this stuff in chrome or other tools?
@nikomatsakis yeah measureme has
crox to produce profiling files in chrome's format https://github.com/rust-lang/measureme/tree/master/crox — as for other tools there's eg https://www.speedscope.app/ which can read flamegraphs in the usual format IIRC
@nikomatsakis The stack collapse tool is https://github.com/rust-lang/measureme/tree/master/stack_collapse. You can use that to get a collapsed stacks file that can be input into the FlameGraph scripts. As @lqd mentioned, you can also just open the output of
stack-collapse in speedscope.
I figured it out, thanks all. I'm trying to correlate the results with some other profiling data, I haven't yet fully succeeded -- but partly that's because gathering other data has proven hard.
I've also heard good things about profiler.firefox.com from @Alex Crichton; not sure wihich formats it can load