Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ jobs:
- uses: actions/checkout@v4
with:
ref: stable
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
- name: Set up Rust toolchain
run: rustup toolchain install --no-self-update --profile minimal nightly
- name: Build
run: cargo build --all
run: cargo +nightly build --all
- name: Generate self-profile
run: RUSTFLAGS="-Zself-profile" cargo +nightly build --bin crox
- name: Check crox
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Publish
on:
release:
types: [created]

jobs:
publish:
name: Publish to crates.io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust (rustup)
run: rustup update stable && rustup default stable
- name: Publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish -p measureme
132 changes: 36 additions & 96 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,112 +2,52 @@ name: Rust

on:
push:
branches: [
master,
auto, # used for bors
try # used for bors
]
branches:
- master
- stable
pull_request:
branches: [ master ]
branches:
- master
- stable

env:
CARGO_TERM_COLOR: always

jobs:
build_stable:

build:
strategy:
matrix:
rust: [ stable, beta, nightly ]
include:
- rust: nightly
check_cfg: '-Zcheck-cfg'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions/checkout@v4
- name: Set up Rust toolchain
run: |
rustup toolchain install --no-self-update --profile minimal ${{ matrix.rust }}
rustup default ${{ matrix.rust }}
# Add a big endian target so we can check that everything at least
# compiles on big endian.
rustup target add --toolchain ${{ matrix.rust }} powerpc64-unknown-linux-gnu
- name: Build
run: cargo build --verbose --all
run: cargo build --verbose --all ${{ matrix.check_cfg }}
- name: Run tests
run: cargo test --verbose --all
run: cargo test --verbose --all ${{ matrix.check_cfg }}
- name: Docs
run: cargo doc --verbose --all

build_beta:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: beta
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --verbose --all
- uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --all
- uses: actions-rs/cargo@v1
with:
command: doc
args: --verbose --all

build_nightly:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --verbose --all -Zcheck-cfg
- uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --all -Zcheck-cfg
- uses: actions-rs/cargo@v1
with:
command: doc
args: --verbose --all

check_big_endian:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: powerpc64-unknown-linux-gnu
override: true
- uses: actions-rs/cargo@v1
with:
command: check
args: --verbose --lib --bins --tests

# These jobs doesn't actually test anything, but they're only used to tell
# bors the build completed, as there is no practical way to detect when a
# workflow is successful listening to webhooks only.
#
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
end-success:
name: bors build finished
runs-on: ubuntu-latest
needs: [build_stable, build_beta, build_nightly, check_big_endian]
if: github.event.pusher.name == 'bors' && success()
steps:
- name: mark the job as a success
run: exit 0

end-failure:
name: bors build finished
run: cargo doc --verbose --no-deps
- name: Check big endian
run: cargo check --target powerpc64-unknown-linux-gnu --verbose --all
success:
needs:
- build
runs-on: ubuntu-latest
needs: [build_stable, build_beta, build_nightly, check_big_endian]
if: github.event.pusher.name == 'bors' && (failure() || cancelled())
# GitHub branch protection is exceedingly silly and treats "jobs skipped because a dependency
# failed" as success. So we have to do some contortions to ensure the job fails if any of its
# dependencies fails.
if: always() # make sure this is never "skipped"
steps:
- name: mark the job as a failure
run: exit 1
# Manually check the status of all dependencies. `if: failure()` does not work.
- name: check if any dependency failed
run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
# Changelog

## [11.0.1] - 2024-01-11

### Changed

- `measureme`: Fix compilation error and regression tests for big endian platforms ([GH-220])

### Added

- Add GitHub Workflow for publishing measureme ([GH-221])

## [11.0.0] - 2023-12-14

### Changed

- `measureme`: Update StringId and Addr sizes from u32 to u64 ([GH-216])
- `analyzeme`: v9 file format, which uses larger events ([GH-216])

Expand Down Expand Up @@ -239,3 +250,5 @@
[GH-209]: https://github.com/rust-lang/measureme/pull/209
[GH-211]: https://github.com/rust-lang/measureme/pull/211
[GH-216]: https://github.com/rust-lang/measureme/pull/216
[GH-220]: https://github.com/rust-lang/measureme/pull/220
[GH-221]: https://github.com/rust-lang/measureme/pull/221
2 changes: 1 addition & 1 deletion analyzeme/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "analyzeme"
version = "11.0.0"
version = "11.0.1"
authors = ["Wesley Wiser <[email protected]>", "Michael Woerister <michaelwoerister@posteo>"]
edition = "2018"
license = "MIT OR Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion crox/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "crox"
version = "11.0.0"
version = "11.0.1"
authors = ["Wesley Wiser <[email protected]>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion decodeme/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "decodeme"
version = "11.0.0"
version = "11.0.1"
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
9 changes: 6 additions & 3 deletions flamegraph/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
[package]
name = "flamegraph"
version = "11.0.0"
authors = ["Wesley Wiser <[email protected]>", "Michael Woerister <michaelwoerister@posteo>"]
version = "11.0.1"
authors = [
"Wesley Wiser <[email protected]>",
"Michael Woerister <michaelwoerister@posteo>",
]
edition = "2018"
license = "MIT OR Apache-2.0"

[dependencies]
measureme = { path = "../measureme" }
analyzeme = { path = "../analyzeme" }
clap = { version = "3.2", features = ["derive"] }
inferno = { version="0.9.1", default-features = false }
inferno = { version = "0.11", default-features = false }
2 changes: 1 addition & 1 deletion measureme/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "measureme"
version = "11.0.0"
version = "11.0.1"
authors = ["Wesley Wiser <[email protected]>", "Michael Woerister <michaelwoerister@posteo>"]
edition = "2018"
description = "Support crate for rustc's self-profiling feature"
Expand Down
24 changes: 12 additions & 12 deletions measureme/src/raw_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ impl RawEvent {
{
// We always emit data as little endian, which we have to do
// manually on big endian targets.
bytes[0..4].copy_from_slice(&self.event_kind.as_u32().to_le_bytes());
bytes[4..8].copy_from_slice(&self.event_id.as_u32().to_le_bytes());
bytes[8..12].copy_from_slice(&self.thread_id.to_le_bytes());
bytes[12..16].copy_from_slice(&self.payload1_lower.to_le_bytes());
bytes[16..20].copy_from_slice(&self.payload2_lower.to_le_bytes());
bytes[20..24].copy_from_slice(&self.payloads_upper.to_le_bytes());
bytes[0..8].copy_from_slice(&self.event_kind.as_u64().to_le_bytes());
bytes[8..16].copy_from_slice(&self.event_id.as_u64().to_le_bytes());
bytes[16..20].copy_from_slice(&self.thread_id.to_le_bytes());
bytes[20..24].copy_from_slice(&self.payload1_lower.to_le_bytes());
bytes[24..28].copy_from_slice(&self.payload2_lower.to_le_bytes());
bytes[28..32].copy_from_slice(&self.payloads_upper.to_le_bytes());
}
}

Expand All @@ -183,12 +183,12 @@ impl RawEvent {
#[cfg(target_endian = "big")]
{
RawEvent {
event_kind: StringId::new(u32::from_le_bytes(bytes[0..4].try_into().unwrap())),
event_id: EventId::from_u32(u32::from_le_bytes(bytes[4..8].try_into().unwrap())),
thread_id: u32::from_le_bytes(bytes[8..12].try_into().unwrap()),
payload1_lower: u32::from_le_bytes(bytes[12..16].try_into().unwrap()),
payload2_lower: u32::from_le_bytes(bytes[16..20].try_into().unwrap()),
payloads_upper: u32::from_le_bytes(bytes[20..24].try_into().unwrap()),
event_kind: StringId::new(u64::from_le_bytes(bytes[0..8].try_into().unwrap())),
event_id: EventId::from_u64(u64::from_le_bytes(bytes[8..16].try_into().unwrap())),
thread_id: u32::from_le_bytes(bytes[16..20].try_into().unwrap()),
payload1_lower: u32::from_le_bytes(bytes[20..24].try_into().unwrap()),
payload2_lower: u32::from_le_bytes(bytes[24..28].try_into().unwrap()),
payloads_upper: u32::from_le_bytes(bytes[28..32].try_into().unwrap()),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion mmedit/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mmedit"
version = "11.0.0"
version = "11.0.1"
edition = "2018"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion mmview/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mmview"
version = "11.0.0"
version = "11.0.1"
authors = ["Wesley Wiser <[email protected]>", "Michael Woerister <michaelwoerister@posteo>"]
edition = "2018"
license = "MIT OR Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion stack_collapse/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "stack_collapse"
version = "11.0.0"
version = "11.0.1"
authors = ["Wesley Wiser <[email protected]>", "Michael Woerister <michaelwoerister@posteo>"]
edition = "2018"
license = "MIT OR Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion summarize/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "summarize"
version = "11.0.0"
version = "11.0.1"
authors = ["Wesley Wiser <[email protected]>", "Michael Woerister <michaelwoerister@posteo>"]
edition = "2018"
license = "MIT OR Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion version_checker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "version_checker"
version = "11.0.0"
version = "11.0.1"
authors = ["Michael Woerister <michaelwoerister@posteo>"]
edition = "2018"
license = "MIT OR Apache-2.0"
Expand Down