All Projects → cmyr → Cargo Instruments

cmyr / Cargo Instruments

Licence: mit
A cargo plugin to generate Xcode Instruments trace files

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Cargo Instruments

rhack
Temporary edit external crates that your project depends on
Stars: ✭ 104 (-63.38%)
Mutual labels:  cargo
crm
Cargo registry manager (Cargo 注册表管理器),用于方便的管理和更换 Rust 国内镜像源
Stars: ✭ 103 (-63.73%)
Mutual labels:  cargo
thundra-agent-nodejs
Thundra Lambda Node.js Agent
Stars: ✭ 31 (-89.08%)
Mutual labels:  profiling
vcpkg-rs
Build library for finding native libraries in vcpkg for Rust - Windows (msvc), Linux and macOS
Stars: ✭ 68 (-76.06%)
Mutual labels:  cargo
glitter
🌌⭐ Git tooling of the future.
Stars: ✭ 150 (-47.18%)
Mutual labels:  cargo
broom
A disk cleaning utility for developers.
Stars: ✭ 38 (-86.62%)
Mutual labels:  cargo
probes-api
Software Activity Metering - Probes Open API
Stars: ✭ 31 (-89.08%)
Mutual labels:  profiling
Home
Project Glimpse: Node Edition - Spend less time debugging and more time developing.
Stars: ✭ 260 (-8.45%)
Mutual labels:  profiling
lo2s
Linux OTF2 Sampling - A Lightweight Node-Level Performance Monitoring Tool
Stars: ✭ 24 (-91.55%)
Mutual labels:  profiling
puffin egui
Show puffin profiler flamegraph in-game using egui
Stars: ✭ 45 (-84.15%)
Mutual labels:  profiling
cargo-llvm-cov
Cargo subcommand to easily use LLVM source-based code coverage (-C instrument-coverage).
Stars: ✭ 181 (-36.27%)
Mutual labels:  cargo
terabit-network-stack-profiling
Tools for profiling the Linux network stack.
Stars: ✭ 68 (-76.06%)
Mutual labels:  profiling
rustsec
Audit Cargo.lock files for dependencies with security vulnerabilities
Stars: ✭ 956 (+236.62%)
Mutual labels:  cargo
UnityOverDrawKun
overdraw check tool.
Stars: ✭ 39 (-86.27%)
Mutual labels:  profiling
blackjack
Build cargo dependencies with Bazel
Stars: ✭ 34 (-88.03%)
Mutual labels:  cargo
nixcrates
DEPRECATED reads rust-lang/crates.io-index and outputs nix expressions into fractalide/nix-crates-index
Stars: ✭ 14 (-95.07%)
Mutual labels:  cargo
ml-for-resource-allocation
Machine Learning for Dynamic Resource Allocation in Network Function Virtualization
Stars: ✭ 22 (-92.25%)
Mutual labels:  profiling
Cargo
📦 GitHub Action for Rust `cargo` command
Stars: ✭ 267 (-5.99%)
Mutual labels:  cargo
Wargo
Easy Rust to WebAssembly
Stars: ✭ 260 (-8.45%)
Mutual labels:  cargo
cargo-wix
A cargo subcommand to build Windows installers for rust projects using the WiX Toolset
Stars: ✭ 142 (-50%)
Mutual labels:  cargo

cargo-instruments

Easily generate Instruments traces for your rust crate.

cargo-instruments is the glue between cargo and Xcode's bundled profiling suite. It allows you to easily profile any binary in your crate, generating files that can be viewed in the Instruments app.

Instruments Time Profiler Instruments System Trace

Installation

brew

brew install cargo-instruments

Building from Source

First, ensure that you are running macOS, with Cargo, Xcode, and the Xcode Command Line Tools installed; then install with

cargo install cargo-instruments

Use

basic usage

cargo-instruments requires a binary target to run. By default, it will try to build the current crate's main.rs. You can specify an alternative binary by using the --bin or --example flags, or a benchmark target with the --bench flag.

Generate a new trace file (by default saved in /target/instruments)

$ cargo instruments [-t template] [--bin foo | --example bar] [--out out_file]

Open the file in Instruments.app (or pass --open to open automatically)

$ open target/instruments/my_bin_YYYY-MM-DD-THH:MM:SS.trace

Profiling application in release mode

When profiling the application in release mode the compiler doesn't provide debugging symbols in the default configuration.

To let the compiler generate the debugging symbols even in release mode you can append the following section in your Cargo.toml.

[profile.release]
debug = true

Templates

Instruments has the concept of 'templates', which describe sets of dtrace probes that can be enabled. cargo-instruments will use the "Time Profiler", which collects CPU core and thread use.

examples

# View all args and options
$ cargo instruments --help
# profile the main binary with the Allocations template
$ cargo instruments -t alloc
# profile examples/my_example.rs, with the default template,
# for 10 seconds, and open the trace when finished
$ cargo instruments --example my_example --limit 10000 --open

Resources

Instruments Help

WWDC videos

The best source of information about Instruments is likely the various WWDC sessions over the years:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].