2012-07-24 01:52:31 +00:00
|
|
|
From: Ben Hutchings <ben@decadent.org.uk>
|
2012-07-24 02:57:54 +00:00
|
|
|
Subject: Include package version along with kernel release in stack traces
|
|
|
|
Date: Tue, 24 Jul 2012 03:13:10 +0100
|
2013-07-01 01:12:30 +00:00
|
|
|
Forwarded: not-needed
|
2012-04-03 04:34:17 +00:00
|
|
|
|
|
|
|
For distribution binary packages we assume
|
2012-07-24 01:52:31 +00:00
|
|
|
$DISTRIBUTION_OFFICIAL_BUILD, $DISTRIBUTOR and $DISTRIBUTION_VERSION
|
|
|
|
are set.
|
2012-04-03 04:34:17 +00:00
|
|
|
|
2012-07-24 00:28:08 +00:00
|
|
|
--- a/Makefile
|
|
|
|
+++ b/Makefile
|
2018-08-27 14:21:43 +00:00
|
|
|
@@ -1098,7 +1098,8 @@ endif
|
|
|
|
# that need to depend on updated CONFIG_* values can be checked here.
|
2018-06-26 01:38:11 +00:00
|
|
|
prepare2: prepare3 outputmakefile asm-generic
|
2005-09-14 09:03:26 +00:00
|
|
|
|
2018-08-27 14:21:43 +00:00
|
|
|
-prepare1: prepare2 $(version_h) $(autoksyms_h) include/generated/utsrelease.h
|
|
|
|
+prepare1: prepare2 $(version_h) $(autoksyms_h) include/generated/utsrelease.h \
|
|
|
|
+ include/generated/package.h
|
2012-07-24 00:28:08 +00:00
|
|
|
$(cmd_crmodverdir)
|
2016-12-05 01:02:03 +00:00
|
|
|
|
|
|
|
archprepare: archheaders archscripts prepare1 scripts_basic
|
2018-08-27 14:21:43 +00:00
|
|
|
@@ -1142,6 +1143,16 @@ define filechk_version.h
|
2012-07-24 00:28:08 +00:00
|
|
|
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
|
|
|
|
endef
|
2006-05-25 17:28:45 +00:00
|
|
|
|
2012-07-24 00:28:08 +00:00
|
|
|
+ifneq ($(DISTRIBUTION_OFFICIAL_BUILD),)
|
|
|
|
+define filechk_package.h
|
2012-07-24 02:57:54 +00:00
|
|
|
+ echo \#define LINUX_PACKAGE_ID \" $(DISTRIBUTOR) $(DISTRIBUTION_VERSION)\"
|
2012-07-24 00:28:08 +00:00
|
|
|
+endef
|
|
|
|
+else
|
|
|
|
+define filechk_package.h
|
2012-07-24 01:52:31 +00:00
|
|
|
+ echo \#define LINUX_PACKAGE_ID \"\"
|
2012-07-24 00:28:08 +00:00
|
|
|
+endef
|
|
|
|
+endif
|
2007-02-09 17:05:41 +00:00
|
|
|
+
|
2018-08-27 14:21:43 +00:00
|
|
|
$(version_h): FORCE
|
2012-07-24 00:28:08 +00:00
|
|
|
$(call filechk,version.h)
|
2015-02-08 12:26:35 +00:00
|
|
|
$(Q)rm -f $(old_version_h)
|
2018-08-27 14:21:43 +00:00
|
|
|
@@ -1149,6 +1160,9 @@ $(version_h): FORCE
|
2012-07-24 00:28:08 +00:00
|
|
|
include/generated/utsrelease.h: include/config/kernel.release FORCE
|
|
|
|
$(call filechk,utsrelease.h)
|
|
|
|
|
|
|
|
+include/generated/package.h: $(srctree)/Makefile FORCE
|
|
|
|
+ $(call filechk,package.h)
|
2007-05-01 16:23:01 +00:00
|
|
|
+
|
2012-07-24 00:28:08 +00:00
|
|
|
PHONY += headerdep
|
|
|
|
headerdep:
|
|
|
|
$(Q)find $(srctree)/include/ -name '*.h' | xargs --max-args 1 \
|
2012-07-24 02:57:54 +00:00
|
|
|
--- a/arch/x86/um/sysrq_64.c
|
|
|
|
+++ b/arch/x86/um/sysrq_64.c
|
2017-06-05 13:10:11 +00:00
|
|
|
@@ -9,6 +9,7 @@
|
2012-07-24 02:57:54 +00:00
|
|
|
#include <linux/sched.h>
|
2017-04-19 09:30:57 +00:00
|
|
|
#include <linux/sched/debug.h>
|
2012-07-24 02:57:54 +00:00
|
|
|
#include <linux/utsname.h>
|
|
|
|
+#include <generated/package.h>
|
|
|
|
#include <asm/current.h>
|
|
|
|
#include <asm/ptrace.h>
|
2012-12-16 15:20:29 +00:00
|
|
|
#include <asm/sysrq.h>
|
2017-06-05 13:10:11 +00:00
|
|
|
@@ -17,8 +18,9 @@ void show_regs(struct pt_regs *regs)
|
2012-07-24 02:57:54 +00:00
|
|
|
{
|
|
|
|
printk("\n");
|
|
|
|
print_modules();
|
|
|
|
- printk(KERN_INFO "Pid: %d, comm: %.20s %s %s\n", task_pid_nr(current),
|
|
|
|
- current->comm, print_tainted(), init_utsname()->release);
|
|
|
|
+ printk(KERN_INFO "Pid: %d, comm: %.20s %s %s%s\n", task_pid_nr(current),
|
|
|
|
+ current->comm, print_tainted(), init_utsname()->release,
|
|
|
|
+ LINUX_PACKAGE_ID);
|
|
|
|
printk(KERN_INFO "RIP: %04lx:[<%016lx>]\n", PT_REGS_CS(regs) & 0xffff,
|
2012-09-17 02:19:21 +00:00
|
|
|
PT_REGS_IP(regs));
|
2012-07-24 02:57:54 +00:00
|
|
|
printk(KERN_INFO "RSP: %016lx EFLAGS: %08lx\n", PT_REGS_SP(regs),
|
|
|
|
--- a/arch/ia64/kernel/process.c
|
|
|
|
+++ b/arch/ia64/kernel/process.c
|
2018-03-12 02:40:37 +00:00
|
|
|
@@ -34,6 +34,7 @@
|
2012-07-24 02:57:54 +00:00
|
|
|
#include <linux/utsname.h>
|
|
|
|
#include <linux/tracehook.h>
|
2012-10-13 08:57:26 +00:00
|
|
|
#include <linux/rcupdate.h>
|
2012-07-24 02:57:54 +00:00
|
|
|
+#include <generated/package.h>
|
|
|
|
|
|
|
|
#include <asm/cpu.h>
|
|
|
|
#include <asm/delay.h>
|
2018-03-12 02:40:37 +00:00
|
|
|
@@ -104,9 +105,9 @@ show_regs (struct pt_regs *regs)
|
2012-07-24 02:57:54 +00:00
|
|
|
print_modules();
|
2013-06-02 18:14:09 +00:00
|
|
|
printk("\n");
|
|
|
|
show_regs_print_info(KERN_DEFAULT);
|
2012-07-24 02:57:54 +00:00
|
|
|
- printk("psr : %016lx ifs : %016lx ip : [<%016lx>] %s (%s)\n",
|
|
|
|
+ printk("psr : %016lx ifs : %016lx ip : [<%016lx>] %s (%s%s)\n",
|
|
|
|
regs->cr_ipsr, regs->cr_ifs, ip, print_tainted(),
|
|
|
|
- init_utsname()->release);
|
|
|
|
+ init_utsname()->release, LINUX_PACKAGE_ID);
|
2018-03-12 02:40:37 +00:00
|
|
|
printk("ip is at %pS\n", (void *)ip);
|
2012-07-24 02:57:54 +00:00
|
|
|
printk("unat: %016lx pfs : %016lx rsc : %016lx\n",
|
|
|
|
regs->ar_unat, regs->ar_pfs, regs->ar_rsc);
|
|
|
|
--- a/arch/powerpc/kernel/process.c
|
|
|
|
+++ b/arch/powerpc/kernel/process.c
|
2018-03-12 02:40:37 +00:00
|
|
|
@@ -43,6 +43,7 @@
|
2015-02-08 12:26:35 +00:00
|
|
|
#include <linux/uaccess.h>
|
2016-06-09 00:55:39 +00:00
|
|
|
#include <linux/elf-randomize.h>
|
2018-03-12 02:40:37 +00:00
|
|
|
#include <linux/pkeys.h>
|
2012-07-24 02:57:54 +00:00
|
|
|
+#include <generated/package.h>
|
|
|
|
|
|
|
|
#include <asm/pgtable.h>
|
2015-02-08 12:26:35 +00:00
|
|
|
#include <asm/io.h>
|
2018-08-27 14:21:43 +00:00
|
|
|
@@ -1430,8 +1431,9 @@ void show_regs(struct pt_regs * regs)
|
2012-07-24 02:57:54 +00:00
|
|
|
|
2017-10-01 19:26:01 +00:00
|
|
|
printk("NIP: "REG" LR: "REG" CTR: "REG"\n",
|
2012-07-24 02:57:54 +00:00
|
|
|
regs->nip, regs->link, regs->ctr);
|
2017-12-26 18:54:17 +00:00
|
|
|
- printk("REGS: %px TRAP: %04lx %s (%s)\n",
|
2012-07-24 02:57:54 +00:00
|
|
|
- regs, regs->trap, print_tainted(), init_utsname()->release);
|
2017-12-26 18:54:17 +00:00
|
|
|
+ printk("REGS: %px TRAP: %04lx %s (%s%s)\n",
|
2012-07-24 02:57:54 +00:00
|
|
|
+ regs, regs->trap, print_tainted(), init_utsname()->release,
|
|
|
|
+ LINUX_PACKAGE_ID);
|
2017-10-01 19:26:01 +00:00
|
|
|
printk("MSR: "REG" ", regs->msr);
|
2016-02-15 16:36:21 +00:00
|
|
|
print_msr_bits(regs->msr);
|
2017-10-01 19:26:01 +00:00
|
|
|
pr_cont(" CR: %08lx XER: %08lx\n", regs->ccr, regs->xer);
|
2017-06-03 23:02:06 +00:00
|
|
|
--- a/kernel/hung_task.c
|
|
|
|
+++ b/kernel/hung_task.c
|
2017-06-05 13:10:11 +00:00
|
|
|
@@ -20,6 +20,7 @@
|
|
|
|
#include <linux/sched/debug.h>
|
|
|
|
|
2017-06-03 23:02:06 +00:00
|
|
|
#include <trace/events/sched.h>
|
|
|
|
+#include <generated/package.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The number of tasks checked:
|
2018-08-27 14:21:43 +00:00
|
|
|
@@ -123,10 +124,11 @@ static void check_hung_task(struct task_
|
2017-06-05 13:10:11 +00:00
|
|
|
sysctl_hung_task_warnings--;
|
2017-06-03 23:02:06 +00:00
|
|
|
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);
|
2018-04-19 22:44:22 +00:00
|
|
|
--- a/lib/dump_stack.c
|
|
|
|
+++ b/lib/dump_stack.c
|
|
|
|
@@ -12,6 +12,7 @@
|
|
|
|
#include <linux/atomic.h>
|
|
|
|
#include <linux/kexec.h>
|
|
|
|
#include <linux/utsname.h>
|
2012-07-24 02:57:54 +00:00
|
|
|
+#include <generated/package.h>
|
2013-06-02 18:14:09 +00:00
|
|
|
|
2018-04-19 22:44:22 +00:00
|
|
|
static char dump_stack_arch_desc_str[128];
|
|
|
|
|
|
|
|
@@ -44,13 +45,14 @@ void __init dump_stack_set_arch_desc(con
|
2013-06-02 18:14:09 +00:00
|
|
|
*/
|
|
|
|
void dump_stack_print_info(const char *log_lvl)
|
2012-07-24 02:57:54 +00:00
|
|
|
{
|
2018-04-19 22:44:22 +00:00
|
|
|
- printk("%sCPU: %d PID: %d Comm: %.20s %s%s %s %.*s\n",
|
|
|
|
+ printk("%sCPU: %d PID: %d Comm: %.20s %s%s %s %.*s%s\n",
|
2013-06-02 18:14:09 +00:00
|
|
|
log_lvl, raw_smp_processor_id(), current->pid, current->comm,
|
2018-04-19 22:44:22 +00:00
|
|
|
kexec_crash_loaded() ? "Kdump: loaded " : "",
|
|
|
|
print_tainted(),
|
|
|
|
init_utsname()->release,
|
2012-07-24 02:57:54 +00:00
|
|
|
(int)strcspn(init_utsname()->version, " "),
|
|
|
|
- init_utsname()->version);
|
|
|
|
+ init_utsname()->version,
|
|
|
|
+ LINUX_PACKAGE_ID);
|
2006-05-25 17:28:45 +00:00
|
|
|
|
2013-06-02 18:14:09 +00:00
|
|
|
if (dump_stack_arch_desc_str[0] != '\0')
|
|
|
|
printk("%sHardware name: %s\n",
|