Skip to content

Commit

Permalink
Mask time stamp with timer valid mask
Browse files Browse the repository at this point in the history
  • Loading branch information
julianneswinoga committed Jul 29, 2023
1 parent 715b9d4 commit 03284a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_full_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_demo_trx_files():
'demo_filex.trx': TrxDemoStats(950, 949000, 7, 25),
'demo_netx_tcp.trx': TrxDemoStats(950, 949000, 19, 36),
'demo_netx_udp.trx': TrxDemoStats(950, 949000, 17, 23),
'demo_threadx.trx': TrxDemoStats(974, 156206, 16, 11),
'demo_threadx.trx': TrxDemoStats(974, 65520, 16, 11),
}

for trx_filename, tested_stats in demo_stats.items():
Expand Down
4 changes: 4 additions & 0 deletions tracex_parser/file_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ def get_event_entries(endian_str: str, buf: bytes, start_idx: int, control_heade
event_entry.clear()
object_entry_end_idx = event_entry_start_idx + event_size
event_entry.unpack(buf[event_entry_start_idx:object_entry_end_idx])

# Apply the timer valid mask to the timestamp
event_entry['time_stamp'] = control_header['timer_valid_mask'] & event_entry['time_stamp']

if event_entry['event_id'] != 0:
raw_events.append(copy.deepcopy(event_entry))
event_entry_start_idx += event_size
Expand Down

0 comments on commit 03284a8

Please sign in to comment.