Skip to content

Commit

Permalink
Add support for writing out Speedscope files
Browse files Browse the repository at this point in the history
This adds support for writing out speedscope files, as well as writing out raw
call stack data. The speedscope code is adapted from rbspy.

This change also refactors the commandline arguments significantly, changing
to take subcommands (```py-spy dump -p 1234```) instead of flags. While this
is a breaking change, I think it is a better long term solution for py-spy
- and it makes more sense for the '-f' flag to be the file format and '-o'
to be the filename (which would have broken commandline compatability anyways).
  • Loading branch information
benfred committed Jul 28, 2019
1 parent 50befec commit 01ae8be
Show file tree
Hide file tree
Showing 11 changed files with 598 additions and 108 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## v0.2.0 (pre-release)

* Add ability to profile native python extensions [#2](https://github.com/benfred/py-spy/issues/2)
* Add FreeBSD support [#112](https://github.com/benfred/py-spy/issues/112)
* Add option to write out Speedscope files [#115](https://github.com/benfred/py-spy/issues/115)
* Add option to output raw call stack data [#35](https://github.com/benfred/py-spy/issues/35)
* Get thread idle status from OS [#92](https://github.com/benfred/py-spy/issues/92)
* Allow use as a library by other rust programs [#110](https://github.com/benfred/py-spy/issues/110)
* Show OS threadids in --dump [#57](https://github.com/benfred/py-spy/issues/57)
* Drop root permissions when starting new process [#116](https://github.com/benfred/py-spy/issues/116)
* Support building for ARM procesesors [#89](https://github.com/benfred/py-spy/issues/89)

## v0.1.11

* Fix to detect GIL status on Python 3.7+ [#104](https://github.com/benfred/py-spy/pull/104)
Expand Down
50 changes: 50 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ license = "GPL-3.0"
build="build.rs"

[dependencies]
clap = "2"
clap = {version="2", features=["wrap_help"]}
console = "0.7"
ctrlc = "3"
indicatif = "0.11"
Expand All @@ -28,6 +28,9 @@ tempfile = "3.0.3"
proc-maps = "0.1.6"
memmap = "0.7.0"
cpp_demangle = "0.2.12"
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
rand = "0.6"
remoteprocess = {path="./remoteprocess", version="0.1.0"}

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ Not yet =).
## Credits

py-spy is heavily inspired by [Julia Evans](https://github.com/jvns/) excellent work on [rbspy](http://github.com/rbspy/rbspy).
In particular, the code to generate the flamegraphs is taken directly from rbspy, and this project uses the
In particular, the code to generate flamegraph and speedscope files is taken directly from rbspy, and this project uses the
[read-process-memory](https://github.com/luser/read-process-memory) and [proc-maps](https://github.com/benfred/proc-maps) crates that were spun off from rbspy.

## License
Expand Down
1 change: 0 additions & 1 deletion examples/native_stress_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ fn native_stress_test(pid: remoteprocess::Pid) -> Result<(), failure::Error> {
}
}
}
Ok(())
}


Expand Down
Loading

0 comments on commit 01ae8be

Please sign in to comment.