pykdebugparser 1.2.7__py2.py3-none-any.whl → 1.2.8__py2.py3-none-any.whl
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.
- {pykdebugparser-1.2.7.dist-info → pykdebugparser-1.2.8.dist-info}/METADATA +2 -1
- {pykdebugparser-1.2.7.dist-info → pykdebugparser-1.2.8.dist-info}/RECORD +6 -18
- {pykdebugparser-1.2.7.dist-info → pykdebugparser-1.2.8.dist-info}/WHEEL +1 -1
- {pykdebugparser-1.2.7.dist-info → pykdebugparser-1.2.8.dist-info}/top_level.txt +0 -1
- tests/callstacks/test_callstacks_parser.py +0 -91
- tests/conftest.py +0 -15
- tests/test_kevent.py +0 -26
- tests/test_os_log_event.py +0 -267
- tests/test_pykdebugparser.py +0 -39
- tests/test_trace_codes.py +0 -13
- tests/traces/test_bsd.py +0 -32
- tests/traces/test_dyld.py +0 -251
- tests/traces/test_mach.py +0 -452
- tests/traces/test_perf.py +0 -118
- tests/traces/test_trace.py +0 -25
- tests/traces/test_turnstile.py +0 -127
- {pykdebugparser-1.2.7.dist-info → pykdebugparser-1.2.8.dist-info}/entry_points.txt +0 -0
- {pykdebugparser-1.2.7.dist-info → pykdebugparser-1.2.8.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pykdebugparser
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.8
|
|
4
4
|
Summary: Python parser for kdebug events
|
|
5
5
|
Author: Matan Perelman
|
|
6
6
|
Author-email: matan1008@gmail.com
|
|
@@ -34,6 +34,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
34
34
|
Classifier: Programming Language :: Python :: 3.11
|
|
35
35
|
Classifier: Programming Language :: Python :: 3.12
|
|
36
36
|
Classifier: Programming Language :: Python :: 3.13
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
37
38
|
Requires-Python: >=3.8
|
|
38
39
|
Description-Content-Type: text/markdown
|
|
39
40
|
License-File: LICENSE
|
|
@@ -16,21 +16,9 @@ pykdebugparser/trace_handlers/mach.py,sha256=jXcNblxJf4eM5_hyvR02jYk9zzFuN6iDIvU
|
|
|
16
16
|
pykdebugparser/trace_handlers/perf.py,sha256=OX79TBNN4rFTmm2vwt17HphGzC9LLnimkcbtQqZeT7Y,4749
|
|
17
17
|
pykdebugparser/trace_handlers/trace.py,sha256=Lu8s9XT1jb5avtrVXF6SQ6FUj93xYc0TwJd7yoIjV9U,5377
|
|
18
18
|
pykdebugparser/trace_handlers/turnstile.py,sha256=E8sRF3mvNMKLj465YfMpFgfF-5b6K_EbC7te8p0W0Mc,8155
|
|
19
|
-
pykdebugparser-1.2.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
tests/callstacks/test_callstacks_parser.py,sha256=eHzSgYtxD9l4S9RirROZswI8i4AYl53cbRErhzKHmic,5553
|
|
26
|
-
tests/traces/test_bsd.py,sha256=BOtqLlUDfwjXGVsmaGo7jiRZLIM3eWb5pzYHUz2Q8B4,1737
|
|
27
|
-
tests/traces/test_dyld.py,sha256=Wg0Vlp_xBYUiJly97EZpqnCL8q0pibBP879dE0VG9Ys,13886
|
|
28
|
-
tests/traces/test_mach.py,sha256=XHAzqQJPGVUISv-lIF5LZfCkF5UzvrYunK0gQMS8P6w,21382
|
|
29
|
-
tests/traces/test_perf.py,sha256=FJEp2mTfJidVDd-W0C5njRiF21tOPCvtnEuzxe94yc8,6275
|
|
30
|
-
tests/traces/test_trace.py,sha256=2yPox1tvA7iaZSnkY20GYtc1jp3B6Ls1-26B2Mt3AZw,1210
|
|
31
|
-
tests/traces/test_turnstile.py,sha256=ju9nDVAygr6bnbKNa-eIzZqDQBO9HwyQEbeJlsUL8Q8,5549
|
|
32
|
-
pykdebugparser-1.2.7.dist-info/METADATA,sha256=lFNvI1rGaY5WVKkdoSuXFs7ifB9y8_M0QiKQ3fCQLqk,18935
|
|
33
|
-
pykdebugparser-1.2.7.dist-info/WHEEL,sha256=XAkygS4h1cf0JYWV13kJhTWht2y9NqKAsZuiTHc2920,109
|
|
34
|
-
pykdebugparser-1.2.7.dist-info/entry_points.txt,sha256=NrVIOgPR6v2MbpTZ3aKedP1jQ93nUQus6sgP4wAD0_E,63
|
|
35
|
-
pykdebugparser-1.2.7.dist-info/top_level.txt,sha256=94rdtrPvR3tzOGuvq-BE-rcKlBHnQ4nPs3dD_ov4KME,21
|
|
36
|
-
pykdebugparser-1.2.7.dist-info/RECORD,,
|
|
19
|
+
pykdebugparser-1.2.8.dist-info/licenses/LICENSE,sha256=KjZXYP_CGYzDTtVfcxPT6wlGRoQKHPSJu0vh55_2QSo,1071
|
|
20
|
+
pykdebugparser-1.2.8.dist-info/METADATA,sha256=Y-_cCRLJp7PBpFr0u0i4YREvSr0W_9p3RAeVPyHcrkU,18986
|
|
21
|
+
pykdebugparser-1.2.8.dist-info/WHEEL,sha256=qWEHOWeXof9kJLXAXJ1hukQ_MvVtaV9UUAew6N7Y99E,109
|
|
22
|
+
pykdebugparser-1.2.8.dist-info/entry_points.txt,sha256=NrVIOgPR6v2MbpTZ3aKedP1jQ93nUQus6sgP4wAD0_E,63
|
|
23
|
+
pykdebugparser-1.2.8.dist-info/top_level.txt,sha256=FcHHXR9VKmqufFw0a6UP4c8NyS-u4ORY-yXQ6ZzP_28,15
|
|
24
|
+
pykdebugparser-1.2.8.dist-info/RECORD,,
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
from uuid import UUID
|
|
2
|
-
|
|
3
|
-
from pykdebugparser.callstacks_parser import Frame
|
|
4
|
-
from pykdebugparser.kevent import Kevent
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
def test_parsing_perf_event(traces_parser, callstacks_parser):
|
|
8
|
-
events = [
|
|
9
|
-
Kevent(timestamp=7006023115068,
|
|
10
|
-
data=(b'\t\x00\x00\x00\x00\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
|
11
|
-
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'),
|
|
12
|
-
values=(9, 32, 0, 0), tid=1957, debugid=620756993, eventid=620756992, func_qualifier=1),
|
|
13
|
-
Kevent(timestamp=7006023115085,
|
|
14
|
-
data=(b'E\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
|
15
|
-
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'),
|
|
16
|
-
values=(69, 5, 0, 0), tid=1957, debugid=620888088, eventid=620888088, func_qualifier=0),
|
|
17
|
-
Kevent(timestamp=7006023115105,
|
|
18
|
-
data=(b'\xf0[\xc0\xb5\x01\x00\x00\x00\xd4\xe4v\x93\x01\x00\x00\x000\x99\\\x02\x01\x00'
|
|
19
|
-
b'\x00\x00<\x0b\x16\xd1\x01\x00\x00\x00'),
|
|
20
|
-
values=(7344249840, 6769009876, 4334590256, 7802850108), tid=1957, debugid=620888080, eventid=620888080,
|
|
21
|
-
func_qualifier=0),
|
|
22
|
-
Kevent(timestamp=7006023115123,
|
|
23
|
-
data=(b'\xd4\xe6v\x93\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
|
24
|
-
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'),
|
|
25
|
-
values=(6769010388, 0, 0, 0), tid=1957, debugid=620888080, eventid=620888080, func_qualifier=0),
|
|
26
|
-
Kevent(timestamp=7006023115140,
|
|
27
|
-
data=(b'\x95\x00\x00\x00\x00\x00\x00\x00\xa5\x07\x00\x00\x00\x00\x00\x00\x80\xb1\x94m\x01'
|
|
28
|
-
b'\x00\x00\x00\x03\x00\xfc\xff\x00\x00\x00\x00'),
|
|
29
|
-
values=(149, 1957, 6133428608, 4294705155), tid=1957, debugid=620822532, eventid=620822532,
|
|
30
|
-
func_qualifier=0),
|
|
31
|
-
Kevent(timestamp=7006023115153,
|
|
32
|
-
data=(b'\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
|
33
|
-
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'),
|
|
34
|
-
values=(9, 0, 0, 0), tid=1957, debugid=620756994, eventid=620756992, func_qualifier=2)
|
|
35
|
-
]
|
|
36
|
-
ret = list(callstacks_parser.feed_generator(traces_parser.feed_generator(events)))
|
|
37
|
-
assert ret[0].timestamp == 7006023115068
|
|
38
|
-
assert ret[0].tid == 1957
|
|
39
|
-
assert ret[0].frames == [
|
|
40
|
-
Frame(0x1b5c05bf0, None, None),
|
|
41
|
-
Frame(0x19376e4d4, None, None),
|
|
42
|
-
Frame(0x1025c9930, None, None),
|
|
43
|
-
Frame(0x1d1160b3c, None, None),
|
|
44
|
-
Frame(0x19376e6d4, None, None),
|
|
45
|
-
]
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
def test_parsing_with_images(traces_parser, callstacks_parser):
|
|
49
|
-
events = [
|
|
50
|
-
Kevent(timestamp=2087564153638,
|
|
51
|
-
data=(b'\x19\xdd*\xd4E\xe01\x97\xa5\xc4S\xb3W\xf3a\xa0\x000u\xaa\x01'
|
|
52
|
-
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'),
|
|
53
|
-
values=(10894735564102884633, 11556785676805719205, 0x1aa753000, 0), tid=200651, debugid=520421376,
|
|
54
|
-
eventid=520421376, func_qualifier=0),
|
|
55
|
-
Kevent(timestamp=7006023115068,
|
|
56
|
-
data=(b'\t\x00\x00\x00\x00\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
|
57
|
-
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'),
|
|
58
|
-
values=(9, 32, 0, 0), tid=1957, debugid=620756993, eventid=620756992, func_qualifier=1),
|
|
59
|
-
Kevent(timestamp=7006023115085,
|
|
60
|
-
data=(b'E\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
|
61
|
-
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'),
|
|
62
|
-
values=(69, 5, 0, 0), tid=1957, debugid=620888088, eventid=620888088, func_qualifier=0),
|
|
63
|
-
Kevent(timestamp=7006023115105,
|
|
64
|
-
data=(b'\xf0[\xc0\xb5\x01\x00\x00\x00\xd4\xe4v\x93\x01\x00\x00\x000\x99\\\x02\x01\x00'
|
|
65
|
-
b'\x00\x00<\x0b\x16\xd1\x01\x00\x00\x00'),
|
|
66
|
-
values=(7344249840, 6769009876, 4334590256, 7802850108), tid=1957, debugid=620888080, eventid=620888080,
|
|
67
|
-
func_qualifier=0),
|
|
68
|
-
Kevent(timestamp=7006023115123,
|
|
69
|
-
data=(b'\xd4\xe6v\x93\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
|
70
|
-
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'),
|
|
71
|
-
values=(6769010388, 0, 0, 0), tid=1957, debugid=620888080, eventid=620888080, func_qualifier=0),
|
|
72
|
-
Kevent(timestamp=7006023115140,
|
|
73
|
-
data=(b'\x95\x00\x00\x00\x00\x00\x00\x00\xa5\x07\x00\x00\x00\x00\x00\x00\x80\xb1\x94m\x01'
|
|
74
|
-
b'\x00\x00\x00\x03\x00\xfc\xff\x00\x00\x00\x00'),
|
|
75
|
-
values=(149, 1957, 6133428608, 4294705155), tid=1957, debugid=620822532, eventid=620822532,
|
|
76
|
-
func_qualifier=0),
|
|
77
|
-
Kevent(timestamp=7006023115153,
|
|
78
|
-
data=(b'\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
|
79
|
-
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'),
|
|
80
|
-
values=(9, 0, 0, 0), tid=1957, debugid=620756994, eventid=620756992, func_qualifier=2)
|
|
81
|
-
]
|
|
82
|
-
ret = list(callstacks_parser.feed_generator(traces_parser.feed_generator(events)))
|
|
83
|
-
assert ret[0].timestamp == 7006023115068
|
|
84
|
-
assert ret[0].tid == 1957
|
|
85
|
-
assert ret[0].frames == [
|
|
86
|
-
Frame(0x1b5c05bf0, UUID('19dd2ad4-45e0-3197-a5c4-53b357f361a0'), 0xb4b2bf0),
|
|
87
|
-
Frame(0x19376e4d4, None, None),
|
|
88
|
-
Frame(0x1025c9930, None, None),
|
|
89
|
-
Frame(0x1d1160b3c, UUID('19dd2ad4-45e0-3197-a5c4-53b357f361a0'), 0x26a0db3c),
|
|
90
|
-
Frame(0x19376e6d4, None, None),
|
|
91
|
-
]
|
tests/conftest.py
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
|
|
3
|
-
from pykdebugparser.callstacks_parser import CallstacksParser
|
|
4
|
-
from pykdebugparser.trace_codes import default_trace_codes
|
|
5
|
-
from pykdebugparser.traces_parser import TracesParser
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
@pytest.fixture(scope='function')
|
|
9
|
-
def traces_parser():
|
|
10
|
-
return TracesParser(default_trace_codes(), {}, {})
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
@pytest.fixture(scope='function')
|
|
14
|
-
def callstacks_parser():
|
|
15
|
-
return CallstacksParser([], [])
|
tests/test_kevent.py
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
|
|
3
|
-
from pykdebugparser.kevent import from_kd_buf, Kevent
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@pytest.mark.parametrize('raw, parsed', [
|
|
7
|
-
(
|
|
8
|
-
(b'\x8b\xf3\x8f1\x13\xeb\x03\x00ework_BusinessChat-7.0.1-py2.py3\xdeJ\x88\x00\x00\x00\x00\x00\x90\x00\x01'
|
|
9
|
-
b'\x03\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'),
|
|
10
|
-
Kevent(timestamp=0x3eb13318ff38b, data=b'ework_BusinessChat-7.0.1-py2.py3',
|
|
11
|
-
values=(0x75425f6b726f7765, 0x68437373656e6973, 0x312e302e372d7461, 0x3379702e3279702d),
|
|
12
|
-
tid=8932062, debugid=50397328, eventid=50397328, func_qualifier=0)
|
|
13
|
-
),
|
|
14
|
-
(
|
|
15
|
-
b'\x00' * 64,
|
|
16
|
-
Kevent(timestamp=0, data=b'\x00' * 32, values=(0, 0, 0, 0), tid=0, debugid=0, eventid=0, func_qualifier=0)
|
|
17
|
-
),
|
|
18
|
-
(
|
|
19
|
-
b'\xff' * 64,
|
|
20
|
-
Kevent(timestamp=0xffffffffffffffff, data=b'\xff' * 32,
|
|
21
|
-
values=(0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff),
|
|
22
|
-
tid=0xffffffffffffffff, debugid=0xffffffff, eventid=0xfffffffc, func_qualifier=0x00000003)
|
|
23
|
-
)
|
|
24
|
-
])
|
|
25
|
-
def test_from_kd_buf(raw, parsed):
|
|
26
|
-
assert from_kd_buf(raw) == parsed
|
tests/test_os_log_event.py
DELETED
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
from datetime import datetime, timezone
|
|
2
|
-
|
|
3
|
-
from pykdebugparser.os_log_event import OsLogEvent, OsLogType, FirehoseTracepointNamespace, FirehoseTracepointLogType, \
|
|
4
|
-
FirehoseTracepointFlagsPcStyle, FirehoseTracepointLogFlags
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
def test_parsing_raw_log_event():
|
|
8
|
-
raw_event = {
|
|
9
|
-
'p': 1101,
|
|
10
|
-
'utz': {
|
|
11
|
-
'mw': 480,
|
|
12
|
-
'dt': 1
|
|
13
|
-
},
|
|
14
|
-
'sub': 11,
|
|
15
|
-
'tid': 2263,
|
|
16
|
-
'ns': 59245485166,
|
|
17
|
-
'dm': {
|
|
18
|
-
's': 0,
|
|
19
|
-
'seg': [
|
|
20
|
-
{
|
|
21
|
-
'lp': 2013,
|
|
22
|
-
'p': {
|
|
23
|
-
'rs': 2014,
|
|
24
|
-
'w': 0,
|
|
25
|
-
'p': 0,
|
|
26
|
-
't': [
|
|
27
|
-
33
|
|
28
|
-
]
|
|
29
|
-
},
|
|
30
|
-
'a': {
|
|
31
|
-
'p': 1,
|
|
32
|
-
'c': 2,
|
|
33
|
-
'or': 164
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
'lp': 2056,
|
|
38
|
-
'p': {
|
|
39
|
-
'rs': 2057,
|
|
40
|
-
'w': 0,
|
|
41
|
-
'p': 72,
|
|
42
|
-
'ty': 2059,
|
|
43
|
-
'tn': 2018,
|
|
44
|
-
't': [
|
|
45
|
-
33,
|
|
46
|
-
2058
|
|
47
|
-
]
|
|
48
|
-
},
|
|
49
|
-
'a': {
|
|
50
|
-
'p': 1,
|
|
51
|
-
'c': 3,
|
|
52
|
-
'or': (b'\\x02\\x01\\x01\\x00I\\x01\\x00\\x00\\xea2\\x00\\x00\\x00\\x00\\x00\\x00\\xb8\\x08'
|
|
53
|
-
b'\\r\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00'
|
|
54
|
-
b'\\x00\\x00\\x00\\x00\\x00P6\\x18\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'
|
|
55
|
-
b'\\x00\\x00\\x0086\\x18\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'
|
|
56
|
-
b'\\x00')
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
],
|
|
60
|
-
'pc': 2
|
|
61
|
-
},
|
|
62
|
-
'sip': 1100,
|
|
63
|
-
'mct': 1421891644,
|
|
64
|
-
's': 105,
|
|
65
|
-
'siu': b'\\xc4\\x9e\\x0c:\\xa9\\xc3:\\xb9\\x95\\xc4$b\\x80\\xf9#M',
|
|
66
|
-
'f': 2055,
|
|
67
|
-
't': 1024,
|
|
68
|
-
'pip': 1100,
|
|
69
|
-
'lt': 1,
|
|
70
|
-
'piu': b'\\xc4\\x9e\\x0c:\\xa9\\xc3:\\xb9\\x95\\xc4$b\\x80\\xf9#M',
|
|
71
|
-
'cm': 2053,
|
|
72
|
-
'ud': {
|
|
73
|
-
'sec': 1633872873,
|
|
74
|
-
'usec': 810447
|
|
75
|
-
},
|
|
76
|
-
'send': 1101,
|
|
77
|
-
'cat': 2054,
|
|
78
|
-
'pid': 70,
|
|
79
|
-
'sio': 11269856,
|
|
80
|
-
'ti': 101451216374071556,
|
|
81
|
-
'b': b'l\\x87\\xdc\\xbf\\x06\\x01C[\\xbf\\x87\\xcc\\xf4\\xce\\x98\\x16 '
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
log_strings = {
|
|
85
|
-
2053: '{\"msg\":\"received AOP log\", \"log\":{\"flags\":1,\"seq\":329,\"data\":[13034]}}',
|
|
86
|
-
1100: '/usr/libexec/locationd',
|
|
87
|
-
1101: 'locationd',
|
|
88
|
-
1024: '/usr/sbin/bluetoothd',
|
|
89
|
-
105: '%25s:%-5d %s: mActiveHighPriorityClientCount: %u, mActiveMediumPriorityClientCount: %u',
|
|
90
|
-
11: 'com.apple.locationd.Motion',
|
|
91
|
-
2054: 'AOP',
|
|
92
|
-
2055: '{\"msg%{public}.0s\":\"received AOP log\", \"log\":%{public, location:CMMotionCoprocessorReply_Log}.*P}',
|
|
93
|
-
2013: '{\"msg',
|
|
94
|
-
2014: '%{public}.0s',
|
|
95
|
-
33: 'public',
|
|
96
|
-
164: '',
|
|
97
|
-
2056: '\":\"received AOP log\", \"log\":',
|
|
98
|
-
2057: '%{public, location:CMMotionCoprocessorReply_Log}.*P',
|
|
99
|
-
2058: 'location:CMMotionCoprocessorReply_Log',
|
|
100
|
-
2018: 'location',
|
|
101
|
-
2059: 'CMMotionCoprocessorReply_Log',
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
parsed_event = OsLogEvent.from_raw_log_event(raw_event, log_strings)
|
|
105
|
-
assert parsed_event.process == 'locationd'
|
|
106
|
-
assert parsed_event.unix_timezone == {'minutes_west': 480, 'dst_time': 1}
|
|
107
|
-
assert parsed_event.subsystem == 'com.apple.locationd.Motion'
|
|
108
|
-
assert parsed_event.thread_identifier == 2263
|
|
109
|
-
assert parsed_event.continuous_nanoseconds_since_boot == 59245485166
|
|
110
|
-
|
|
111
|
-
assert parsed_event.sender_image_path == '/usr/libexec/locationd'
|
|
112
|
-
assert parsed_event.mach_continuous_timestamp == 1421891644
|
|
113
|
-
assert parsed_event.size == 105
|
|
114
|
-
assert parsed_event.sender_image_uuid == b'\\xc4\\x9e\\x0c:\\xa9\\xc3:\\xb9\\x95\\xc4$b\\x80\\xf9#M'
|
|
115
|
-
assert parsed_event.format_string == ('{"msg%{public}.0s":"received AOP log", "log":%'
|
|
116
|
-
'{public, location:CMMotionCoprocessorReply_Log}.*P}')
|
|
117
|
-
assert parsed_event.type_ == 1024
|
|
118
|
-
assert parsed_event.process_image_path == '/usr/libexec/locationd'
|
|
119
|
-
assert parsed_event.log_type == OsLogType.INFO
|
|
120
|
-
assert parsed_event.process_image_uuid == b'\\xc4\\x9e\\x0c:\\xa9\\xc3:\\xb9\\x95\\xc4$b\\x80\\xf9#M'
|
|
121
|
-
assert parsed_event.composed_message == '{"msg":"received AOP log", "log":{"flags":1,"seq":329,"data":[13034]}}'
|
|
122
|
-
assert parsed_event.unix_date == datetime(2021, 10, 10, 13, 34, 33, 810447, tzinfo=timezone.utc)
|
|
123
|
-
assert parsed_event.sender == 'locationd'
|
|
124
|
-
assert parsed_event.category == 'AOP'
|
|
125
|
-
assert parsed_event.process_identifier == 70
|
|
126
|
-
assert parsed_event.sender_image_offset == 11269856
|
|
127
|
-
assert parsed_event.trace_identifier.namespace == FirehoseTracepointNamespace.log
|
|
128
|
-
assert parsed_event.trace_identifier.type_ == FirehoseTracepointLogType.info
|
|
129
|
-
assert not parsed_event.trace_identifier.has_large_offset
|
|
130
|
-
assert not parsed_event.trace_identifier.has_unique_pid
|
|
131
|
-
assert parsed_event.trace_identifier.pc_style == FirehoseTracepointFlagsPcStyle.main_exe
|
|
132
|
-
assert not parsed_event.trace_identifier.has_current_aid
|
|
133
|
-
assert parsed_event.trace_identifier.flags == FirehoseTracepointLogFlags.has_subsystem
|
|
134
|
-
assert parsed_event.boot_uuid == b'l\\x87\\xdc\\xbf\\x06\\x01C[\\xbf\\x87\\xcc\\xf4\\xce\\x98\\x16 '
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
def test_parsing_event_with_backtrace():
|
|
138
|
-
raw_event = {
|
|
139
|
-
'p': 191,
|
|
140
|
-
'utz': {'mw': 480, 'dt': 1},
|
|
141
|
-
'sub': 192,
|
|
142
|
-
'tid': 1117540,
|
|
143
|
-
'ns': 589505000739000,
|
|
144
|
-
'bt': [
|
|
145
|
-
{'iu': b'\x94\x82\x8e\xdd`p1<\x93\x1d\xab\xa0\x18\xf0f\\', 'io': 1264156},
|
|
146
|
-
{'iu': b'\x94\x82\x8e\xdd`p1<\x93\x1d\xab\xa0\x18\xf0f\\', 'io': 46724},
|
|
147
|
-
{'iu': b'\x94\x82\x8e\xdd`p1<\x93\x1d\xab\xa0\x18\xf0f\\', 'io': 29436},
|
|
148
|
-
{'iu': b'\x94\x82\x8e\xdd`p1<\x93\x1d\xab\xa0\x18\xf0f\\', 'io': 29160},
|
|
149
|
-
{'iu': b'\x94\x82\x8e\xdd`p1<\x93\x1d\xab\xa0\x18\xf0f\\', 'io': 1082752},
|
|
150
|
-
{'iu': b'\x94\x82\x8e\xdd`p1<\x93\x1d\xab\xa0\x18\xf0f\\', 'io': 1082296},
|
|
151
|
-
{'iu': b'\x94\x82\x8e\xdd`p1<\x93\x1d\xab\xa0\x18\xf0f\\', 'io': 1081596},
|
|
152
|
-
{'iu': b'\xe8\xa6\x00Q\x0ch5\xae\xae\xfd\x9d\x97\xcc\x7f&\x96', 'io': 66784},
|
|
153
|
-
{'iu': b'\xe8\xa6\x00Q\x0ch5\xae\xae\xfd\x9d\x97\xcc\x7f&\x96', 'io': 67844},
|
|
154
|
-
{'iu': b'\x95\x9c\xd6\xe4\x0c\xe70"\xb7<\x8b6\xf7\x9fGE', 'io': 14864},
|
|
155
|
-
{'iu': b'\x95\x9c\xd6\xe4\x0c\xe70"\xb7<\x8b6\xf7\x9fGE', 'io': 129188},
|
|
156
|
-
{'iu': b'\x95\x9c\xd6\xe4\x0c\xe70"\xb7<\x8b6\xf7\x9fGE', 'io': 44932},
|
|
157
|
-
{'iu': b'\x95\x9c\xd6\xe4\x0c\xe70"\xb7<\x8b6\xf7\x9fGE', 'io': 132596},
|
|
158
|
-
{'iu': b'\x95\x9c\xd6\xe4\x0c\xe70"\xb7<\x8b6\xf7\x9fGE', 'io': 44932},
|
|
159
|
-
{'iu': b'\x95\x9c\xd6\xe4\x0c\xe70"\xb7<\x8b6\xf7\x9fGE', 'io': 48144},
|
|
160
|
-
{'iu': b'\x95\x9c\xd6\xe4\x0c\xe70"\xb7<\x8b6\xf7\x9fGE', 'io': 90904},
|
|
161
|
-
{'iu': b'\xbc\x1c\xe0\xc6\xa9\xf29k\x9a\xfbb=:\xcdX\x81', 'io': 4528},
|
|
162
|
-
{'iu': b'\xbc\x1c\xe0\xc6\xa9\xf29k\x9a\xfbb=:\xcdX\x81', 'io': 3920}
|
|
163
|
-
],
|
|
164
|
-
'sip': 190,
|
|
165
|
-
'mct': 14148120017736,
|
|
166
|
-
'dm': {
|
|
167
|
-
's': 0,
|
|
168
|
-
'seg': [
|
|
169
|
-
{'p': {'rs': 100, 'w': 0, 'p': 0}, 'a': {'p': 1, 'c': 2, 'or': 11448}},
|
|
170
|
-
{'lp': 11449, 'p': {'rs': 196, 'w': 0, 'p': 0, 't': [17]}, 'a': {'p': 1, 'c': 2, 'or': 498}}
|
|
171
|
-
],
|
|
172
|
-
'pc': 2
|
|
173
|
-
},
|
|
174
|
-
's': 270,
|
|
175
|
-
'siu': b'\x94\x82\x8e\xdd`p1<\x93\x1d\xab\xa0\x18\xf0f\\',
|
|
176
|
-
'f': 11447,
|
|
177
|
-
't': 1024,
|
|
178
|
-
'ttl': 14,
|
|
179
|
-
'aid': 442,
|
|
180
|
-
'pip': 190,
|
|
181
|
-
'lt': 17,
|
|
182
|
-
'piu': b'\x94\x82\x8e\xdd`p1<\x93\x1d\xab\xa0\x18\xf0f\\',
|
|
183
|
-
'cm': 11446,
|
|
184
|
-
'ud': {'sec': 1634714583, 'usec': 341124},
|
|
185
|
-
'send': 191,
|
|
186
|
-
'cat': 126,
|
|
187
|
-
'pid': 118,
|
|
188
|
-
'sio': 1264156,
|
|
189
|
-
'ti': 7433102699991300,
|
|
190
|
-
'b': b'\x08\xcc\xed\xc6g\xb8O\xe9\xa4\xf0\xa8d\xa0\xba^\x1e'
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
log_strings = {
|
|
194
|
-
191: 'corespeechd',
|
|
195
|
-
11446: ('-[CSFallbackAudioSessionReleaseProvider '
|
|
196
|
-
'fallbackDeactivateAudioSession:error:] Cannot deactivateAudioSession with (null)'),
|
|
197
|
-
190: '/System/Library/PrivateFrameworks/CoreSpeech.framework/corespeechd',
|
|
198
|
-
192: 'com.apple.corespeech',
|
|
199
|
-
126: 'Framework',
|
|
200
|
-
11447: '%s Cannot deactivateAudioSession with %{public}@',
|
|
201
|
-
100: '%s',
|
|
202
|
-
11448: '-[CSFallbackAudioSessionReleaseProvider fallbackDeactivateAudioSession:error:]',
|
|
203
|
-
11449: ' Cannot deactivateAudioSession with',
|
|
204
|
-
196: '%{public}@',
|
|
205
|
-
17: 'public',
|
|
206
|
-
498: '',
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
parsed_event = OsLogEvent.from_raw_log_event(raw_event, log_strings)
|
|
210
|
-
|
|
211
|
-
assert parsed_event.process == 'corespeechd'
|
|
212
|
-
assert parsed_event.unix_timezone == {'dst_time': 1, 'minutes_west': 480}
|
|
213
|
-
assert parsed_event.subsystem == 'com.apple.corespeech'
|
|
214
|
-
assert parsed_event.thread_identifier == 1117540
|
|
215
|
-
assert parsed_event.continuous_nanoseconds_since_boot == 589505000739000
|
|
216
|
-
assert parsed_event.backtrace == [
|
|
217
|
-
{'image_uuid': b'\x94\x82\x8e\xdd`p1<\x93\x1d\xab\xa0\x18\xf0f\\', 'image_offset': 1264156},
|
|
218
|
-
{'image_uuid': b'\x94\x82\x8e\xdd`p1<\x93\x1d\xab\xa0\x18\xf0f\\', 'image_offset': 46724},
|
|
219
|
-
{'image_uuid': b'\x94\x82\x8e\xdd`p1<\x93\x1d\xab\xa0\x18\xf0f\\', 'image_offset': 29436},
|
|
220
|
-
{'image_uuid': b'\x94\x82\x8e\xdd`p1<\x93\x1d\xab\xa0\x18\xf0f\\', 'image_offset': 29160},
|
|
221
|
-
{'image_uuid': b'\x94\x82\x8e\xdd`p1<\x93\x1d\xab\xa0\x18\xf0f\\', 'image_offset': 1082752},
|
|
222
|
-
{'image_uuid': b'\x94\x82\x8e\xdd`p1<\x93\x1d\xab\xa0\x18\xf0f\\', 'image_offset': 1082296},
|
|
223
|
-
{'image_uuid': b'\x94\x82\x8e\xdd`p1<\x93\x1d\xab\xa0\x18\xf0f\\', 'image_offset': 1081596},
|
|
224
|
-
{'image_uuid': b'\xe8\xa6\x00Q\x0ch5\xae\xae\xfd\x9d\x97\xcc\x7f&\x96', 'image_offset': 66784},
|
|
225
|
-
{'image_uuid': b'\xe8\xa6\x00Q\x0ch5\xae\xae\xfd\x9d\x97\xcc\x7f&\x96', 'image_offset': 67844},
|
|
226
|
-
{'image_uuid': b'\x95\x9c\xd6\xe4\x0c\xe70"\xb7<\x8b6\xf7\x9fGE', 'image_offset': 14864},
|
|
227
|
-
{'image_uuid': b'\x95\x9c\xd6\xe4\x0c\xe70"\xb7<\x8b6\xf7\x9fGE', 'image_offset': 129188},
|
|
228
|
-
{'image_uuid': b'\x95\x9c\xd6\xe4\x0c\xe70"\xb7<\x8b6\xf7\x9fGE', 'image_offset': 44932},
|
|
229
|
-
{'image_uuid': b'\x95\x9c\xd6\xe4\x0c\xe70"\xb7<\x8b6\xf7\x9fGE', 'image_offset': 132596},
|
|
230
|
-
{'image_uuid': b'\x95\x9c\xd6\xe4\x0c\xe70"\xb7<\x8b6\xf7\x9fGE', 'image_offset': 44932},
|
|
231
|
-
{'image_uuid': b'\x95\x9c\xd6\xe4\x0c\xe70"\xb7<\x8b6\xf7\x9fGE', 'image_offset': 48144},
|
|
232
|
-
{'image_uuid': b'\x95\x9c\xd6\xe4\x0c\xe70"\xb7<\x8b6\xf7\x9fGE', 'image_offset': 90904},
|
|
233
|
-
{'image_uuid': b'\xbc\x1c\xe0\xc6\xa9\xf29k\x9a\xfbb=:\xcdX\x81', 'image_offset': 4528},
|
|
234
|
-
{'image_uuid': b'\xbc\x1c\xe0\xc6\xa9\xf29k\x9a\xfbb=:\xcdX\x81', 'image_offset': 3920},
|
|
235
|
-
]
|
|
236
|
-
assert parsed_event.sender_image_path == '/System/Library/PrivateFrameworks/CoreSpeech.framework/corespeechd'
|
|
237
|
-
assert parsed_event.mach_continuous_timestamp == 14148120017736
|
|
238
|
-
assert parsed_event.size == 270
|
|
239
|
-
assert parsed_event.sender_image_uuid == b'\x94\x82\x8e\xdd`p1<\x93\x1d\xab\xa0\x18\xf0f\\'
|
|
240
|
-
assert parsed_event.format_string == '%s Cannot deactivateAudioSession with %{public}@'
|
|
241
|
-
assert parsed_event.type_ == 1024
|
|
242
|
-
assert parsed_event.time_to_live == 14
|
|
243
|
-
assert parsed_event.activity_identifier == 442
|
|
244
|
-
assert parsed_event.process_image_path == '/System/Library/PrivateFrameworks/CoreSpeech.framework/corespeechd'
|
|
245
|
-
assert parsed_event.log_type == OsLogType.FAULT
|
|
246
|
-
assert parsed_event.process_image_uuid == b'\x94\x82\x8e\xdd`p1<\x93\x1d\xab\xa0\x18\xf0f\\'
|
|
247
|
-
assert parsed_event.composed_message == (
|
|
248
|
-
'-[CSFallbackAudioSessionReleaseProvider fallbackDeactivateAudioSession:'
|
|
249
|
-
'error:] Cannot deactivateAudioSession with (null)'
|
|
250
|
-
)
|
|
251
|
-
assert parsed_event.unix_date == datetime(2021, 10, 20, 7, 23, 3, 341124, tzinfo=timezone.utc)
|
|
252
|
-
assert parsed_event.sender == 'corespeechd'
|
|
253
|
-
assert parsed_event.category == 'Framework'
|
|
254
|
-
assert parsed_event.process_identifier == 118
|
|
255
|
-
assert parsed_event.sender_image_offset == 1264156
|
|
256
|
-
assert parsed_event.trace_identifier.namespace == FirehoseTracepointNamespace.log
|
|
257
|
-
assert parsed_event.trace_identifier.type_ == FirehoseTracepointLogType.fault
|
|
258
|
-
assert not parsed_event.trace_identifier.has_large_offset
|
|
259
|
-
assert not parsed_event.trace_identifier.has_unique_pid
|
|
260
|
-
assert parsed_event.trace_identifier.has_current_aid
|
|
261
|
-
assert parsed_event.trace_identifier.pc_style == FirehoseTracepointFlagsPcStyle.main_exe
|
|
262
|
-
assert parsed_event.trace_identifier.flags == (
|
|
263
|
-
FirehoseTracepointLogFlags.has_context_data |
|
|
264
|
-
FirehoseTracepointLogFlags.has_rules | FirehoseTracepointLogFlags.has_subsystem
|
|
265
|
-
)
|
|
266
|
-
assert parsed_event.trace_identifier.code == 1730654
|
|
267
|
-
assert parsed_event.boot_uuid == b'\x08\xcc\xed\xc6g\xb8O\xe9\xa4\xf0\xa8d\xa0\xba^\x1e'
|
tests/test_pykdebugparser.py
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
from io import BytesIO
|
|
2
|
-
|
|
3
|
-
from pykdebugparser.kd_buf_parser import RAW_VERSION2_BYTES
|
|
4
|
-
from pykdebugparser.kevent import Kevent
|
|
5
|
-
from pykdebugparser.pykdebugparser import PyKdebugParser
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def test_kevents():
|
|
9
|
-
events_buf = RAW_VERSION2_BYTES + b'\x00' * 0x11c
|
|
10
|
-
events_buf += (b'\xa50\x147_\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
|
11
|
-
b'\x00\x00\x00\x00\x00\x00\x00\x00\xc6\x01\x00\x00\x00\x00\x00\x00y\xd8\t\x00\x00\x00\x00'
|
|
12
|
-
b'\x00*\x03\x0c\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
|
|
13
|
-
parser = PyKdebugParser()
|
|
14
|
-
events = list(parser.kevents(BytesIO(events_buf)))
|
|
15
|
-
assert events == [
|
|
16
|
-
Kevent(timestamp=7006015729829,
|
|
17
|
-
data=(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
|
18
|
-
b'\x00\x00\x00\x00\xc6\x01\x00\x00\x00\x00\x00\x00'),
|
|
19
|
-
values=(0, 0, 0, 454), tid=645241, debugid=67896106, eventid=67896104, func_qualifier=2)
|
|
20
|
-
]
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def test_kevents_filter_tid():
|
|
24
|
-
events_buf = RAW_VERSION2_BYTES + b'\x00' * 0x11c
|
|
25
|
-
events_buf += (b'\xa50\x147_\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
|
26
|
-
b'\x00\x00\x00\x00\x00\x00\x00\x00\xc6\x01\x00\x00\x00\x00\x00\x00y\xd8\t\x00\x00\x00\x00'
|
|
27
|
-
b'\x00*\x03\x0c\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
|
|
28
|
-
parser = PyKdebugParser()
|
|
29
|
-
parser.filter_tid = 645241
|
|
30
|
-
events = list(parser.kevents(BytesIO(events_buf)))
|
|
31
|
-
assert events == [
|
|
32
|
-
Kevent(timestamp=7006015729829,
|
|
33
|
-
data=(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
|
34
|
-
b'\x00\x00\x00\x00\xc6\x01\x00\x00\x00\x00\x00\x00'),
|
|
35
|
-
values=(0, 0, 0, 454), tid=645241, debugid=67896106, eventid=67896104, func_qualifier=2)
|
|
36
|
-
]
|
|
37
|
-
parser.filter_tid = 3
|
|
38
|
-
events = list(parser.kevents(BytesIO(events_buf)))
|
|
39
|
-
assert events == []
|
tests/test_trace_codes.py
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
from pykdebugparser.trace_codes import from_trace_codes_text
|
|
2
|
-
|
|
3
|
-
import pytest
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@pytest.mark.parametrize('text, out', [
|
|
7
|
-
('0x40c0548 BSC_stat64', {0x40c0548: 'BSC_stat64'}),
|
|
8
|
-
(('0x80010068 ASPCORE_PUSH_PAGES '
|
|
9
|
-
'#Params: flow band page size #Matchby: Arg1'), {0x80010068: 'ASPCORE_PUSH_PAGES'}),
|
|
10
|
-
('0x40c0548 BSC_stat64\n0x40c054c BSC_sys_fstat64', {0x40c0548: 'BSC_stat64', 0x40c054c: 'BSC_sys_fstat64'}),
|
|
11
|
-
])
|
|
12
|
-
def test_from_trace_codes_text(text, out):
|
|
13
|
-
assert from_trace_codes_text(text) == out
|
tests/traces/test_bsd.py
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
from pykdebugparser.kevent import Kevent
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def test_read(traces_parser):
|
|
5
|
-
events = [
|
|
6
|
-
Kevent(timestamp=15783429453,
|
|
7
|
-
data=(b'\x07\x00\x00\x00\x00\x00\x00\x00\x00\xc0\xf1\x1b\x01\x00\x00\x00\xd6c'
|
|
8
|
-
b'\x00\x00\x00\x00\x00\x00h\xd8:m\x01\x00\x00\x00'),
|
|
9
|
-
values=(7, 4763795456, 25558, 6127540328), tid=7573, debugid=67895309, eventid=67895308,
|
|
10
|
-
func_qualifier=1),
|
|
11
|
-
Kevent(timestamp=15783456070,
|
|
12
|
-
data=(b'\x00\x00\x00\x00\x00\x00\x00\x00\xd6c\x00\x00\x00\x00\x00\x00\x00\x00'
|
|
13
|
-
b'\x00\x00\x00\x00\x00\x00\x90\x00\x00\x00\x00\x00\x00\x00'),
|
|
14
|
-
values=(0, 25558, 0, 144), tid=7573, debugid=67895310, eventid=67895308, func_qualifier=2)
|
|
15
|
-
]
|
|
16
|
-
ret = list(traces_parser.feed_generator(events))
|
|
17
|
-
assert str(ret[0]) == 'read(7, 0x11bf1c000, 25558), count: 25558'
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def test_csops_audittoken_16(traces_parser):
|
|
21
|
-
events = [
|
|
22
|
-
Kevent(timestamp=1805610285184,
|
|
23
|
-
data=(b'C\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\xa0&\xa1m'
|
|
24
|
-
b'\x01\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00'),
|
|
25
|
-
values=(67, 16, 6134245024, 8), tid=1599, debugid=67895977, eventid=67895976, func_qualifier=1),
|
|
26
|
-
Kevent(timestamp=1805610285735,
|
|
27
|
-
data=(b'"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
|
28
|
-
b'\x00\x00\x00\x00\x00C\x00\x00\x00\x00\x00\x00\x00'),
|
|
29
|
-
values=(34, 0, 0, 67), tid=1599, debugid=67895978, eventid=67895976, func_qualifier=2)
|
|
30
|
-
]
|
|
31
|
-
ret = list(traces_parser.feed_generator(events))
|
|
32
|
-
assert str(ret[0]) == 'csops_audittoken(67, CS_OPS_16, 0x16da126a0, 8), errno: ERANGE(34)'
|