[BIONIC] UBUNTU: SAUCE: Enable the ACPI kernel debugger and acpidbg tool

Message ID 20171127151339.14463-1-colin.king@canonical.com
State New
Headers show
Series
  • [BIONIC] UBUNTU: SAUCE: Enable the ACPI kernel debugger and acpidbg tool
Related show

Commit Message

Colin Ian King Nov. 27, 2017, 3:13 p.m.
From: Colin Ian King <colin.king@canonical.com>

Enable the kernel ACPI driver debugger to help debug ACPICA at
runtime and also add the acpidbg userspace debugging tool in the
linux-tools package.  A user with root privilege can attach the
ACPI kernel debugger using the acpidbg tool and interactively
debug the ACPI objects, such as single stepping control methods
and printing ACPI object using the kernel debug sysfs file
/sys/kernel/debug/acpi/acpidbg.  This is a useful tool for the
HWE folk to debug and resolve gnarly ACPI issues.

For the moment, enable this for x86 architectures only. Once I
get access to a fully functional ARM64 platform with ACPI support
and test this I will enable it for this too.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 debian.master/config/amd64/config.common.amd64 |  2 ++
 debian.master/rules.d/amd64.mk                 |  1 +
 debian/rules.d/2-binary-arch.mk                | 10 ++++++++++
 debian/rules.d/3-binary-indep.mk               |  4 ++++
 4 files changed, 17 insertions(+)

Comments

Seth Forshee Nov. 27, 2017, 9:32 p.m. | #1
On Mon, Nov 27, 2017 at 03:13:39PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Enable the kernel ACPI driver debugger to help debug ACPICA at
> runtime and also add the acpidbg userspace debugging tool in the
> linux-tools package.  A user with root privilege can attach the
> ACPI kernel debugger using the acpidbg tool and interactively
> debug the ACPI objects, such as single stepping control methods
> and printing ACPI object using the kernel debug sysfs file
> /sys/kernel/debug/acpi/acpidbg.  This is a useful tool for the
> HWE folk to debug and resolve gnarly ACPI issues.
> 
> For the moment, enable this for x86 architectures only. Once I
> get access to a fully functional ARM64 platform with ACPI support
> and test this I will enable it for this too.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied to unstable/master after running updateconfigs with the config
changes. Thanks!

Patch

diff --git a/debian.master/config/amd64/config.common.amd64 b/debian.master/config/amd64/config.common.amd64
index 7161e3d..fa7c17f 100644
--- a/debian.master/config/amd64/config.common.amd64
+++ b/debian.master/config/amd64/config.common.amd64
@@ -5,6 +5,8 @@  CONFIG_64BIT=y
 CONFIG_6LOWPAN=m
 CONFIG_ABX500_CORE=y
 CONFIG_AC97_BUS=m
+CONFIG_ACPI_DEBUGGER=y
+CONFIG_ACPI_DEBUGGER_USER=y
 # CONFIG_ACPI_REDUCED_HARDWARE_ONLY is not set
 CONFIG_ADFS_FS=m
 CONFIG_AFFS_FS=m
diff --git a/debian.master/rules.d/amd64.mk b/debian.master/rules.d/amd64.mk
index c6b57f7..bcae846 100644
--- a/debian.master/rules.d/amd64.mk
+++ b/debian.master/rules.d/amd64.mk
@@ -17,4 +17,5 @@  do_tools_x86	= true
 do_tools_hyperv	= true
 do_extras_package = true
 do_tools_common = true
+do_tools_acpidbg = true
 do_zfs		= true
diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
index 97b5ee0..b3e97ae 100644
--- a/debian/rules.d/2-binary-arch.mk
+++ b/debian/rules.d/2-binary-arch.mk
@@ -375,6 +375,9 @@  ifeq ($(do_tools_usbip),true)
 	$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/usbip $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
 	$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/usbipd $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
 endif
+ifeq ($(do_tools_acpidbg),true)
+	$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/acpidbg $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
+endif
 ifeq ($(do_tools_cpupower),true)
 	$(LN) ../../$(src_pkg_name)-tools-$(abi_release)/cpupower $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
 endif
@@ -598,6 +601,9 @@  ifeq ($(do_tools_usbip),true)
 	cd $(builddirpa)/tools/usb/usbip && ./configure --prefix=$(builddirpa)/tools/usb/usbip/bin
 	cd $(builddirpa)/tools/usb/usbip && make install CFLAGS="-g -O2 -static" CROSS_COMPILE=$(CROSS_COMPILE)
 endif
+ifeq ($(do_tools_acpidbg),true)
+	cd $(builddirpa)/tools/power/acpi && make clean && make CFLAGS="-g -O2 -static -I$(builddirpa)/include" CROSS_COMPILE=$(CROSS_COMPILE) acpidbg
+endif
 ifeq ($(do_tools_cpupower),true)
 	# Allow for multiple installed versions of cpupower and libcpupower.so:
 	# Override LIB_MIN in order to to generate a versioned .so named
@@ -644,6 +650,10 @@  ifeq ($(do_tools_usbip),true)
 	install -m755 $(builddirpa)/tools/usb/usbip/bin/sbin/usbipd \
 		$(toolspkgdir)/usr/lib/$(src_pkg_name)-tools-$(abi_release)
 endif
+ifeq ($(do_tools_acpidbg),true)
+	install -m755 $(builddirpa)/tools/power/acpi/acpidbg \
+		$(toolspkgdir)/usr/lib/$(src_pkg_name)-tools-$(abi_release)
+endif
 ifeq ($(do_tools_cpupower),true)
 	install -m755 $(builddirpa)/tools/power/cpupower/cpupower \
 		$(toolspkgdir)/usr/lib/$(src_pkg_name)-tools-$(abi_release)
diff --git a/debian/rules.d/3-binary-indep.mk b/debian/rules.d/3-binary-indep.mk
index d197cc9..f035b62 100644
--- a/debian/rules.d/3-binary-indep.mk
+++ b/debian/rules.d/3-binary-indep.mk
@@ -134,6 +134,10 @@  ifeq ($(do_tools_common),true)
 	install -d $(cloudman)/man8
 	install -m644 $(CURDIR)/tools/hv/*.8 $(cloudman)/man8
 
+ifeq ($(do_tools_acpidbg),true)
+	install -m755 debian/tools/generic $(toolsbin)/acpidbg
+endif
+
 endif
 
 install-indep: install-tools