GithubHelp home page GithubHelp logo

lotabout / cargo-instruments Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cmyr/cargo-instruments

0.0 3.0 0.0 453 KB

A cargo plugin to generate Xcode Instruments trace files

License: Apache License 2.0

Rust 100.00%

cargo-instruments's Introduction

cargo-instruments

Easily generate Instruments traces for your rust crate.

cargo-instruments is 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

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.

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

$ cargo instruments [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

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

# profile the main binary with the Allocations template
$ cargo instruments alloc
# profile examples my_example.rs
$ cargo instruments --example my_example

Resources

Instruments Help

WWDC videos

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

cargo-instruments's People

Contributors

cmyr avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.