From b881786b5025c6deea3b018604f1e79850b21213 Mon Sep 17 00:00:00 2001 From: "Gabriele N. Tornetta" Date: Thu, 7 Jan 2021 16:13:49 +0000 Subject: [PATCH] chore(README): Enhance README with link to Austin --- .github/workflows/tests.yml | 2 +- .travis.yml | 2 +- README.md | 39 ++++++++++++++++++++++++------------- austin_web/__main__.py | 6 ++++-- 4 files changed, 31 insertions(+), 18 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 91b2b22..584df91 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -70,7 +70,7 @@ jobs: - name: Publish coverage metrics run: | cd $GITHUB_WORKSPACE/main - poetry run codecov + nox -rs coverage if: startsWith(matrix.os, 'ubuntu') env: CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} diff --git a/.travis.yml b/.travis.yml index ca176c0..c5ecb72 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ jobs: before_script: # Install required Python versions - sudo add-apt-repository ppa:deadsnakes/ppa -y - - sudo apt install python3.{6..8} python3.{6..8}-dev -y; + - sudo apt install python3.{6..9} python3.{6..9}-dev python3.9-venv -y; # Clone Austin development branch - git clone --branch devel --depth 1 https://github.com/P403n1x87/austin.git ../austin diff --git a/README.md b/README.md index 9952370..a8cc2bc 100644 --- a/README.md +++ b/README.md @@ -58,11 +58,10 @@ # Synopsis -Austin Web is a modern web interface for Austin, based on -[D3.js](https://d3js.org/) and [tailwindcss](https://tailwindcss.com/). It is -yet another example of how to use Austin to make a visual profiling tool for -Python. The flame graph is generated using -[d3-flame-graph](https://github.com/spiermar/d3-flame-graph). +Austin Web is a modern web interface for [Austin], the frame stack sampler for +CPython, based on [D3.js] and [tailwindcss]. It is yet another example of how to +use Austin to make a visual profiling tool for Python. The flame graph is +generated using [d3-flame-graph].

**NOTE** Austin Web relies on the -> [Austin](https://github.com/P403n1x87/austin) binary being available from the -> `PATH` environment variable. So make sure that Austin is properly installed on -> your system. See -> [Austin installation](https://github.com/P403n1x87/austin#installation) -> instruction for more details on how to get Austin installed on your platform. +> [Austin] binary being available from the `PATH` environment variable. So make +> sure that Austin is properly installed on your system. See [Austin +> installation](https://github.com/P403n1x87/austin#installation) instruction +> for more details on how to get Austin installed on your platform. # Usage @@ -147,6 +143,14 @@ mode, pressing `Ctrl+C` might not actually stop Austin Web. Since Austin Web uses Austin to collect samples, the same note applies here: +> Attaching to a running process in Python requires the `cap_systrace` +> capability. To avoid running Austin Web with `sudo`, consider setting it to +> the Austin binary with, e.g. +> +> ~~~ bash +> sudo setcap cap_sys_ptrace+ep `which austin` +> ~~~ + > Due to the **System Integrity Protection** introduced in **MacOS** with El > Capitan, Austin cannot profile Python processes that use an executable located > in the `/bin` folder, even with `sudo`. Hence, either run the interpreter from @@ -173,3 +177,10 @@ on BMC or by chipping in a few pennies on alt="Buy Me A Coffee" />

+ + +[Austin]: https://github.com/P403n1x87/austin +[D3.js]: https://d3js.org/ +[d3-flame-graph]: https://github.com/spiermar/d3-flame-graph +[flamegraph.pl]: https://github.com/brendangregg/FlameGraph +[tailwindcss]: https://tailwindcss.com/ \ No newline at end of file diff --git a/austin_web/__main__.py b/austin_web/__main__.py index 6b3268a..6183510 100644 --- a/austin_web/__main__.py +++ b/austin_web/__main__.py @@ -258,8 +258,10 @@ def run(self) -> None: loop.run_forever() if not austin_task.done(): austin_task.cancel() - loop.run_until_complete(austin_task) - austin_task.result() + try: + loop.run_until_complete(austin_task) + except asyncio.CancelledError: + pass except AustinError as e: (message,) = e.args if message[0] == "(":