UnifiedLogReader icon indicating copy to clipboard operation
UnifiedLogReader copied to clipboard

Timesync without items causes tracev3 file to fail to parse

Open joachimmetz opened this issue 6 years ago • 5 comments

From https://github.com/ydkhatri/UnifiedLogReader/blob/master/UnifiedLog/Lib.py#L300

           elif item_id == 0x6102: # uuid
                self.system_boot_uuid = UUID(bytes=buffer[pos:pos+16])
                self.boot_uuid_ts_list = GetBootUuidTimeSyncList(self.ts_list, self.system_boot_uuid)
                if not self.boot_uuid_ts_list:
                    raise ValueError('Could not get Timesync for boot uuid! Cannot parse file..')

If self.boot_uuid_ts_list is an empty list the tracev3 file fails to parse.

I've change this to if self.boot_uuid_ts_list is None:, since GetBootUuidTimeSyncList returns None if it cannot find a Timesync corresponding with the boot identifier.

Let me know if this matched the intended behavior

joachimmetz avatar Feb 13 '19 06:02 joachimmetz

Also FindClosestTimesyncItemInList raises IndexError if the Timesync items list is empty.

joachimmetz avatar Feb 13 '19 06:02 joachimmetz

Yes, that should be fine. Without the right timesync entries, we cannot provide a date and time for any log event, so it fails to parse. Perhaps later this can be added as a feature, to parse the log entries but with a blank date/time field.

ydkhatri avatar Feb 13 '19 15:02 ydkhatri

Without the right timesync entries, we cannot provide a date and time for any log event, so it fails to parse.

I've observed valid tracev3 files without corresponding timesync files

Perhaps later this can be added as a feature, to parse the log entries but with a blank date/time field.

there is timebase information in the tracev3 header as well

joachimmetz avatar Jun 22 '23 18:06 joachimmetz

Do you know if this is still an issue?

Schramp avatar Nov 02 '23 14:11 Schramp

Do you know if this is still an issue?

I do not, have not touched this codebase in a while

joachimmetz avatar Nov 02 '23 17:11 joachimmetz