Add Debian package version to "hung task" log messages

I noticed a couple of bug reports with these messages and unknown
packge version.
This commit is contained in:
Ben Hutchings 2017-06-04 00:02:06 +01:00
parent 9479b65c42
commit e6c8b0bdf6
2 changed files with 26 additions and 1 deletions

1
debian/changelog vendored
View File

@ -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()

View File

@ -99,7 +99,7 @@ are set.
#include <asm/pgtable.h>
#include <asm/io.h>
@@ -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 <linux/sysctl.h>
#include <linux/utsname.h>
#include <trace/events/sched.h>
+#include <generated/package.h>
/*
* 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 @@