amd-debug-tools 0.2.14__tar.gz → 0.2.15__tar.gz
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.
- {amd_debug_tools-0.2.14/src/amd_debug_tools.egg-info → amd_debug_tools-0.2.15}/PKG-INFO +1 -1
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug/common.py +13 -1
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug/prerequisites.py +5 -2
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug/s2idle.py +12 -6
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15/src/amd_debug_tools.egg-info}/PKG-INFO +1 -1
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/test_s2idle.py +7 -4
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/.github/workflows/ci.yml +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/.github/workflows/mirror.yml +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/.gitignore +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/.pre-commit-config.yaml +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/.vscode/settings.json +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/LICENSE +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/Makefile +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/README.md +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/amd_bios.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/amd_pstate.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/amd_s2idle.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/amd_ttm.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/docs/amd-bios.md +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/docs/amd-pstate.md +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/docs/amd-s2idle.md +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/docs/amd-ttm.md +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/docs/in-tree.md +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/install_deps.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/psr.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/pyproject.toml +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/setup.cfg +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug/__init__.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug/acpi.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug/bash/amd-s2idle +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug/battery.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug/bios.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug/database.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug/display.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug/failures.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug/installer.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug/kernel.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug/pstate.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug/s2idle-hook +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug/sleep_report.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug/templates/html +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug/templates/md +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug/templates/stdout +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug/templates/txt +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug/ttm.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug/validator.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug/wake.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug_tools.egg-info/SOURCES.txt +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug_tools.egg-info/dependency_links.txt +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug_tools.egg-info/entry_points.txt +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug_tools.egg-info/requires.txt +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug_tools.egg-info/top_level.txt +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/launcher.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/test_acpi.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/test_batteries.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/test_bios.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/test_common.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/test_database.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/test_display.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/test_failures.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/test_installer.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/test_kernel.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/test_launcher.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/test_prerequisites.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/test_pstate.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/test_sleep_report.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/test_ttm.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/test_validator.py +0 -0
- {amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/test_wake.py +0 -0
|
@@ -382,7 +382,19 @@ def relaunch_sudo() -> None:
|
|
|
382
382
|
"""Relaunch the script with sudo if not already running as root"""
|
|
383
383
|
if not is_root():
|
|
384
384
|
logging.debug("Relaunching with sudo")
|
|
385
|
-
|
|
385
|
+
env_vars = []
|
|
386
|
+
for var in ["DISPLAY", "WAYLAND_DISPLAY", "XAUTHORITY", "XDG_RUNTIME_DIR",
|
|
387
|
+
"DBUS_SESSION_BUS_ADDRESS", "XDG_SESSION_TYPE"]:
|
|
388
|
+
value = os.environ.get(var)
|
|
389
|
+
if value:
|
|
390
|
+
env_vars.append(f"{var}={value}")
|
|
391
|
+
|
|
392
|
+
if env_vars:
|
|
393
|
+
sudo_cmd = ["sudo"] + [f"--preserve-env={var.split('=')[0]}" for var in env_vars] + sys.argv
|
|
394
|
+
else:
|
|
395
|
+
sudo_cmd = ["sudo"] + sys.argv
|
|
396
|
+
|
|
397
|
+
os.execvp("sudo", sudo_cmd)
|
|
386
398
|
|
|
387
399
|
|
|
388
400
|
def running_ssh():
|
|
@@ -353,8 +353,11 @@ class PrerequisiteValidator(AmdTool):
|
|
|
353
353
|
self.failures += [MissingDriver(slot)]
|
|
354
354
|
return False
|
|
355
355
|
p = os.path.join(device.sys_path, "fw_version")
|
|
356
|
-
|
|
357
|
-
|
|
356
|
+
if os.path.exists(p):
|
|
357
|
+
xdna_fw_version = read_file(p)
|
|
358
|
+
self.db.record_prereq(
|
|
359
|
+
f"NPU loaded with firmware {xdna_fw_version}", "✅"
|
|
360
|
+
)
|
|
358
361
|
return True
|
|
359
362
|
|
|
360
363
|
def check_amd_hsmp(self):
|
|
@@ -60,14 +60,20 @@ def display_report_file(fname, fmt) -> None:
|
|
|
60
60
|
return
|
|
61
61
|
user = os.environ.get("SUDO_USER")
|
|
62
62
|
if user:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
env_vars = []
|
|
64
|
+
for var in ["DISPLAY", "WAYLAND_DISPLAY", "XAUTHORITY", "XDG_RUNTIME_DIR",
|
|
65
|
+
"DBUS_SESSION_BUS_ADDRESS", "XDG_SESSION_TYPE"]:
|
|
66
|
+
value = os.environ.get(var)
|
|
67
|
+
if value:
|
|
68
|
+
env_vars.append(f"{var}={value}")
|
|
69
|
+
|
|
70
|
+
if env_vars:
|
|
71
|
+
cmd = ["sudo", "-u", user] + [f"env"] + env_vars + ["xdg-open", fname]
|
|
72
|
+
subprocess.call(cmd)
|
|
67
73
|
else:
|
|
68
74
|
print(
|
|
69
|
-
"
|
|
70
|
-
|
|
75
|
+
"Unable to detect graphical session environment. "
|
|
76
|
+
"Report saved to: " + fname
|
|
71
77
|
)
|
|
72
78
|
|
|
73
79
|
|
|
@@ -614,10 +614,13 @@ class TestDisplayReportFile(unittest.TestCase):
|
|
|
614
614
|
display_report_file("report.html", "html")
|
|
615
615
|
mock_is_root.assert_called_once()
|
|
616
616
|
mock_env_get.assert_any_call("SUDO_USER")
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
617
|
+
call_args = mock_subprocess_call.call_args[0][0]
|
|
618
|
+
assert call_args[0] == "sudo"
|
|
619
|
+
assert call_args[1] == "-u"
|
|
620
|
+
assert call_args[2] == "testuser"
|
|
621
|
+
assert call_args[3] == "env"
|
|
622
|
+
assert "xdg-open" in call_args
|
|
623
|
+
assert "report.html" in call_args
|
|
621
624
|
|
|
622
625
|
@patch("amd_debug.s2idle.is_root", return_value=True)
|
|
623
626
|
@patch("os.environ.get", side_effect=lambda key: None)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug_tools.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug_tools.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
{amd_debug_tools-0.2.14 → amd_debug_tools-0.2.15}/src/amd_debug_tools.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|