Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
4cb7f1a
imp(backends): move backends to a separate workspace
omarabid Feb 7, 2022
0ff5c92
merge from 0.3.1
omarabid Feb 7, 2022
c9e4481
wip
omarabid Feb 13, 2022
15899dd
Merge from main
omarabid Feb 16, 2022
b775c19
wip
omarabid Feb 17, 2022
4b0e648
wip: pyspy working concept
omarabid Feb 24, 2022
6bda544
wip: minor py-spy changes
omarabid Feb 26, 2022
41bdaa8
wip: experimental FFI for ruby/python
omarabid Feb 28, 2022
0434cb7
merge from main
omarabid Feb 28, 2022
2c2a986
refactor(error): harmonize BackendError with the main library
omarabid Feb 28, 2022
3b15d20
imp(cli): add pyroscope cli binary
omarabid Feb 28, 2022
d14a834
imp(ffi): add pyroscope ffi library
omarabid Feb 28, 2022
b07bb18
imp(meta): add license/readme files and other metadata
omarabid Feb 28, 2022
aff8170
imp(cli): add workspaces from rust-starter
omarabid Feb 28, 2022
0903725
imp(cli): add logger facility
omarabid Feb 28, 2022
563f58f
imp(cli): add Result/Error types
omarabid Feb 28, 2022
66414f7
imp(cli): add app_config module
omarabid Feb 28, 2022
bbf251c
imp(cli): import core code from rust-starter
omarabid Feb 28, 2022
db7c693
imp(cli): add main.rs from rust-starter
omarabid Feb 28, 2022
269fa8a
imp(cli): add commandline commands/arguments from pyroscope
omarabid Feb 28, 2022
b9a59b6
Merge branch 'main' into 0.4.0
omarabid Feb 28, 2022
c3358c0
refactor(ffi): move ffi.rs file
omarabid Mar 1, 2022
b484b42
wip(backend): new Backend trait
omarabid Mar 1, 2022
e68f353
imp(backend): new backend trait implementation
omarabid Mar 1, 2022
ef12f46
imp(examples): update backend examples
omarabid Mar 1, 2022
6c939c9
refactor(backend): update rbspy and pyspy
omarabid Mar 1, 2022
bb62e2d
fix(tests): fix some failed tests
omarabid Mar 1, 2022
c46f6ea
refactor(dep): update rbspy dependency
omarabid Mar 2, 2022
2c48292
wip: rbspy backend
omarabid Mar 2, 2022
e120ae4
wip: pyspy backend
omarabid Mar 2, 2022
048dbab
wip: cli
omarabid Mar 2, 2022
192e61a
chore(deps): upgrade config to 0.12
omarabid Mar 2, 2022
60d7b14
imp(rbspy): Rbspy writer implementation
omarabid Mar 4, 2022
de7037e
wip: rbspy backend
omarabid Mar 4, 2022
1f22c2c
imp(rbspy): check PID is set
omarabid Mar 4, 2022
267ee9e
imp(rbspy): log errors returned from sampler
omarabid Mar 4, 2022
8d0cbe4
imp(rbspy): dump heuristic for channel size
omarabid Mar 5, 2022
4f07b11
imp(rbspy): implement custom formatter for StackFrames
omarabid Mar 5, 2022
6b194a4
wip: pyspy backend
omarabid Mar 5, 2022
8b5f4d9
refactor(example): update examples
omarabid Mar 5, 2022
340f585
wip: pyspy backend
omarabid Mar 5, 2022
e4ce453
wip: new BackendImpl and StackTrace definitions
omarabid Mar 5, 2022
e74400b
wip: Void Backend
omarabid Mar 5, 2022
539a8ee
imp(backend): implement Display for StackTrace and StackFrame
omarabid Mar 6, 2022
f47af81
wip: pyspy backend
omarabid Mar 6, 2022
93d1131
refactor(example): move internal examples to a separate directory
omarabid Mar 6, 2022
22a1604
imp(backend): initial Void backend implementation
omarabid Mar 6, 2022
625a5bd
Merge from main
omarabid Mar 6, 2022
be49593
imp(backend): add Report type
omarabid Mar 7, 2022
dd00869
refactor(example): change examples stress function
omarabid Mar 7, 2022
61d8fc8
wip: Report conversion
omarabid Mar 7, 2022
b60b1a6
imp(pprof): Report conversion for pprof backend
omarabid Mar 7, 2022
6ff6f85
imp(pyspy): use AtomicBool instead of Mutex
omarabid Mar 7, 2022
b93c41c
wip: FFI update
omarabid Mar 7, 2022
6c77888
wip: CLI
omarabid Mar 7, 2022
b476d0f
imp(rbspy): add RbspyConfig helper functions
omarabid Mar 8, 2022
a40f72f
wip: CLI
omarabid Mar 8, 2022
3d34ce4
Merge from main
omarabid Mar 9, 2022
5d1a049
fix(warning): fix various compiler warnings
omarabid Mar 15, 2022
70aa4bb
chore(deps): upgrade pprof to 0.7
omarabid Mar 15, 2022
fca7d50
chore(actions): add libunwind8-dev to build/tests
omarabid Mar 15, 2022
33c6a5e
imp(backends): move backends to separate crates
omarabid Mar 16, 2022
0f315ce
imp(rbspy): change type implementation to pyroscope Backend types
omarabid Mar 16, 2022
97215e3
refactor(ffi): remove ffi package
omarabid Mar 16, 2022
afe9224
imp(cli): initial implementation for executor wrapper
omarabid Mar 18, 2022
49b4f64
imp(cli): initial implementation for profiler wrapper
omarabid Mar 21, 2022
9f53527
wip: cli
omarabid Mar 21, 2022
5170373
refactor(tags): change tags parameter type to Vec
omarabid Mar 21, 2022
2c44db7
wip: cli
omarabid Mar 22, 2022
cf79afc
chore(cargo): various minor changes
omarabid Mar 22, 2022
a6d9f78
Add CI Targets (#22)
omarabid Mar 22, 2022
2f03a84
imp(pprof): add sample_rate helper function to config builder
omarabid Mar 22, 2022
06159b2
refactor(pyspy): various code refactoring for pyspy
omarabid Mar 22, 2022
129a851
imp(cli): add gil/idle/native pyspy arguments
omarabid Mar 22, 2022
c7dfec6
chore(docs): update README file
omarabid Mar 23, 2022
d9120ee
imp(cli): add log filtering
omarabid Mar 23, 2022
4e24830
fix(session): correct last session time
omarabid Mar 23, 2022
df1ad30
imp(cli): initial CLI implementation
omarabid Mar 23, 2022
c96f97b
refactor(clippy): fix clippy warnings
omarabid Mar 23, 2022
c0b9bab
refactor(code): various minor refactoring
omarabid Mar 27, 2022
5f2511a
imp(cli): accept argument for exec command
omarabid Mar 28, 2022
3b0f3dc
wip: ci/publish actions
omarabid Mar 29, 2022
0828975
chore(deps): update packages versions
omarabid Mar 29, 2022
7d2bd8f
chore(release): 0.4.0
omarabid Mar 29, 2022
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
51 changes: 48 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,28 @@ on: [push, pull_request]

jobs:
build:
name: ${{ matrix.os }}
name: ${{ matrix.package }} - ${{ matrix.os }} - ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
package: [lib, cli, pprofrs, pyspy, rbspy]
os: [ubuntu-latest, macos-latest]
target: [x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, x86_64-apple-darwin, aarch64-apple-darwin]
exclude:
- os: ubuntu-latest
target: x86_64-apple-darwin
- os: ubuntu-latest
target: aarch64-apple-darwin
- os: macos-latest
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: aarch64-unknown-linux-gnu
steps:
- name: install libunwind (for pprof)
if: matrix.os == 'ubuntu-latest'
continue-on-error: true
run: sudo apt install libunwind8-dev

- name: Checkout sources
uses: actions/checkout@v2

Expand All @@ -20,7 +36,36 @@ jobs:
toolchain: stable
override: true

- name: Run cargo build
- name: Cargo build for pyroscope library
uses: omarabid-forks/rs-cargo@v1
if: matrix.package == 'lib'
with:
command: build

- name: Cargo build for pyrosocpe-cli
uses: omarabid-forks/rs-cargo@v1
if: matrix.package == 'cli'
with:
args: --manifest-path pyroscope_cli/Cargo.toml
command: build

- name: Cargo build for pprof-rs
uses: omarabid-forks/rs-cargo@v1
if: matrix.package == 'pprofrs'
with:
args: --manifest-path pyroscope_backends/pyroscope_pprofrs/Cargo.toml
command: build

- name: Cargo build for pyspy
uses: omarabid-forks/rs-cargo@v1
if: matrix.package == 'pyspy'
with:
args: --manifest-path pyroscope_backends/pyroscope_pyspy/Cargo.toml
command: build

- name: Cargo build for rbspy
uses: omarabid-forks/rs-cargo@v1
if: matrix.package == 'rbspy'
with:
args: --manifest-path pyroscope_backends/pyroscope_rbspy/Cargo.toml
command: build
18 changes: 17 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ on:

jobs:
publish-pyroscope:
name: Publish pyroscope crate
name: pyroscope-lib
runs-on: ubuntu-latest
if: "startsWith(github.event.release.tag_name, 'lib-')"
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
Expand All @@ -20,3 +21,18 @@ jobs:
run: |
cargo login ${{ secrets.CARGO_TOKEN }}
cargo publish
publish-cli:
name: pyroscope-cli
runs-on: ubuntu-latest
if: "startsWith(github.event.release.tag_name, 'cli-')"
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: publish pyroscope crate
continue-on-error: true
run: |
cargo login ${{ secrets.CARGO_TOKEN }}
cargo publish --manifest-path pyroscope_cli/Cargo.toml
102 changes: 99 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,109 @@ name: Pre-Release
on: [push]

jobs:
release:
name: Create draft release
lib-release:
name: pyroscope-main
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
if: "startsWith(github.ref, 'refs/tags/lib-')"
continue-on-error: true
steps:
- uses: "marvinpinto/action-automatic-releases@v1.1.1"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ github.ref_name }}"
title: "pyroscope-${{ github.ref_name }}"
draft: true
prerelease: false
cli-release:
name: pyroscope-cli
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/cli-')"
steps:
- uses: "marvinpinto/action-automatic-releases@v1.1.1"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ github.ref_name }}"
title: "pyroscope-${{ github.ref_name }}"
draft: true
prerelease: false
cli-artifacts:
name: pyroscope-cli - build aritifacts
needs: ['cli-release']
runs-on: ${{ matrix.os }}
env:
# For some builds, we use cross to test on 32-bit and big-endian
# systems.
CARGO: cargo
# When CARGO is set to CROSS, this is set to `--target matrix.target`.
TARGET_FLAGS: ""
# When CARGO is set to CROSS, TARGET_DIR includes matrix.target.
TARGET_DIR: ./target
# Emit backtraces on panics.
RUST_BACKTRACE: 1
strategy:
matrix:
build: [linux, linux-arm, macos]
include:
- build: linux
os: ubuntu-18.04
rust: stable
target: x86_64-unknown-linux-musl
- build: linux-arm
os: ubuntu-18.04
rust: stable
target: arm-unknown-linux-gnueabihf
- build: macos
os: macos-latest
rust: stable
target: x86_64-apple-darwin
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true
target: ${{ matrix.target }}

- name: Use Cross
shell: bash
run: |
cargo install cross
echo "CARGO=cross" >> $GITHUB_ENV
echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV

- name: Show command used for Cargo
run: |
echo "cargo command is: ${{ env.CARGO }}"
echo "target flag is: ${{ env.TARGET_FLAGS }}"
echo "target dir is: ${{ env.TARGET_DIR }}"

- name: Build release binary
run: ${{ env.CARGO }} build --manifest-path pyroscope_cli/Cargo.toml --verbose --release ${{ env.TARGET_FLAGS }}

- name: Strip release binary (linux and macos)
if: matrix.build == 'linux' || matrix.build == 'macos'
run: strip "pyroscope_cli/target/${{ matrix.target }}/release/pyroscope-cli"

- name: Strip release binary (arm)
if: matrix.build == 'linux-arm'
run: |
docker run --rm -v \
"$PWD/target:/target:Z" \
rustembedded/cross:arm-unknown-linux-gnueabihf \
arm-linux-gnueabihf-strip \
/target/arm-unknown-linux-gnueabihf/release/pyroscope-cli

- name: Upload release archive
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: "pyroscope_cli/target/${{ matrix.target }}/release/pyroscope-cli"
asset_name: "pyroscope-cli"
asset_content_type: application/octet-stream
53 changes: 50 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,70 @@ on: [push, pull_request]

jobs:
test:
name: ${{ matrix.os }}
name: ${{ matrix.package }} - ${{ matrix.os }} - ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
package: [lib, cli, pprofrs, pyspy, rbspy]
os: [ubuntu-latest, macos-latest]
target: [x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, x86_64-apple-darwin, aarch64-apple-darwin]
exclude:
- os: ubuntu-latest
target: x86_64-apple-darwin
- os: ubuntu-latest
target: aarch64-apple-darwin
- os: macos-latest
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: aarch64-unknown-linux-gnu
steps:
- name: install libunwind (for pprof)
if: matrix.os == 'ubuntu-latest'
continue-on-error: true
run: sudo apt install libunwind8-dev

- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: omarabid-forks/rs-toolchain@v1
with:
profile: minimal
profile: default
toolchain: stable
target: ${{ matrix.target }}
override: true

- name: Run cargo test
uses: omarabid-forks/rs-cargo@v1
if: matrix.package == 'lib'
with:
command: test
args: --all

- name: Cargo build for pyrosocpe-cli
uses: omarabid-forks/rs-cargo@v1
if: matrix.package == 'cli'
with:
args: --all --manifest-path pyroscope_cli/Cargo.toml
command: test

- name: Cargo build for pprof-rs
uses: omarabid-forks/rs-cargo@v1
if: matrix.package == 'pprofrs'
with:
args: --all --manifest-path pyroscope_backends/pyroscope_pprofrs/Cargo.toml
command: test

- name: Cargo build for pyspy
uses: omarabid-forks/rs-cargo@v1
if: matrix.package == 'pyspy'
with:
args: --all --manifest-path pyroscope_backends/pyroscope_pyspy/Cargo.toml
command: test

- name: Cargo build for rbspy
uses: omarabid-forks/rs-cargo@v1
if: matrix.package == 'rbspy'
with:
args: --all --manifest-path pyroscope_backends/pyroscope_rbspy/Cargo.toml
command: test
42 changes: 40 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,63 @@ Pyroscope Profiler
"""
keywords = ["pyroscope", "profiler"]
authors = ["Abid Omar <contact@omarabid.com>"]
version = "0.3.1"
version = "0.4.0"
edition = "2021"
license = "Apache-2.0"
homepage = "https://pyroscope.io"
documentation = "https://docs.rs/pyroscope"
repository = "https://github.com/pyroscope-io/pyroscope-rs"
readme = "README.md"
autobins = false
autoexamples = true
autotests = true
autobenches = true

[workspace]
members = [
]
exclude = [
"pyroscope_backends",
"pyroscope_cli",
]

[[example]]
name = "internal-backend-void"
path = "examples/internal/backend-void.rs"

[[example]]
name = "internal-backend-void-run"
path = "examples/internal/backend-void-run.rs"

[[example]]
name = "internal-backend-pprof"
path = "examples/internal/backend-pprof.rs"

[[example]]
name = "internal-timer"
path = "examples/internal/timer.rs"

[[example]]
name = "internal-pyspy-connect"
path = "examples/internal/pyspy-connect.rs"

[[example]]
name = "internal-rbspy-connect"
path = "examples/internal/rbspy-connect.rs"

[dependencies]
thiserror ="1.0"
log = "0.4"
reqwest = { version = "0.11", features = ["blocking"]}
pprof = "0.6.2"
libc = "^0.2.66"

[dev-dependencies]
tokio = { version = "1.13", features = ["full"] }
pretty_env_logger = "0.4.0"
assert_matches = "1"
pyroscope_pprofrs = { path = "pyroscope_backends/pyroscope_pprofrs" }
pyroscope_rbspy = { path = "pyroscope_backends/pyroscope_rbspy" }
pyroscope_pyspy = { path = "pyroscope_backends/pyroscope_pyspy" }

[profile.dev]
opt-level=0
Expand Down
Loading