cmyr / cargo-instruments

A cargo plugin to generate Xcode Instruments trace files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

--template only captures data for one facet at a time?

brainstorm opened this issue · comments

@cmyr, thanks so much for this crate, makes profiling Rust apps on OSX a real joy!

At first I ran cargo instruments without templates (time by default), but then I wanted to have allocations and syscalls as additional tracks, but:

$ cargo instruments --limit 10000 -t alloc -t time -t sys --open
error: The argument '--template <TEMPLATE>' was provided more than once, but cannot be used multiple times

USAGE:
    cargo instruments --limit <MILLIS> --open --template <TEMPLATE>

For more information try --help

$ cargo instruments --list
Instruments provides the following built-in templates.
Aliases are indicated in parentheses.

"Allocations"       (alloc)
"File Activity"     (io)
"System Trace"      (sys)
"Time Profiler"     (time)
"Activity Monitor"
"App Launch"
"Blank"
"Core Animation"
"Core Data"
"Counters"
"Energy Log"
"Game Performance"
"Leaks"
"Metal System Trace"
"Network"
"SceneKit"
"SwiftUI"
"Zombies"

I'm eager to know which cargo instruments CLI flags did you run to get the screenshot shown in the README.md? It contains all the information I need:

Instruments System Trace

With my current time CLI, I just get part of the trace information and the added tracks are empty (see "No Data" in syscall and alloc rows):

Skärmavbild 2020-01-06 kl  14 57 46

I am using the latest cargo instruments crate and OSX 10.15.2 Catalina. When I run with -t alloc (as the only parameter), I can see the allocations fine, I just would like to have a "combined" view with all the information.

Happy to hear you're finding this useful! The screenshot was made with some built-in template. I suspect it might be System Trace?

If you want a more complicated instrument, what you an do is create an instrument template through Instruments.app, and then save it to a location; you can do cargo instruments -t /path/to/MyInstrument and it will be used.

Ahh, gotcha, thanks for the tips 👍