amd-debug-tools 0.2.9__tar.gz → 0.2.10__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.
Files changed (69) hide show
  1. amd_debug_tools-0.2.10/.github/workflows/ci.yml +117 -0
  2. amd_debug_tools-0.2.10/.github/workflows/mirror.yml +24 -0
  3. amd_debug_tools-0.2.10/.gitignore +11 -0
  4. amd_debug_tools-0.2.10/.pre-commit-config.yaml +7 -0
  5. amd_debug_tools-0.2.10/.vscode/settings.json +129 -0
  6. amd_debug_tools-0.2.10/Makefile +9 -0
  7. {amd_debug_tools-0.2.9/src/amd_debug_tools.egg-info → amd_debug_tools-0.2.10}/PKG-INFO +1 -1
  8. amd_debug_tools-0.2.10/amd_pstate.py +34 -0
  9. amd_debug_tools-0.2.10/amd_s2idle.py +34 -0
  10. amd_debug_tools-0.2.10/amd_ttm.py +34 -0
  11. amd_debug_tools-0.2.10/docs/amd-bios.md +26 -0
  12. amd_debug_tools-0.2.10/docs/amd-pstate.md +4 -0
  13. amd_debug_tools-0.2.10/docs/amd-s2idle.md +73 -0
  14. amd_debug_tools-0.2.10/docs/amd-ttm.md +35 -0
  15. amd_debug_tools-0.2.10/docs/in-tree.md +12 -0
  16. amd_debug_tools-0.2.10/install_deps.py +34 -0
  17. amd_debug_tools-0.2.10/psr.py +94 -0
  18. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/pyproject.toml +3 -4
  19. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug/failures.py +9 -0
  20. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug/prerequisites.py +17 -4
  21. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug/s2idle.py +1 -0
  22. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10/src/amd_debug_tools.egg-info}/PKG-INFO +1 -1
  23. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug_tools.egg-info/SOURCES.txt +17 -0
  24. amd_debug_tools-0.2.10/src/launcher.py +34 -0
  25. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/test_acpi.py +1 -1
  26. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/test_kernel.py +4 -4
  27. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/test_prerequisites.py +178 -3
  28. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/test_s2idle.py +10 -1
  29. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/test_validator.py +2 -2
  30. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/LICENSE +0 -0
  31. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/README.md +0 -0
  32. /amd_debug_tools-0.2.9/src/launcher.py → /amd_debug_tools-0.2.10/amd_bios.py +0 -0
  33. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/setup.cfg +0 -0
  34. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug/__init__.py +0 -0
  35. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug/acpi.py +0 -0
  36. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug/bash/amd-s2idle +0 -0
  37. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug/battery.py +0 -0
  38. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug/bios.py +0 -0
  39. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug/common.py +0 -0
  40. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug/database.py +0 -0
  41. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug/display.py +0 -0
  42. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug/installer.py +0 -0
  43. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug/kernel.py +0 -0
  44. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug/pstate.py +0 -0
  45. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug/s2idle-hook +0 -0
  46. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug/sleep_report.py +0 -0
  47. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug/templates/html +0 -0
  48. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug/templates/md +0 -0
  49. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug/templates/stdout +0 -0
  50. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug/templates/txt +0 -0
  51. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug/ttm.py +0 -0
  52. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug/validator.py +0 -0
  53. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug/wake.py +0 -0
  54. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug_tools.egg-info/dependency_links.txt +0 -0
  55. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug_tools.egg-info/entry_points.txt +0 -0
  56. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug_tools.egg-info/requires.txt +0 -0
  57. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/amd_debug_tools.egg-info/top_level.txt +0 -0
  58. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/test_batteries.py +0 -0
  59. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/test_bios.py +0 -0
  60. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/test_common.py +0 -0
  61. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/test_database.py +0 -0
  62. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/test_display.py +0 -0
  63. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/test_failures.py +0 -0
  64. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/test_installer.py +0 -0
  65. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/test_launcher.py +0 -0
  66. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/test_pstate.py +0 -0
  67. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/test_sleep_report.py +0 -0
  68. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/test_ttm.py +0 -0
  69. {amd_debug_tools-0.2.9 → amd_debug_tools-0.2.10}/src/test_wake.py +0 -0
@@ -0,0 +1,117 @@
1
+ name: CI
2
+ on:
3
+ push:
4
+ pull_request:
5
+ workflow_run:
6
+ workflows: ["mirror"]
7
+ types:
8
+ - completed
9
+
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - uses: actions/setup-python@v5
16
+ with:
17
+ python-version: "3.x"
18
+ - name: Build release distributions
19
+ run: |
20
+ python -m pip install build
21
+ python -m build
22
+ - name: Store the distribution packages
23
+ uses: actions/upload-artifact@v4
24
+ with:
25
+ name: python-package-distributions
26
+ path: dist/
27
+
28
+ publish-to-pypi:
29
+ name: >-
30
+ Publish Python 🐍 distribution 📦 to PyPI
31
+ if: startsWith(github.ref, 'refs/tags/')
32
+ needs:
33
+ - build
34
+ runs-on: ubuntu-latest
35
+ environment:
36
+ name: pypi
37
+ url: https://pypi.org/p/amd-debug-tools
38
+ permissions:
39
+ id-token: write
40
+ steps:
41
+ - name: Download all the dists
42
+ uses: actions/download-artifact@v4
43
+ with:
44
+ name: python-package-distributions
45
+ path: dist/
46
+ - name: Publish distribution 📦 to PyPI
47
+ uses: pypa/gh-action-pypi-publish@release/v1
48
+
49
+ github-release:
50
+ name: >-
51
+ Sign the Python 🐍 distribution 📦 with Sigstore
52
+ and upload them to GitHub Release
53
+ needs:
54
+ - publish-to-pypi
55
+ runs-on: ubuntu-latest
56
+
57
+ permissions:
58
+ contents: write # IMPORTANT: mandatory for making GitHub Releases
59
+ id-token: write # IMPORTANT: mandatory for sigstore
60
+
61
+ steps:
62
+ - name: Download all the dists
63
+ uses: actions/download-artifact@v4
64
+ with:
65
+ name: python-package-distributions
66
+ path: dist/
67
+ - name: Sign the dists with Sigstore
68
+ uses: sigstore/gh-action-sigstore-python@v3.0.0
69
+ with:
70
+ inputs: >-
71
+ ./dist/*.tar.gz
72
+ ./dist/*.whl
73
+ - name: Create GitHub Release
74
+ env:
75
+ GITHUB_TOKEN: ${{ github.token }}
76
+ run: >-
77
+ gh release create
78
+ "$GITHUB_REF_NAME"
79
+ --repo "$GITHUB_REPOSITORY"
80
+ --notes ""
81
+ - name: Upload artifact signatures to GitHub Release
82
+ env:
83
+ GITHUB_TOKEN: ${{ github.token }}
84
+ # Upload to GitHub Release using the `gh` CLI.
85
+ # `dist/` contains the built packages, and the
86
+ # sigstore-produced signatures and certificates.
87
+ run: >-
88
+ gh release upload
89
+ "$GITHUB_REF_NAME" dist/**
90
+ --repo "$GITHUB_REPOSITORY"
91
+
92
+ coverage:
93
+ runs-on: ubuntu-latest
94
+ steps:
95
+ - uses: actions/checkout@v4
96
+ - uses: actions/setup-python@v5
97
+ with:
98
+ python-version: "3.x"
99
+ - name: install apt deps
100
+ run: |
101
+ sudo apt install libsystemd-dev -y
102
+ - name: install deps
103
+ run: |
104
+ pip install .
105
+ - name: Generate Report
106
+ run: |
107
+ pip install pytest-cov
108
+ pytest --cov --junitxml=junit.xml
109
+ - name: Upload coverage reports to Codecov
110
+ uses: codecov/codecov-action@v5
111
+ with:
112
+ token: ${{ secrets.CODECOV_TOKEN }}
113
+ - name: Upload test results to Codecov
114
+ if: ${{ !cancelled() }}
115
+ uses: codecov/test-results-action@v1
116
+ with:
117
+ token: ${{ secrets.CODECOV_TOKEN }}
@@ -0,0 +1,24 @@
1
+ name: 'mirror'
2
+ on:
3
+ push:
4
+ branches:
5
+ - __mirror
6
+ schedule:
7
+ # Run everyday at 3 AM UTC
8
+ - cron: '0 3 * * *'
9
+ workflow_dispatch:
10
+
11
+ permissions:
12
+ contents: write
13
+
14
+ jobs:
15
+ mirror:
16
+ runs-on: ubuntu-latest
17
+ name: mirror
18
+ steps:
19
+ - name: mirror
20
+ id: mirror
21
+ uses: bridgelightcloud/github-mirror-action@v3
22
+ with:
23
+ origin: git://git.kernel.org/pub/scm/linux/kernel/git/superm1/amd-debug-tools.git
24
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,11 @@
1
+ /.vscode
2
+ *.txt
3
+ __pycache__
4
+ amd*.egg-info
5
+ build
6
+ dist
7
+ amd*.md
8
+ *.html
9
+ deb_dist/
10
+ *.tar.gz
11
+ .coverage
@@ -0,0 +1,7 @@
1
+ default_stages: [pre-commit]
2
+ repos:
3
+ - repo: https://github.com/ambv/black
4
+ rev: 25.1.0
5
+ hooks:
6
+ - id: black
7
+ exclude_types: [symlink]
@@ -0,0 +1,129 @@
1
+ {
2
+ "cSpell.words": [
3
+ "abled",
4
+ "acpica",
5
+ "alarmtimer",
6
+ "ASIC",
7
+ "aspm",
8
+ "ASPM",
9
+ "asus",
10
+ "ASUS",
11
+ "cmos",
12
+ "CPPC",
13
+ "cpuid",
14
+ "cpuidle",
15
+ "cpus",
16
+ "crashkernel",
17
+ "cryptdevice",
18
+ "cryptkey",
19
+ "cstates",
20
+ "cysystemd",
21
+ "dbus",
22
+ "dmar",
23
+ "dmcub",
24
+ "Dmcub",
25
+ "DMCUB",
26
+ "DMUB",
27
+ "dpia",
28
+ "DPIA",
29
+ "DSDT",
30
+ "earlycon",
31
+ "earlyprintk",
32
+ "edid",
33
+ "edids",
34
+ "ENDC",
35
+ "ertm",
36
+ "evmisc",
37
+ "FACP",
38
+ "geteuid",
39
+ "gobject",
40
+ "gpiolib",
41
+ "gpios",
42
+ "guids",
43
+ "hpet",
44
+ "HPET",
45
+ "hsmp",
46
+ "Hsmp",
47
+ "HSMP",
48
+ "hwirq",
49
+ "hwsleep",
50
+ "Iasl",
51
+ "idlemask",
52
+ "Iommu",
53
+ "irqs",
54
+ "IVRS",
55
+ "kconfig",
56
+ "klass",
57
+ "kmajor",
58
+ "kminor",
59
+ "kwin",
60
+ "levelname",
61
+ "logf",
62
+ "logind",
63
+ "luks",
64
+ "minv",
65
+ "modalias",
66
+ "netdev",
67
+ "netroot",
68
+ "nfsaddrs",
69
+ "nfsroot",
70
+ "noplymouth",
71
+ "notsupported",
72
+ "nowatchdog",
73
+ "ostree",
74
+ "powerprofilesctl",
75
+ "powersave",
76
+ "ppfeaturemask",
77
+ "prefcore",
78
+ "prereq",
79
+ "propf",
80
+ "reques",
81
+ "resumeflags",
82
+ "rhgb",
83
+ "rootflags",
84
+ "rootfstype",
85
+ "roothash",
86
+ "sadm",
87
+ "seeked",
88
+ "showopts",
89
+ "sscanf",
90
+ "SSDT",
91
+ "subleaf",
92
+ "sysfs",
93
+ "tmpd",
94
+ "UBTC",
95
+ "uefi",
96
+ "uevent",
97
+ "Unserviced",
98
+ "usec",
99
+ "userspace",
100
+ "usrflags",
101
+ "usrfstype",
102
+ "virt",
103
+ "wakealarm",
104
+ "xhci",
105
+ "Xhci",
106
+ "zswap"
107
+ ],
108
+ "python.testing.unittestArgs": [
109
+ "-v",
110
+ "-s",
111
+ "./src",
112
+ "-p",
113
+ "test_*.py"
114
+ ],
115
+ "python.testing.pytestEnabled": true,
116
+ "python.testing.unittestEnabled": false,
117
+ "cSpell.ignoreWords": [
118
+ "barplot",
119
+ "intf",
120
+ "line",
121
+ "message",
122
+ "showindex",
123
+ "tablefmt",
124
+ "xlabel",
125
+ "xticks",
126
+ "ylabel",
127
+ "yscale"
128
+ ]
129
+ }
@@ -0,0 +1,9 @@
1
+ build:
2
+ python3 -m build
3
+ check:
4
+ pytest
5
+ coverage:
6
+ coverage run -m unittest
7
+ coverage report
8
+ clean:
9
+ rm -rf build src/*.egg-info build dist amd*.txt amd*md amd*html
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: amd-debug-tools
3
- Version: 0.2.9
3
+ Version: 0.2.10
4
4
  Summary: debug tools for AMD systems
5
5
  Author-email: Mario Limonciello <superm1@kernel.org>
6
6
  License-Expression: MIT
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/python3
2
+ # SPDX-License-Identifier: MIT
3
+ """
4
+ This module is a launcher for the AMD Debug Tools package. It is meant for
5
+ launching various tools within the package without installation.
6
+ """
7
+
8
+ import sys
9
+ import os
10
+
11
+ URL = "git://git.kernel.org/pub/scm/linux/kernel/git/superm1/amd-debug-tools.git"
12
+ try:
13
+ import amd_debug
14
+ from amd_debug.common import fatal_error
15
+ except ModuleNotFoundError:
16
+ sys.exit(
17
+ f"\033[91m{sys.argv[0]} can not be run standalone.\n"
18
+ f"\033[0m\033[94mCheck out the full branch from {URL}\033[0m"
19
+ )
20
+
21
+
22
+ def main():
23
+ """Main function to launch the appropriate tool based on the script name."""
24
+ try:
25
+ return amd_debug.launch_tool(os.path.basename(sys.argv[0]))
26
+ except ModuleNotFoundError as e:
27
+ fatal_error(
28
+ f"Missing dependency: {e}\n"
29
+ f"Run ./install_deps.py to install dependencies."
30
+ )
31
+
32
+
33
+ if __name__ == "__main__":
34
+ sys.exit(main())
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/python3
2
+ # SPDX-License-Identifier: MIT
3
+ """
4
+ This module is a launcher for the AMD Debug Tools package. It is meant for
5
+ launching various tools within the package without installation.
6
+ """
7
+
8
+ import sys
9
+ import os
10
+
11
+ URL = "git://git.kernel.org/pub/scm/linux/kernel/git/superm1/amd-debug-tools.git"
12
+ try:
13
+ import amd_debug
14
+ from amd_debug.common import fatal_error
15
+ except ModuleNotFoundError:
16
+ sys.exit(
17
+ f"\033[91m{sys.argv[0]} can not be run standalone.\n"
18
+ f"\033[0m\033[94mCheck out the full branch from {URL}\033[0m"
19
+ )
20
+
21
+
22
+ def main():
23
+ """Main function to launch the appropriate tool based on the script name."""
24
+ try:
25
+ return amd_debug.launch_tool(os.path.basename(sys.argv[0]))
26
+ except ModuleNotFoundError as e:
27
+ fatal_error(
28
+ f"Missing dependency: {e}\n"
29
+ f"Run ./install_deps.py to install dependencies."
30
+ )
31
+
32
+
33
+ if __name__ == "__main__":
34
+ sys.exit(main())
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/python3
2
+ # SPDX-License-Identifier: MIT
3
+ """
4
+ This module is a launcher for the AMD Debug Tools package. It is meant for
5
+ launching various tools within the package without installation.
6
+ """
7
+
8
+ import sys
9
+ import os
10
+
11
+ URL = "git://git.kernel.org/pub/scm/linux/kernel/git/superm1/amd-debug-tools.git"
12
+ try:
13
+ import amd_debug
14
+ from amd_debug.common import fatal_error
15
+ except ModuleNotFoundError:
16
+ sys.exit(
17
+ f"\033[91m{sys.argv[0]} can not be run standalone.\n"
18
+ f"\033[0m\033[94mCheck out the full branch from {URL}\033[0m"
19
+ )
20
+
21
+
22
+ def main():
23
+ """Main function to launch the appropriate tool based on the script name."""
24
+ try:
25
+ return amd_debug.launch_tool(os.path.basename(sys.argv[0]))
26
+ except ModuleNotFoundError as e:
27
+ fatal_error(
28
+ f"Missing dependency: {e}\n"
29
+ f"Run ./install_deps.py to install dependencies."
30
+ )
31
+
32
+
33
+ if __name__ == "__main__":
34
+ sys.exit(main())
@@ -0,0 +1,26 @@
1
+ # BIOS log parser
2
+ `amd-bios` is a a tool that can be used to enable or disable BIOS AML debug logging
3
+ -and to parse a kernel log that contains BIOS logs.
4
+
5
+ ## `amd-bios trace`
6
+ Modify BIOS AML trace debug logging.
7
+
8
+ One of the following arguments must be set for this command:
9
+
10
+ --enable Enable BIOS AML tracing
11
+ --disable Disable BIOS AML tracing
12
+
13
+ The following optional arguments are supported for this command:
14
+
15
+ --tool-debug Enable tool debug logging
16
+
17
+ ## `amd-bios parse`
18
+ Parses a kernel log that contains BIOS AML debug logging and produces a report.
19
+
20
+ The following optional arguments are supported for this command:
21
+
22
+ --input INPUT Optional input file to parse
23
+ --tool-debug Enable tool debug logging
24
+
25
+ ## `amd-bios --version`
26
+ This will print the version of the tool and exit.
@@ -0,0 +1,4 @@
1
+ # AMD P-State issue triage tool
2
+ `amd-pstate` is a tool used for identification of issues with amd-pstate.
3
+ It will capture some state from the system as well as from the machine specific registers that
4
+ amd-pstate uses.
@@ -0,0 +1,73 @@
1
+ # s2idle debugging tool
2
+
3
+ `amd-s2idle` is a tool used for analyzing the entry and exit of the s2idle
4
+ state of a Linux system.
5
+
6
+ It is intended to use with Linux kernel 6.1 or later and works by hooking
7
+ into dynamic debugging messages and events that are generated by the kernel.
8
+
9
+ For analysis of power consumption issues it can be hooked into `systemd` to
10
+ run a command to capture data right before and after the system enters and
11
+ exits the s2idle state.
12
+
13
+ 4 high level commands are supported.
14
+
15
+ ## `amd-s2idle install`
16
+ This will install the systemd hook so that data will be captured before and
17
+ after the system enters and exits the s2idle state.
18
+
19
+ This will also install a bash completion script that can be used for other
20
+ commands.
21
+
22
+ **NOTE:** This command is only supported when run from a venv.
23
+
24
+ ## `amd-s2idle uninstall`
25
+ This will uninstall the systemd hook and remove the bash completion script.
26
+
27
+ **NOTE:** This command is only supported when run from a venv.
28
+
29
+ ## `amd-s2idle test`
30
+ This will run a suspend cycle with a timer based wakeup and capture relevant
31
+ data into a database and produce a report. This can also be used to run multiple cycles.
32
+
33
+ The following optional arguments are supported for this command:
34
+
35
+ --count COUNT Number of cycles to run
36
+ --duration DURATION Duration of the cycle in seconds
37
+ --wait WAIT Time to wait before starting the cycle in seconds
38
+ --format FORMAT Format of the report to produce (html, txt or md)
39
+ --report-file File to write the report to
40
+ --force Run a test cycle even if the system fails to pass prerequisite checks
41
+ --random Run sleep cycles for random durations and waits, using the --duration and --wait arguments as an upper bound
42
+ --logind Use logind to suspend the system
43
+ --tool-debug Enable debug logging
44
+ --bios-debug Enable BIOS debug logging instead of notify logging
45
+
46
+ If the tool is launched with an environment that can call `xdg-open`, the report
47
+ will be opened in a browser.
48
+
49
+ ## `amd-s2idle report`
50
+ This will produce a report from the data captured by the `test` command
51
+ and/or from the systemd hook. The report will default to 60 days of data.
52
+
53
+ The following optional arguments are supported for this command:
54
+
55
+ --since SINCE Date to start the report from
56
+ --until UNTIL Date to end the report at
57
+ --format FORMAT Format of the report to produce (html, txt or md)
58
+ --report-file File to write the report to
59
+ --tool-debug Enable tool debug logging
60
+ --report-debug
61
+ --no-report-debug
62
+ Include debug messages in report (WARNING: can significantly increase report size)
63
+ If the tool is launched with an environment that can call `xdg-open`, the report
64
+ will be opened in a browser.
65
+
66
+ ## `amd-s2idle --version`
67
+ This will print the version of the tool and exit.
68
+
69
+ ## Debug output
70
+ All commands support the `--tool-debug` argument which will enable extra debug output. This is often needed for debugging issues with a particular cycle.
71
+
72
+ **NOTE:** enabling debug output significantly increases the size of the report.
73
+ It's suggested that you use `--since` and `--until` to focus on the cycles that you are interested in.
@@ -0,0 +1,35 @@
1
+ # Translation Table Manager (TTM) page setting tool
2
+ `amd-ttm` is a tool used for managing the TTM memory settings on AMD systems.
3
+ It manipulates the amount of memory allocated for the TTM. This amount can be increased or decreased by changing the kernel’s Translation Table Manager (TTM) page setting available at `/sys/module/ttm/parameters/pages_limit`.
4
+
5
+ ## Querying current TTM settings
6
+ Running the tool with no arguments will display the current TTM settings.
7
+
8
+ ```
9
+ ❯ amd-ttm
10
+ 💻 Current TTM pages limit: 16469033 pages (62.82 GB)
11
+ 💻 Total system memory: 125.65 GB
12
+ ```
13
+
14
+ ## Setting new TTM value
15
+ Setting a new TTM page size is done by using the `--set` argument with the new limit (in GB).
16
+ The system must be rebooted for it to take effect and you will be prompted to do this automatically.
17
+
18
+ ```
19
+ ❯ amd-ttm --set 100
20
+ 🐧 Successfully set TTM pages limit to 26214400 pages (100.00 GB)
21
+ 🐧 Configuration written to /etc/modprobe.d/ttm.conf
22
+ ○ NOTE: You need to reboot for changes to take effect.
23
+ Would you like to reboot the system now? (y/n): y
24
+ ```
25
+
26
+ ## Clearing the TTM value
27
+ To revert back to the kernel defaults, run the tool with the `--clear` argument.
28
+ The system must be rebooted for it to take effect and you will be prompted to do this automatically.
29
+ The kernel default (at the time of writing) is system memory / 2.
30
+
31
+ ```
32
+ ❯ amd-ttm --clear
33
+ 🐧 Configuration /etc/modprobe.d/ttm.conf removed
34
+ Would you like to reboot the system now? (y/n): y
35
+ ```
@@ -0,0 +1,12 @@
1
+ # Running in-tree
2
+ If you want to run the tools in tree, you need to make sure that distro dependencies
3
+ that would normally install into a venv are installed. This can be done by running:
4
+
5
+ ./install_deps.py
6
+
7
+ After dependencies are installed, you can run the tools by running:
8
+
9
+ ./amd_s2idle.py
10
+ ./amd_bios.py
11
+ ./amd_pstate.py
12
+ ./amd_ttm.py
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/python3
2
+ # SPDX-License-Identifier: MIT
3
+ """
4
+ This module is a launcher for the AMD Debug Tools package. It is meant for
5
+ launching various tools within the package without installation.
6
+ """
7
+
8
+ import sys
9
+ import os
10
+
11
+ URL = "git://git.kernel.org/pub/scm/linux/kernel/git/superm1/amd-debug-tools.git"
12
+ try:
13
+ import amd_debug
14
+ from amd_debug.common import fatal_error
15
+ except ModuleNotFoundError:
16
+ sys.exit(
17
+ f"\033[91m{sys.argv[0]} can not be run standalone.\n"
18
+ f"\033[0m\033[94mCheck out the full branch from {URL}\033[0m"
19
+ )
20
+
21
+
22
+ def main():
23
+ """Main function to launch the appropriate tool based on the script name."""
24
+ try:
25
+ return amd_debug.launch_tool(os.path.basename(sys.argv[0]))
26
+ except ModuleNotFoundError as e:
27
+ fatal_error(
28
+ f"Missing dependency: {e}\n"
29
+ f"Run ./install_deps.py to install dependencies."
30
+ )
31
+
32
+
33
+ if __name__ == "__main__":
34
+ sys.exit(main())