public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Dominik Karall <dominik.karall@gmx.net>
Cc: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: [patch] preempt-trace-fixes.patch
Date: Fri, 5 Aug 2005 17:13:12 +0200	[thread overview]
Message-ID: <20050805151312.GA3284@elte.hu> (raw)
In-Reply-To: <200508051344.58848.dominik.karall@gmx.net>


* Dominik Karall <dominik.karall@gmx.net> wrote:

> > yeah. I've done this today and have split it out of the -RT tree, see
> > the patch below. After some exposure in -mm i'd like this feature to go
> > upstream too.
> >
> > the patch is against recent Linus trees, 2.6.13-rc4 or later should all
> > work. Dominik, could you try it and send us the new kernel logs whenever
> > you happen to hit that warning message again? (Please also enable
> > CONFIG_KALLSYMS_ALL, so that we get as much symbolic data as possible.)
> 
> I tried to compile the patch on top of 2.6.13-rc4-mm1, it applied with a few 
> offsets, but it looked ok.
> Here is the error I get when I compiled it:

ok, does the additional patch below fix things for you?

	Ingo

------

- fix the x64 build

- get the preempt_count from the right task on x86 (it's usually 
  'current', but not always.)

- fix compiler warning in kernel/softirq.c on 64-bit platforms

Signed-off-by: Ingo Molnar <mingo@elte.hu>

 arch/i386/kernel/traps.c     |    2 +-
 arch/x86_64/kernel/process.c |    2 +-
 arch/x86_64/kernel/traps.c   |    9 +++++----
 include/asm-x86_64/proto.h   |    2 +-
 kernel/softirq.c             |    2 +-
 5 files changed, 9 insertions(+), 8 deletions(-)

Index: linux-preempt-trace/arch/i386/kernel/traps.c
===================================================================
--- linux-preempt-trace.orig/arch/i386/kernel/traps.c
+++ linux-preempt-trace/arch/i386/kernel/traps.c
@@ -164,7 +164,7 @@ void show_trace(struct task_struct *task
 			break;
 		printk(" =======================\n");
 	}
-	print_preempt_trace(task, preempt_count());
+	print_preempt_trace(task, task->thread_info->preempt_count);
 }
 
 void show_stack(struct task_struct *task, unsigned long *esp)
Index: linux-preempt-trace/arch/x86_64/kernel/process.c
===================================================================
--- linux-preempt-trace.orig/arch/x86_64/kernel/process.c
+++ linux-preempt-trace/arch/x86_64/kernel/process.c
@@ -311,7 +311,7 @@ void __show_regs(struct pt_regs * regs)
 void show_regs(struct pt_regs *regs)
 {
 	__show_regs(regs);
-	show_trace(&regs->rsp);
+	show_trace(current, &regs->rsp);
 }
 
 /*
Index: linux-preempt-trace/arch/x86_64/kernel/traps.c
===================================================================
--- linux-preempt-trace.orig/arch/x86_64/kernel/traps.c
+++ linux-preempt-trace/arch/x86_64/kernel/traps.c
@@ -29,6 +29,7 @@
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/nmi.h>
+#include <linux/sched.h>
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
@@ -156,7 +157,7 @@ static unsigned long *in_exception_stack
  * severe exception (double fault, nmi, stack fault, debug, mce) hardware stack
  */
 
-void show_trace(unsigned long *stack)
+void show_trace(struct task_struct *task, unsigned long *stack)
 {
 	unsigned long addr;
 	const unsigned cpu = safe_smp_processor_id();
@@ -221,7 +222,7 @@ void show_trace(unsigned long *stack)
 	HANDLE_STACK (((long) stack & (THREAD_SIZE-1)) != 0);
 #undef HANDLE_STACK
 	printk("\n");
-	print_traces(task);
+	print_preempt_trace(task, task->thread_info->preempt_count);
 }
 
 void show_stack(struct task_struct *tsk, unsigned long * rsp)
@@ -258,7 +259,7 @@ void show_stack(struct task_struct *tsk,
 		printk("%016lx ", *stack++);
 		touch_nmi_watchdog();
 	}
-	show_trace((unsigned long *)rsp);
+	show_trace(tsk, (unsigned long *)rsp);
 }
 
 /*
@@ -267,7 +268,7 @@ void show_stack(struct task_struct *tsk,
 void dump_stack(void)
 {
 	unsigned long dummy;
-	show_trace(&dummy);
+	show_trace(current, &dummy);
 }
 
 EXPORT_SYMBOL(dump_stack);
Index: linux-preempt-trace/include/asm-x86_64/proto.h
===================================================================
--- linux-preempt-trace.orig/include/asm-x86_64/proto.h
+++ linux-preempt-trace/include/asm-x86_64/proto.h
@@ -66,7 +66,7 @@ extern unsigned long end_pfn_map; 
 
 extern cpumask_t cpu_initialized;
 
-extern void show_trace(unsigned long * rsp);
+extern void show_trace(struct task_struct *task, unsigned long *rsp);
 extern void show_registers(struct pt_regs *regs);
 
 extern void exception_table_check(void);
Index: linux-preempt-trace/kernel/softirq.c
===================================================================
--- linux-preempt-trace.orig/kernel/softirq.c
+++ linux-preempt-trace/kernel/softirq.c
@@ -99,7 +99,7 @@ restart:
 #ifdef CONFIG_DEBUG_PREEMPT
 			out_count = preempt_count();
 			if (in_count != out_count) {
-				printk(KERN_ERR "BUG: softirq %d preempt-count "
+				printk(KERN_ERR "BUG: softirq %ld preempt-count "
 					"imbalance: in=%08x, out=%08x!\n",
 					h - softirq_vec, in_count, out_count);
 				print_preempt_trace(current, out_count);

  reply	other threads:[~2005-08-05 15:15 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-07 11:29 2.6.12-rc6-mm1 Andrew Morton
2005-06-07 14:24 ` 2.6.12-rc6-mm1 Wolfgang Wander
2005-06-07 14:49   ` 2.6.12-rc6-mm1 Wolfgang Wander
2005-06-07 14:48 ` 2.6.12-rc6-mm1 Brice Goglin
2005-06-07 20:59 ` 2.6.12-rc6-mm1: rio confusion Adrian Bunk
2005-06-07 21:38   ` Matt Porter
2005-06-07 23:15 ` 2.6.12-rc6-mm1 Francois Romieu
2005-06-08  1:59 ` 2.6.12-rc6-mm1 Søren Lott
2005-06-08  5:53   ` 2.6.12-rc6-mm1 Jean Delvare
2005-06-08  7:08     ` 2.6.12-rc6-mm1 Søren Lott
2005-06-09  3:47       ` [lm-sensors] 2.6.12-rc6-mm1 Mark M. Hoffman
2005-06-08 14:22 ` 2.6.12-rc6-mm1 Andy Whitcroft
2005-06-08 20:01   ` 2.6.12-rc6-mm1 Andrew Morton
2005-06-08 23:14     ` 2.6.12-rc6-mm1 Martin J. Bligh
2005-06-08 23:22       ` 2.6.12-rc6-mm1 Andrew Morton
2005-06-08 23:34         ` 2.6.12-rc6-mm1 Martin J. Bligh
2005-06-09  7:17           ` 2.6.12-rc6-mm1 Kirill Korotaev
2005-06-09 13:38             ` 2.6.12-rc6-mm1 Martin J. Bligh
2005-06-10 12:12               ` 2.6.12-rc6-mm1 Kirill Korotaev
2005-06-09  4:27   ` 2.6.12-rc6-mm1 Andrey Panin
2005-06-09 13:12     ` 2.6.12-rc6-mm1 Andy Whitcroft
2005-06-08 14:33 ` BUG in i2c_detach_client Andrew James Wade
2005-06-08 16:21   ` Jean Delvare
2005-06-08 21:26   ` Andrew Morton
2005-06-08 22:56     ` Andrew James Wade
2005-06-08 23:32       ` Andrew Morton
2005-06-09  7:52         ` Jean Delvare
2005-06-09  7:47     ` Jean Delvare
2005-06-09 11:05       ` Andrew James Wade
2005-06-09 13:32       ` Andrew James Wade
2005-06-09 15:57         ` Jean Delvare
2005-06-10  5:58           ` Greg KH
2005-06-10  7:08             ` Jean Delvare
2005-06-11 11:51 ` 2.6.12-rc6-mm1 Benoit Boissinot
2005-06-18 22:39 ` 2.6.12-rc6-mm1 Richard Purdie
2005-06-18 22:44   ` 2.6.12-rc6-mm1 Andrew Morton
2005-06-18 22:57     ` 2.6.12-rc6-mm1 Richard Purdie
2005-06-18 23:11       ` 2.6.12-rc6-mm1 Richard Purdie
2005-06-18 23:18   ` 2.6.12-rc6-mm1 Russell King
2005-06-19  1:20     ` 2.6.12-rc6-mm1 Richard Purdie
2005-06-19  9:02       ` 2.6.12-rc6-mm1 Russell King
2005-06-19  9:11         ` 2.6.12-rc6-mm1 Russell King
2005-06-19 17:12           ` 2.6.12-rc6-mm1 Richard Purdie
2005-06-19 17:39             ` 2.6.12-rc6-mm1 Russell King
2005-06-19 18:25               ` 2.6.12-rc6-mm1 Richard Purdie
2005-06-19 18:56                 ` 2.6.12-rc6-mm1 Russell King
2005-06-21 13:20 ` 2.6.12-rc6-mm1 Dominik Karall
2005-06-24 21:27   ` 2.6.12-rc6-mm1 Alexey Dobriyan
2005-07-29  4:54   ` 2.6.12-rc6-mm1 Andrew Morton
2005-07-29 13:39     ` 2.6.12-rc6-mm1 Dominik Karall
2005-07-29 18:22       ` 2.6.12-rc6-mm1 Andrew Morton
2005-07-29 21:19         ` 2.6.12-rc6-mm1 Dominik Karall
2005-07-29 21:27           ` 2.6.12-rc6-mm1 Andrew Morton
2005-07-29 21:37             ` 2.6.12-rc6-mm1 Dominik Karall
2005-08-04 19:44               ` 2.6.12-rc6-mm1 Andrew Morton
2005-08-04 22:28                 ` 2.6.12-rc6-mm1 Andrew Morton
2005-08-04 22:44                   ` 2.6.12-rc6-mm1 Dominik Karall
2005-08-05 10:48                   ` [patch] preempt-trace.patch Ingo Molnar
2005-08-05 11:44                     ` Dominik Karall
2005-08-05 15:13                       ` Ingo Molnar [this message]
2005-08-05 18:14                         ` [patch] preempt-trace-fixes.patch Dominik Karall
2005-08-05 14:26                     ` [patch] preempt-trace.patch (mono preempt-trace) Dominik Karall
2005-08-05 15:22                       ` Ingo Molnar
2005-08-05 17:58                         ` Dominik Karall
2005-08-05 18:46                           ` Hugh Dickins
2005-08-05 19:23                             ` Dominik Karall
2005-08-05 20:04                               ` Ingo Molnar
2005-08-05 20:48                                 ` Dominik Karall
2005-08-05 18:05                         ` Andrew Morton
2005-08-05 20:08                           ` Ingo Molnar
2005-08-05 20:13                           ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050805151312.GA3284@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@osdl.org \
    --cc=dominik.karall@gmx.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox