Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: aclysma/profiling
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 24bf8d6a964558156dac8567ea4364bbaeba6228
Choose a base ref
..
head repository: aclysma/profiling
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5e046d673acfb602fd7ae1f9d96968b5cb1511af
Choose a head ref
Showing with 23 additions and 2 deletions.
  1. +20 −0 .github/workflows/ci.yml
  2. +2 −0 README.md
  3. +1 −2 profiling/examples/simple.rs
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -32,23 +32,43 @@ jobs:
- name: Build (puffin)
run: cargo build --package=profiling --features=profile-with-puffin

- name: Build (puffin example)
run: cargo build --package=profiling --features=profile-with-puffin --example=simple

- name: Build (superluminal)
if: ${{ runner.os == 'Windows' && matrix.toolchain == 'stable' }}
run: cargo build --package=profiling --features=profile-with-superluminal

- name: Build (superluminal example)
if: ${{ runner.os == 'Windows' && matrix.toolchain == 'stable' }}
run: cargo build --package=profiling --features=profile-with-superluminal --example=simple

- name: Build (optick)
if: ${{ runner.os == 'Windows' && matrix.toolchain == 'stable' }}
run: cargo build --package=profiling --features=profile-with-optick

- name: Build (optick example)
if: ${{ runner.os == 'Windows' && matrix.toolchain == 'stable' }}
run: cargo build --package=profiling --features=profile-with-optick --example=simple

- name: Build (tracing)
run: cargo build --package=profiling --features=profile-with-tracing

- name: Build (tracing example)
run: cargo build --package=profiling --features=profile-with-tracing --example=simple

- name: Build (tracy)
run: cargo build --package=profiling --features=profile-with-tracy

- name: Build (tracy example)
run: cargo build --package=profiling --features=profile-with-tracy --example=simple

- name: Build (type-check)
run: cargo build --package=profiling --features=type-check

- name: Build (type-check example)
run: cargo build --package=profiling --features=type-check --example=simple

# Only do this on windows, some of the profilers only support windows
- name: Run tests
if: ${{ runner.os == 'Windows' && matrix.toolchain == 'stable' }}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -69,6 +69,8 @@ Currently, there's just six macros:
* `profiling::scope!(name: &str, [tag: &str])`
* name: scopes will appear in the profiler under this name
* tag: optional extra data
* For maximum compatibility, you are **strongly** recommended to use literal strings for the name. Some backends require
static lifetime string references and some require literal strings.
* `#[profiling::function]`
* procmacro placed on a function to quickly wrap it in a scope using the function name
* `#[profiling::all_functions]`
3 changes: 1 addition & 2 deletions profiling/examples/simple.rs
Original file line number Diff line number Diff line change
@@ -50,8 +50,7 @@ fn some_other_function(iterations: usize) {
burn_time(5);

{
// Make this a non-literal to touch more of the API
profiling::scope!(&"do iterations".to_string());
profiling::scope!("do iterations");
for i in 0..iterations {
profiling::scope!(
"some_inner_function_that_sleeps",