Add openpower-debug-collector-watchdog-timeout unit file
Trigger a service to capture SBE and HB istep info
on watchdog timeout
Change-Id: I44ef86960d022133a703cc8ec3dcc2955be44335
Signed-off-by: Shakeeb Pasha <shakeebbk@in.ibm.com>
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector.bb b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector.bb
index be84209..ac4cd01 100644
--- a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector.bb
+++ b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector.bb
@@ -41,8 +41,14 @@
WDOG_INSTFMT = "openpower-debug-collector-watchdog@{0}.service"
TIMEOUT_WDOG_FMT = "../${WDOG_TMPL}:${TIMEOUT_TGTFMT}.wants/${WDOG_INSTFMT}"
+# Capture debug information on watchdog timeout
+DEBUG_WD_TIMEOUT_TMPL = "openpower-debug-collector-watchdog-timeout@.service"
+DEBUG_WD_TIMEOUT_INSTFMT = "openpower-debug-collector-watchdog-timeout@{0}.service"
+DEBUG_WD_TIMEOUT_FMT = "../${DEBUG_WD_TIMEOUT_TMPL}:${TIMEOUT_TGTFMT}.wants/${DEBUG_WD_TIMEOUT_INSTFMT}"
+
SYSTEMD_LINK_${PN} += "${@compose_list(d, 'CRASH_CHECKSTOP_FMT', 'OBMC_HOST_INSTANCES')}"
SYSTEMD_LINK_${PN} += "${@compose_list(d, 'TIMEOUT_WDOG_FMT', 'OBMC_HOST_INSTANCES')}"
+SYSTEMD_LINK_${PN} += "${@compose_list(d, 'DEBUG_WD_TIMEOUT_FMT', 'OBMC_HOST_INSTANCES')}"
# Do not depend on phosphor-logging for native build
DEPENDS_remove_class-native = "phosphor-logging"
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector/openpower-debug-collector-watchdog-timeout@.service b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector/openpower-debug-collector-watchdog-timeout@.service
new file mode 100644
index 0000000..55ba403
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector/openpower-debug-collector-watchdog-timeout@.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=OpenPOWER debug data collector for host %I watchdog timeout
+Before=obmc-host-quiesce@%i.target
+
+[Service]
+ExecStart=/usr/bin/env openpower-proc-control collectSBEHBData
+SyslogIdentifier=openpower-proc-control
+Type=oneshot
+Restart=no