Parser for ThreadX RTOS's trace buffers (aka TraceX)
Project description
TraceX Parser
This python package parses ThreadX trace buffers into both human and machine-readable formats. Don't know where to begin? Check out the quick-start documentation. More documentation about ThreadX trace buffers can be found here.
Install
pip3 install tracex-parser
Example trace buffers
In the repository source there are a couple example TraceX traces which can be used to verify that things are working correctly.
As a python module
>>> from tracex_parser.file_parser import parse_tracex_buffer
>>> events, obj_map = parse_tracex_buffer('./demo_threadx.trx')
>>> events
[4265846278:thread 7 threadResume(thread_ptr=thread 6,prev_state=0xd,stack_ptr=0x12980,next_thread=), 4265846441:thread 7 mtxPut(obj_id=mutex 0,owning_thread=0x6adc,own_cnt=0x1,stack_ptr=0x129a0), 4265846566:thread 7 mtxPut(obj_id=mutex 0,owning_thread=0x6adc,own_cnt=0x2,stack_ptr=0x129a0)]
>>> obj_map[0xeea4]
{'obj_reg_entry_obj_available **': '0x0', 'obj_reg_entry_obj_type **': '0x1', 'thread_reg_entry_obj_ptr': '0xeea4', 'obj_reg_entry_obj_parameter_1': '0xef4c', 'obj_reg_entry_obj_parameter_2': '0x3fc', 'thread_reg_entry_obj_name': b'System Timer Thread'}
As a command line utility
documentation
The file_parser
module can also be run as a script, which will provide simple statistics on the trace as well as dumping all the events in the trace.
It can be run by either:
- Running the module manually:
python3 -m tracex_parser.file_parser
- Using the newly installed command:
parse-trx
Both run methods are identical.
$ parse-trx -vvv ./demo_threadx.trx
Parsing ./demo_threadx.trx
total events: 974
object registry size: 16
delta ticks: 40402
Event Histogram:
queueSend 493
queueReceive 428
threadResume 19
threadSuspend 16
mtxPut 4
isrEnter 3
isrExit 3
semPut 2
semGet 2
mtxGet 2
threadSleep 2
All events:
2100:thread 2 queueReceive(queue_ptr=0x6b84,dst_ptr=0x115a0,timeout=WaitForever,enqueued=0x13)
1939:thread 2 queueReceive(queue_ptr=0x6b84,dst_ptr=0x115a0,timeout=WaitForever,enqueued=0x12)
1778:thread 2 queueReceive(queue_ptr=0x6b84,dst_ptr=0x115a0,timeout=WaitForever,enqueued=0x11)
1617:thread 2 queueReceive(queue_ptr=0x6b84,dst_ptr=0x115a0,timeout=WaitForever,enqueued=0x10)
1456:thread 2 queueReceive(queue_ptr=0x6b84,dst_ptr=0x115a0,timeout=WaitForever,enqueued=0xf)
...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for tracex_parser-2.4.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb1f5fbc0363c0262da21de5486b227451a4b9b012c396edeaa99f13c5aaa0a3 |
|
MD5 | 546926ed4130bea444b5e840fcf003b9 |
|
BLAKE2b-256 | 10ccfd5ce98dc9c7834719835177328c342ad7e1fb5fc9f45ba620b0064f3de5 |