austin-python 1.5.0__tar.gz → 1.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {austin_python-1.5.0 → austin_python-1.6.0}/PKG-INFO +7 -7
- {austin_python-1.5.0 → austin_python-1.6.0}/README.md +2 -2
- {austin_python-1.5.0 → austin_python-1.6.0}/austin/__init__.py +1 -1
- {austin_python-1.5.0 → austin_python-1.6.0}/austin/format/mojo.py +11 -2
- {austin_python-1.5.0 → austin_python-1.6.0}/pyproject.toml +6 -5
- {austin_python-1.5.0 → austin_python-1.6.0}/test/format/test_mojo.py +11 -2
- {austin_python-1.5.0 → austin_python-1.6.0}/test/test_aio.py +36 -39
- {austin_python-1.5.0 → austin_python-1.6.0}/.flake8 +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/.gitignore +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/.readthedocs.yml +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/AUTHORS +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/CODE-OF-CONDUCT.md +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/CONTRIBUTING.md +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/COPYING +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/ISSUE_TEMPLATE.md +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/LICENSE.md +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/MANIFEST.in +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/PULL_REQUEST_TEMPLATE.md +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/austin/aio.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/austin/cli.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/austin/config.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/austin/format/__init__.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/austin/format/compress.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/austin/format/pprof/__init__.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/austin/format/pprof/__main__.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/austin/format/pprof/profile.proto +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/austin/format/pprof/profile_pb2.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/austin/format/speedscope.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/austin/simple.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/austin/stats.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/austin/threads.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/austin/tools/diff.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/austin/tools/resolve.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/__init__.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/conftest.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/data/austin.json +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/data/austin.out +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/data/austin.pprof +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/data/austinp.mojo +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/data/austinp.resolved.mojo +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/data/column.mojo +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/data/column.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/data/diff_a-b.austin +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/data/diff_a.austin +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/data/diff_b.austin +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/data/mp.austin +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/data/mp.mojo +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/data/test.austin +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/data/test.mojo +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/format/__init__.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/format/test_compress.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/format/test_pprof.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/format/test_speedscope.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/stats/test_austin_file_reader.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/stats/test_austin_stats.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/stats/test_frame.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/stats/test_hierarchical_stats.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/stats/test_sample.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/test_cli.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/test_config.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/test_semver.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/test_simple.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/test_threads.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/tools/test_diff.py +0 -0
- {austin_python-1.5.0 → austin_python-1.6.0}/test/tools/test_resolve.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: austin-python
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.6.0
|
|
4
4
|
Summary: Python wrapper for Austin, the CPython frame stack sampler.
|
|
5
5
|
Project-URL: homepage, https://github.com/P403n1x87/austin-python
|
|
6
6
|
Project-URL: documentation, https://austin-python.readthedocs.io
|
|
@@ -15,15 +15,15 @@ Keywords: development,performance,profiling,testing
|
|
|
15
15
|
Classifier: Development Status :: 5 - Production/Stable
|
|
16
16
|
Classifier: Intended Audience :: Developers
|
|
17
17
|
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.8
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.9
|
|
21
20
|
Classifier: Programming Language :: Python :: 3.10
|
|
22
21
|
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
-
|
|
24
|
-
Requires-
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Requires-Python: >=3.8
|
|
24
|
+
Requires-Dist: protobuf~=3.12
|
|
25
25
|
Requires-Dist: psutil>=5.7.0
|
|
26
|
-
Requires-Dist: toml~=0.10
|
|
26
|
+
Requires-Dist: toml~=0.10
|
|
27
27
|
Description-Content-Type: text/markdown
|
|
28
28
|
|
|
29
29
|
<p align="center">
|
|
@@ -187,8 +187,8 @@ raw samples by aggregation.
|
|
|
187
187
|
|
|
188
188
|
# Compatibility
|
|
189
189
|
|
|
190
|
-
The `austin-python` package is tested on Linux, macOS and Windows with
|
|
191
|
-
3.
|
|
190
|
+
The latest `austin-python` package is tested on Linux, macOS and Windows with
|
|
191
|
+
Python 3.8-3.12.
|
|
192
192
|
|
|
193
193
|
|
|
194
194
|
# Documentation
|
|
@@ -159,8 +159,8 @@ raw samples by aggregation.
|
|
|
159
159
|
|
|
160
160
|
# Compatibility
|
|
161
161
|
|
|
162
|
-
The `austin-python` package is tested on Linux, macOS and Windows with
|
|
163
|
-
3.
|
|
162
|
+
The latest `austin-python` package is tested on Linux, macOS and Windows with
|
|
163
|
+
Python 3.8-3.12.
|
|
164
164
|
|
|
165
165
|
|
|
166
166
|
# Documentation
|
|
@@ -240,7 +240,7 @@ class BaseAustin(ABC):
|
|
|
240
240
|
def check_exit(self, rcode: int, stderr: Optional[str]) -> None:
|
|
241
241
|
"""Check Austin exit status."""
|
|
242
242
|
if rcode:
|
|
243
|
-
if rcode in
|
|
243
|
+
if rcode in {-15, 15, 241}:
|
|
244
244
|
raise AustinTerminated()
|
|
245
245
|
raise AustinError(f"({rcode}) {stderr}")
|
|
246
246
|
|
|
@@ -135,11 +135,18 @@ class MojoStack(MojoEvent):
|
|
|
135
135
|
"""MOJO stack."""
|
|
136
136
|
|
|
137
137
|
pid: int
|
|
138
|
+
iid: int
|
|
138
139
|
tid: str
|
|
139
140
|
|
|
140
141
|
def to_austin(self) -> str:
|
|
141
142
|
"""Convert the event to Austin format."""
|
|
142
|
-
|
|
143
|
+
try:
|
|
144
|
+
tid = int(self.tid, 16)
|
|
145
|
+
except ValueError:
|
|
146
|
+
tid = self.tid
|
|
147
|
+
return (
|
|
148
|
+
f"P{self.pid};T{self.iid}:{tid}" if self.iid >= 0 else f"P{self.pid};T{tid}"
|
|
149
|
+
)
|
|
143
150
|
|
|
144
151
|
|
|
145
152
|
@dataclass(frozen=True, eq=True)
|
|
@@ -325,7 +332,9 @@ class MojoFile:
|
|
|
325
332
|
yield from self._emit_metrics()
|
|
326
333
|
|
|
327
334
|
self._pid = pid = self.read_int()
|
|
328
|
-
|
|
335
|
+
iid = self.read_int() if self.mojo_version >= 3 else -1
|
|
336
|
+
|
|
337
|
+
yield MojoStack(pid, iid, self.read_string())
|
|
329
338
|
|
|
330
339
|
def _lookup_string(self) -> MojoString:
|
|
331
340
|
n = self.read_int()
|
|
@@ -35,18 +35,18 @@ classifiers = [
|
|
|
35
35
|
"Development Status :: 5 - Production/Stable",
|
|
36
36
|
"Intended Audience :: Developers",
|
|
37
37
|
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
|
|
38
|
-
"Programming Language :: Python :: 3.7",
|
|
39
38
|
"Programming Language :: Python :: 3.8",
|
|
40
39
|
"Programming Language :: Python :: 3.9",
|
|
41
40
|
"Programming Language :: Python :: 3.10",
|
|
42
41
|
"Programming Language :: Python :: 3.11",
|
|
42
|
+
"Programming Language :: Python :: 3.12",
|
|
43
43
|
]
|
|
44
44
|
|
|
45
|
-
requires-python = ">=3.
|
|
45
|
+
requires-python = ">=3.8"
|
|
46
46
|
dependencies = [
|
|
47
|
-
"protobuf~=3.12
|
|
47
|
+
"protobuf~=3.12",
|
|
48
48
|
"psutil>=5.7.0",
|
|
49
|
-
"toml~=0.10
|
|
49
|
+
"toml~=0.10",
|
|
50
50
|
]
|
|
51
51
|
|
|
52
52
|
dynamic = ["version"]
|
|
@@ -69,13 +69,14 @@ austinp-resolve = "austin.tools.resolve:main"
|
|
|
69
69
|
template = "tests"
|
|
70
70
|
dependencies = [
|
|
71
71
|
"pytest>=5.4.2",
|
|
72
|
+
"pytest-asyncio",
|
|
72
73
|
"pytest-cov>=2.8.1",
|
|
73
74
|
]
|
|
74
75
|
[tool.hatch.envs.tests.scripts]
|
|
75
76
|
tests = "pytest --cov=austin --cov-report=term-missing --cov-report=xml {args}"
|
|
76
77
|
|
|
77
78
|
[[tool.hatch.envs.tests.matrix]]
|
|
78
|
-
python = ["3.
|
|
79
|
+
python = ["3.8", "3.9", "3.10", "3.11", "3.12"]
|
|
79
80
|
|
|
80
81
|
[tool.hatch.envs.checks]
|
|
81
82
|
python = "3.10"
|
|
@@ -29,7 +29,11 @@ from random import randint
|
|
|
29
29
|
|
|
30
30
|
import pytest
|
|
31
31
|
|
|
32
|
-
from austin.format.mojo import MojoFile
|
|
32
|
+
from austin.format.mojo import MojoFile
|
|
33
|
+
from austin.format.mojo import MojoFrame
|
|
34
|
+
from austin.format.mojo import MojoStack
|
|
35
|
+
from austin.format.mojo import MojoString
|
|
36
|
+
from austin.format.mojo import MojoStringReference
|
|
33
37
|
from austin.format.mojo import main
|
|
34
38
|
from austin.format.mojo import to_varint
|
|
35
39
|
|
|
@@ -53,7 +57,7 @@ def test_mojo_snapshot(case):
|
|
|
53
57
|
|
|
54
58
|
def test_mojo_varint():
|
|
55
59
|
for _ in range(100_000):
|
|
56
|
-
n = randint(-4e9, 4e9)
|
|
60
|
+
n = randint(int(-4e9), int(4e9))
|
|
57
61
|
buffer = BytesIO()
|
|
58
62
|
buffer.write(b"MOJ\0" + to_varint(n))
|
|
59
63
|
buffer.seek(0)
|
|
@@ -158,3 +162,8 @@ def test_mojo_column_info():
|
|
|
158
162
|
column_end=17,
|
|
159
163
|
),
|
|
160
164
|
}
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
def test_mojo_stack():
|
|
168
|
+
assert MojoStack(1, -1, "noiid").to_austin() == "P1;Tnoiid"
|
|
169
|
+
assert MojoStack(1, 2, "iid").to_austin() == "P1;T2:iid"
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
import asyncio
|
|
25
25
|
import sys
|
|
26
26
|
|
|
27
|
+
import pytest
|
|
27
28
|
from pytest import raises
|
|
28
29
|
|
|
29
30
|
from austin import AustinError
|
|
@@ -70,21 +71,20 @@ class InvalidBinaryAsyncAustin(AsyncAustin):
|
|
|
70
71
|
BINARY = "_austin"
|
|
71
72
|
|
|
72
73
|
|
|
73
|
-
|
|
74
|
+
@pytest.mark.asyncio
|
|
75
|
+
async def test_async_time():
|
|
74
76
|
austin = TestAsyncAustin()
|
|
75
77
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
]
|
|
87
|
-
)
|
|
78
|
+
await austin.start(
|
|
79
|
+
[
|
|
80
|
+
"-t",
|
|
81
|
+
"10",
|
|
82
|
+
"-Ci",
|
|
83
|
+
"100",
|
|
84
|
+
"python",
|
|
85
|
+
"-c",
|
|
86
|
+
"from time import sleep; sleep(2)",
|
|
87
|
+
]
|
|
88
88
|
)
|
|
89
89
|
|
|
90
90
|
austin.assert_callbacks_called()
|
|
@@ -93,30 +93,31 @@ def test_async_time():
|
|
|
93
93
|
assert austin.python_version is not None
|
|
94
94
|
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
@pytest.mark.asyncio
|
|
97
|
+
async def test_async_memory():
|
|
97
98
|
austin = TestAsyncAustin()
|
|
98
99
|
|
|
99
100
|
def sample_callback(data):
|
|
100
101
|
austin._sample_received = True
|
|
101
102
|
|
|
102
103
|
austin._sample_callback = sample_callback
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
]
|
|
114
|
-
)
|
|
104
|
+
await austin.start(
|
|
105
|
+
[
|
|
106
|
+
"-t",
|
|
107
|
+
"10",
|
|
108
|
+
"-mCi",
|
|
109
|
+
"100",
|
|
110
|
+
"python",
|
|
111
|
+
"-c",
|
|
112
|
+
"[i for i in range(10000000)]",
|
|
113
|
+
]
|
|
115
114
|
)
|
|
115
|
+
|
|
116
116
|
austin.assert_callbacks_called()
|
|
117
117
|
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
@pytest.mark.asyncio
|
|
120
|
+
async def test_async_terminate():
|
|
120
121
|
austin = TestAsyncAustin()
|
|
121
122
|
|
|
122
123
|
def sample_callback(*args):
|
|
@@ -130,18 +131,15 @@ def test_async_terminate():
|
|
|
130
131
|
austin._terminate_callback = terminate_callback
|
|
131
132
|
|
|
132
133
|
try:
|
|
133
|
-
asyncio.
|
|
134
|
-
asyncio.wait_for(austin.start(["-t", "10", "-Ci", "10ms", "python"]), 30)
|
|
135
|
-
)
|
|
134
|
+
await asyncio.wait_for(austin.start(["-t", "10", "-Ci", "10ms", "python"]), 30)
|
|
136
135
|
except AustinError:
|
|
137
136
|
austin.assert_callbacks_called()
|
|
138
137
|
|
|
139
138
|
|
|
140
|
-
|
|
139
|
+
@pytest.mark.asyncio
|
|
140
|
+
async def test_async_invalid_binary():
|
|
141
141
|
with raises(AustinError):
|
|
142
|
-
|
|
143
|
-
InvalidBinaryAsyncAustin(sample_callback=lambda x: None).start(["python"])
|
|
144
|
-
)
|
|
142
|
+
await InvalidBinaryAsyncAustin(sample_callback=lambda x: None).start(["python"])
|
|
145
143
|
|
|
146
144
|
|
|
147
145
|
def test_async_no_sample_callback():
|
|
@@ -149,11 +147,10 @@ def test_async_no_sample_callback():
|
|
|
149
147
|
InvalidBinaryAsyncAustin()
|
|
150
148
|
|
|
151
149
|
|
|
152
|
-
|
|
150
|
+
@pytest.mark.asyncio
|
|
151
|
+
async def test_async_bad_options():
|
|
153
152
|
austin = TestAsyncAustin(terminate_callback=lambda *args: None)
|
|
154
153
|
with raises(AustinError):
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
["-I", "1000", "python", "-c", "for i in range(1000000): print(i)"]
|
|
158
|
-
)
|
|
154
|
+
await austin.start(
|
|
155
|
+
["-I", "1000", "python", "-c", "for i in range(1000000): print(i)"]
|
|
159
156
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|