In-process CPython frame stack sampler
Project description
Echion
Near-zero-overhead, in-process CPython frame stack sampler
Synopsis
Echion is an in-process CPython frame stack sampler. It can achieve near-zero-overhead, similar to Austin, by sampling the frame stack of each thread without holding the GIL. Native stacks can be sampled too, but the overhead is higher.
Echion is also the first example of a high-performance sampling async profiler for CPython.
Installation
Currently Echion is available to install from sources via this repository.
pipx install git+https://github.com/p403n1x87/echion
Compilation requires a C++ compiler.
Usage
The following is the output of the echion --help
command.
usage: echion [-h] [-i INTERVAL] [-c] [-n] [-o OUTPUT] [-s] [-w] [-v] [-V] ...
In-process CPython frame stack sampler
positional arguments:
command Command string to execute.
options:
-h, --help show this help message and exit
-i INTERVAL, --interval INTERVAL
sampling interval in microseconds
-c, --cpu sample stacks on CPU only
-n, --native sample native stacks
-o OUTPUT, --output OUTPUT
output location (can use %(pid) to insert the process ID)
-s, --stealth stealth mode (sampler thread is not accounted for)
-w, --where where mode: display thread stacks on SIGQUIT (usually CTRL+\)
-v, --verbose verbose logging
-V, --version show program's version number and exit
The output is written to a file specified with the --output
option. Curretly, this is in
the format of the normal Austin format, that is collapsed stacks with
metadata at the top. This makes it easy to re-use existing visualisation tools,
like the Austin VS Code extension.
Compatibility
Supported platforms: Linux (amd64), Darwin (amd64)
Supported interpreters: CPython 3.8-3.12
Where mode
The where mode is similar to Austin's where mode. Since Echion cannot
attach a running process, it instead relies on the user to send a SIGQUIT to a
process that has been started with the echion
wrapper command. On most
terminals, this is done by pressing CTRL+\. This will
cause Echion to dump the stacks of all running threads to standard error. This
is useful for debugging deadlocks and other issues that may occur in a running
process.
Why Echion?
Sampling in-process comes with some benefits. One has easier access to more
information, like thread names, and potentially the task abstraction of async
frameworks, like asyncio
, gevent
, ... . Also available is more accurate
per-thread CPU timing information.
Currently, Echion supports sampling asyncio-based applications, but not in native mode. This makes Echion the very first example of an async profiler for CPython.
Echion relies on some assumptions to collect and sample all the running threads without holding the GIL. This makes Echion very similar to tools like Austin. However, some features, like multiprocess support, are more complicated to handle and would require the use of e.g. IPC solutions. Attaching to a running CPython process is also equally challenging, and this is where out-of-process tools like Austin provide a better, zero-instrumentation alternative.
How it works
On a fundamental level, there is one key assumption that Echion relies upon:
The main thread lives as long as the CPython process itself.
All unsafe memory reads are performed indirectly via copies of data structure
obtained with the use of system calls like process_vm_readv
. This is
essentially what allows Echion to run its sampling thread without the GIL.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file echion-0.1.0.tar.gz
.
File metadata
- Download URL: echion-0.1.0.tar.gz
- Upload date:
- Size: 698.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 803cce2670a4fc37e8503ba7e5aef90fa69caa62f303236a4a0114967f92284f |
|
MD5 | 154bf67a5d87857f0d113d748544ab36 |
|
BLAKE2b-256 | c8992296b66b0114414a7fc6f5fecc9a331f977e0f827323963a2b88cf9494c1 |
File details
Details for the file echion-0.1.0-cp311-cp311-musllinux_1_1_x86_64.whl
.
File metadata
- Download URL: echion-0.1.0-cp311-cp311-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.11, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7b641b86c533c5fee50abeb1a187256ef49768b4664dae9c07005f8ea8dd873 |
|
MD5 | e1f92b3b2a38bbbbe6e049f606c2e030 |
|
BLAKE2b-256 | 34cb3dd580a249e0ed2121d8cb9105636ca866b557b79a1cba0a7c009159c85d |
File details
Details for the file echion-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: echion-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 528.4 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59adfa9b07ea5cb77e96e40dbf2b8600c3459560684a99d75debce5f336b3511 |
|
MD5 | f094ed84fcd5c889835b0bdca2fbcaef |
|
BLAKE2b-256 | b4f3338da867ff76ee0e90c015c86965d05d815abbe6b97e3b9a725beaa4ee3c |
File details
Details for the file echion-0.1.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: echion-0.1.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 525.7 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | adcf729f635bc8a9edbb0fe566c54192b1b2412fc183afb517a08a1fe719a3d4 |
|
MD5 | 852300d1cb31b0f4aa79633a3ca61d5f |
|
BLAKE2b-256 | ae01d787041f094afa91b74ea1b57d6ac77326af45634697b56289bfe6ee0c6d |
File details
Details for the file echion-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
.
File metadata
- Download URL: echion-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 64.8 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bb42ec2bb8ea2d308dc0d7fd2fcca1d18a1d7a1f5e38c9c2bc8118fc107da95 |
|
MD5 | 7cc9a9e82108bf5498d92d9eefd27b10 |
|
BLAKE2b-256 | 241f097544ce55e55a24a82d4459cd8ec6a26efb2ecb6e93928d508ce04de8d5 |
File details
Details for the file echion-0.1.0-cp311-cp311-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: echion-0.1.0-cp311-cp311-macosx_10_9_x86_64.whl
- Upload date:
- Size: 69.2 kB
- Tags: CPython 3.11, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f73466a4d4d8f9e89e0e35181f8cc4268d7715c71b343622f514f0d969e9eb93 |
|
MD5 | 97d19e56ba19ad7d7d7a8b315328d93e |
|
BLAKE2b-256 | 444e9c82a59e99c7b16563d6279abf0ee5c31d1ccedb161ed55426afd0fcf2ee |
File details
Details for the file echion-0.1.0-cp311-cp311-macosx_10_9_universal2.whl
.
File metadata
- Download URL: echion-0.1.0-cp311-cp311-macosx_10_9_universal2.whl
- Upload date:
- Size: 104.4 kB
- Tags: CPython 3.11, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48ffa45419a48777e344ca7cbf785bbeafb0594bb578c25c78830953a4d6d5f7 |
|
MD5 | 4f493c1e76a41c667b68e5368252aa52 |
|
BLAKE2b-256 | 38568465a093f59ba9aa7182e49e4089d5e109bf903c08387b86dce23d432f26 |
File details
Details for the file echion-0.1.0-cp310-cp310-musllinux_1_1_x86_64.whl
.
File metadata
- Download URL: echion-0.1.0-cp310-cp310-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.10, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab19b748f6918b5712eb5665420b6133ec78b973238a78688a2668c507a219b3 |
|
MD5 | b5b108b5f2aedae856b4270dc259f46a |
|
BLAKE2b-256 | 2aa91ea3e4bf2ea90cd36c2f2c8203ea60d12f0cd57a628aee7a433305492c40 |
File details
Details for the file echion-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: echion-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 525.7 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ae6e04dff54076459ce4f37b730494c5e6abb03c818e50490a2adfc3a4e07a2 |
|
MD5 | c99c5c73d90d74c157a5ff595734a69e |
|
BLAKE2b-256 | b3e3e162db2428bc94ff1cd86bcdceec33bbdeb8393951e0c4e0e9bbb668485c |
File details
Details for the file echion-0.1.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: echion-0.1.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 522.6 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 095eb5c22757a757a0955184694e0a306e0ebb2c6a93f9ecebbc297aa4410664 |
|
MD5 | 8058cd8c91aecc062ce1a7bacdc7d005 |
|
BLAKE2b-256 | c36003d814ce2b76d477b75c35f46f8367ed5d22078d7201430369ef60224e38 |
File details
Details for the file echion-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
.
File metadata
- Download URL: echion-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 64.5 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d09367c1a90ed31855739cc338de53a559e7dd8f7781ccd89ecf43d5934b94fa |
|
MD5 | 7deccb6ba5cc90b26515eebb2878ab3e |
|
BLAKE2b-256 | b1b43b257882401631956f894102ed47e84b7b51356cd336f509afc5f6d15de5 |
File details
Details for the file echion-0.1.0-cp310-cp310-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: echion-0.1.0-cp310-cp310-macosx_10_9_x86_64.whl
- Upload date:
- Size: 68.9 kB
- Tags: CPython 3.10, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf81bb5abeed7d8d3e829337dfd2ea536a4d941dd78749a97565cfdc27ee1c56 |
|
MD5 | d63d132129f0a7cda1dfde8a2cf1cb01 |
|
BLAKE2b-256 | 7e9d3145fc0e49caf3d3d2dc9250f7d4535877d7f4ebd35b55cd6523e27d6a44 |
File details
Details for the file echion-0.1.0-cp310-cp310-macosx_10_9_universal2.whl
.
File metadata
- Download URL: echion-0.1.0-cp310-cp310-macosx_10_9_universal2.whl
- Upload date:
- Size: 103.7 kB
- Tags: CPython 3.10, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36b0840eb7f153d9dc9c991151c7b3825a05fe49465938ecaa758b7d8a9e1493 |
|
MD5 | 9fd5bd5c2339ccdbb541c22afdcda9f2 |
|
BLAKE2b-256 | 95b756af64e5f5551ef0d5431bb248d417a2ec118d630ed728e04a5314d16a56 |
File details
Details for the file echion-0.1.0-cp39-cp39-musllinux_1_1_x86_64.whl
.
File metadata
- Download URL: echion-0.1.0-cp39-cp39-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.9, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08c8cbe4ab6453a86108307785c45bc9aa437dbff1dbb019adbd9e55134d65aa |
|
MD5 | 689a0c13ed802bcaeb6536e97330b159 |
|
BLAKE2b-256 | e0ebda460af7dcd1c0ba89ffcac75c6b3e9fa064473efdc642bdf548ec8ee2c7 |
File details
Details for the file echion-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: echion-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 523.6 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17311d7602ecb8a6442d91891e9d54d6039387d43d040c1eefd1ad46ca50e600 |
|
MD5 | 5a6dddf4e9547a77c37ded22edfad593 |
|
BLAKE2b-256 | 5ba40f02fb5b68c30e23fe91b3dd8f2a0c329845a0035ab32c12f0b4b17c9a04 |
File details
Details for the file echion-0.1.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: echion-0.1.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 520.8 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dccf4053325c0e72da0444898af5d34400a420830ba9c5c66cdfac4d3eeebaef |
|
MD5 | 87b314930f823e6c79780833af4494fe |
|
BLAKE2b-256 | 88c924059730dd3a3dda86bf8b0a00c89f9b0ddaff46fbccda144e76c336f09d |
File details
Details for the file echion-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
.
File metadata
- Download URL: echion-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 64.4 kB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0b3fb04646620e47e0fc7a08b5baf0c8feb90f698d067c21026e03526f983de |
|
MD5 | 1608ecdf69221a090bcf6f5485491ff8 |
|
BLAKE2b-256 | 22a0d440e0f27c3d2d23dcce8fb357db73775b532a75ae2140b8221138352c55 |
File details
Details for the file echion-0.1.0-cp39-cp39-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: echion-0.1.0-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 68.8 kB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32f32ad473b8289077f7f69bde03f2621d6b62240b274f022e7c855f6890c500 |
|
MD5 | fbc763d265a2bed8e45250c45653cf32 |
|
BLAKE2b-256 | 65e15858c426aa36a63d3cffa8ab5624393faf99cb01abde488b5248c5bec17e |
File details
Details for the file echion-0.1.0-cp39-cp39-macosx_10_9_universal2.whl
.
File metadata
- Download URL: echion-0.1.0-cp39-cp39-macosx_10_9_universal2.whl
- Upload date:
- Size: 103.6 kB
- Tags: CPython 3.9, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b751a85163676455fb651b1fe068d35ea76fbc067495cfb7c4a8d010f237bdc |
|
MD5 | 6c7fa00c5e4075b0c748aa74b8ed54a9 |
|
BLAKE2b-256 | ab13783dafc8266143a4b923e21b6ef084139ee6eda17836f6f79c77e1049cdc |
File details
Details for the file echion-0.1.0-cp38-cp38-musllinux_1_1_x86_64.whl
.
File metadata
- Download URL: echion-0.1.0-cp38-cp38-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.8, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f59eade95f74bab12cf5c7f52c7940016635d2540dbd86cbe3fed365d9ffba05 |
|
MD5 | ad7c33698cd1b324bc35014664507210 |
|
BLAKE2b-256 | 89f198ad6ebf5a383bc1472382a10fe10d39ceee6bbf60512565ff69eb222d9d |
File details
Details for the file echion-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: echion-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 523.6 kB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b19a7778e9e7e39f30560be9a8f15ed36242c6635f0a4224b3b9f07fbcd44938 |
|
MD5 | bda957de1223291c11146bec8c4da393 |
|
BLAKE2b-256 | ba5119f36af8a21be5fa4bec1e38772aac1567b732b3ab4dec2f8555cad9c52d |
File details
Details for the file echion-0.1.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: echion-0.1.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 520.6 kB
- Tags: CPython 3.8, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c11c0afbcbc8a92d6b2a4f7b6e1221fa60e7f6b77f15eaa33e4d44d02f0a2560 |
|
MD5 | fa7139e4a3630fb5dc9bfcccd629f6e6 |
|
BLAKE2b-256 | 5a7e7d4cb622207833a3391d0afac181f11e4f09096da246d54f78817a978bb4 |
File details
Details for the file echion-0.1.0-cp38-cp38-macosx_11_0_arm64.whl
.
File metadata
- Download URL: echion-0.1.0-cp38-cp38-macosx_11_0_arm64.whl
- Upload date:
- Size: 64.4 kB
- Tags: CPython 3.8, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 398c2acc3742997d6107d10796885dae62a2565f59dfe20d10447a91d60c8057 |
|
MD5 | af64097b7c2d6f7740b189470922df9e |
|
BLAKE2b-256 | 0dd0c9e6be6dd7d37572833b8d433cc8c96c2e4c74fcb06b19db7611a0bc4c70 |
File details
Details for the file echion-0.1.0-cp38-cp38-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: echion-0.1.0-cp38-cp38-macosx_10_9_x86_64.whl
- Upload date:
- Size: 68.8 kB
- Tags: CPython 3.8, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c11c86ad3ff3e8c884931e9d597a72fc92ff6e3b78deaab11f31f41335bdeff2 |
|
MD5 | 4ef9e0f7f9e7cd8038299eddc7c329d8 |
|
BLAKE2b-256 | fbf6277dc7a807c8b474ef42d0986f720613b4f25f7e0639e8248079990d1540 |
File details
Details for the file echion-0.1.0-cp38-cp38-macosx_10_9_universal2.whl
.
File metadata
- Download URL: echion-0.1.0-cp38-cp38-macosx_10_9_universal2.whl
- Upload date:
- Size: 103.6 kB
- Tags: CPython 3.8, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33cb9504ac568bb15f49a31249857fc03dd57ef73b16905f6b27a9dd8fdaa4e0 |
|
MD5 | 625f89731368193ab12380207c473bf1 |
|
BLAKE2b-256 | c2302a691bb3f5349eaf37d651995f6ea158fdcffd612c8ad081eb67288d9e34 |