Add wakeup sources to a table Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
diff --git a/src/amd_debug/sleep_report.py b/src/amd_debug/sleep_report.py index 43b73be..d8910e3 100644 --- a/src/amd_debug/sleep_report.py +++ b/src/amd_debug/sleep_report.py
@@ -229,7 +229,12 @@ """Get the prereq data""" prereq = [] prereq_debug = [] - tables = ["int|active", "ACPI name", "PCI Slot", "DMI|value"] + tables = [ + "int|active", + "ACPI name", + "PCI Slot", + "DMI|value", + ] ts = self.db.get_last_prereq_ts() if not ts: return [], "", [] @@ -250,6 +255,7 @@ """Get the cycle data""" cycles = [] debug = [] + tables = ["Wakeup Source"] num = 0 for cycle in self.df["Start Time"]: if self.format == "html": @@ -263,7 +269,12 @@ messages = [] priorities = [] for row in self.db.report_debug(cycle): - messages.append(row[0]) + content = row[0] + if self.format == "html" and [ + table for table in tables if table in content + ]: + content = self.convert_table_dataframe(content) + messages.append(content) priorities.append(get_log_priority(row[1])) debug.append( {"cycle_num": num, "messages": messages, "priorities": priorities}
diff --git a/src/amd_debug/validator.py b/src/amd_debug/validator.py index 2d808c1..81f166b 100644 --- a/src/amd_debug/validator.py +++ b/src/amd_debug/validator.py
@@ -290,13 +290,12 @@ sys_name = pnp.sys_name name = name.replace('"', "") - devices.append(f"{name} [{sys_name}]: {wake_en}") + devices.append(f"{name}|{sys_name}|{wake_en}") devices.sort() - self.db.record_debug("Possible wakeup sources:") + debug_str = "Wakeup Source|Linux Device|Status\n" for dev in devices: - # set prefix if last device - prefix = "│ " if dev != devices[-1] else "└─" - self.db.record_debug(f"{prefix}{dev}") + debug_str += f"{dev}\n" + self.db.record_debug(debug_str) def capture_lid(self) -> None: """Capture lid state"""
diff --git a/src/test_validator.py b/src/test_validator.py index 6236448..4fb588f 100644 --- a/src/test_validator.py +++ b/src/test_validator.py
@@ -158,9 +158,8 @@ self.validator.capture_wake_sources() # Validate debug messages - mock_record_debug.assert_any_call("Possible wakeup sources:") mock_record_debug.assert_any_call( - "└─ [/sys/devices/pci0000:00/0000:00:14.0]: enabled" + "Wakeup Source|Linux Device|Status\n|/sys/devices/pci0000:00/0000:00:14.0|enabled\n" ) # Stop patches