From e6c8b0bdf6a730b59a941a05e4c4b20469f8a76f Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 4 Jun 2017 00:02:06 +0100 Subject: [PATCH] Add Debian package version to "hung task" log messages I noticed a couple of bug reports with these messages and unknown packge version. --- debian/changelog | 1 + debian/patches/debian/version.patch | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 0237d469e..aa265abb1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -413,6 +413,7 @@ linux (4.9.30-1) UNRELEASED; urgency=medium * uapi: fix linux/if.h userspace compilation errors (see #822393, #824442) * debian/control: Fix compiler build-dependencies for cross-building (Closes: #863907) + * Add Debian package version to "hung task" log messages [ Salvatore Bonaccorso ] * tracing: Use strlcpy() instead of strcpy() in __trace_find_cmdline() diff --git a/debian/patches/debian/version.patch b/debian/patches/debian/version.patch index 505f0b711..05175bc4e 100644 --- a/debian/patches/debian/version.patch +++ b/debian/patches/debian/version.patch @@ -99,7 +99,7 @@ are set. #include #include -@@ -1340,8 +1341,9 @@ void show_regs(struct pt_regs * regs) +@@ -1359,8 +1360,9 @@ void show_regs(struct pt_regs * regs) printk("NIP: "REG" LR: "REG" CTR: "REG"\n", regs->nip, regs->link, regs->ctr); @@ -111,6 +111,30 @@ are set. printk("MSR: "REG" ", regs->msr); print_msr_bits(regs->msr); printk(" CR: %08lx XER: %08lx\n", regs->ccr, regs->xer); +--- a/kernel/hung_task.c ++++ b/kernel/hung_task.c +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + + /* + * The number of tasks checked: +@@ -109,10 +110,11 @@ static void check_hung_task(struct task_ + sysctl_hung_task_warnings--; + pr_err("INFO: task %s:%d blocked for more than %ld seconds.\n", + t->comm, t->pid, timeout); +- pr_err(" %s %s %.*s\n", ++ pr_err(" %s %s %.*s%s\n", + print_tainted(), init_utsname()->release, + (int)strcspn(init_utsname()->version, " "), +- init_utsname()->version); ++ init_utsname()->version, ++ LINUX_PACKAGE_ID); + pr_err("\"echo 0 > /proc/sys/kernel/hung_task_timeout_secs\"" + " disables this message.\n"); + sched_show_task(t); --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -45,6 +45,7 @@