public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Gregory Haskins <ghaskins@novell.com>
To: mingo@elte.hu
Cc: linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	ghaskins@novell.com
Subject: [PATCH 1/2] Adds full stack to critical-section tracing
Date: Fri, 10 Aug 2007 08:14:13 -0600	[thread overview]
Message-ID: <20070810141413.12966.13475.stgit@lsg> (raw)
In-Reply-To: <20070810140745.12966.8464.stgit@lsg>


---

 include/linux/sched.h  |    7 +++++--
 kernel/latency_trace.c |   18 +++++++++++-------
 2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 8ebb43c..233d26c 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1306,10 +1306,13 @@ struct task_struct {
 #endif
 
 #define MAX_PREEMPT_TRACE 25
+#define MAX_PREEMPT_TRACE_DEPTH 5
 
 #ifdef CONFIG_PREEMPT_TRACE
-	unsigned long preempt_trace_eip[MAX_PREEMPT_TRACE];
-	unsigned long preempt_trace_parent_eip[MAX_PREEMPT_TRACE];
+	struct {
+		struct stack_trace trace;
+		unsigned long      data[MAX_PREEMPT_TRACE_DEPTH];
+	} preempt_trace[MAX_PREEMPT_TRACE];
 #endif
 
 #define MAX_LOCK_STACK	MAX_PREEMPT_TRACE
diff --git a/kernel/latency_trace.c b/kernel/latency_trace.c
index 1113744..9b83262 100644
--- a/kernel/latency_trace.c
+++ b/kernel/latency_trace.c
@@ -2049,8 +2049,15 @@ void notrace add_preempt_count(unsigned int val)
 	if (val <= 10) {
 		unsigned int idx = preempt_count() & PREEMPT_MASK;
 		if (idx < MAX_PREEMPT_TRACE) {
-			current->preempt_trace_eip[idx] = eip;
-			current->preempt_trace_parent_eip[idx] = parent_eip;
+			struct stack_trace *trace;
+
+			trace = &current->preempt_trace[idx].trace;
+			trace->nr_entries = 0;
+			trace->max_entries = MAX_PREEMPT_TRACE_DEPTH;
+			trace->skip = 0;
+			trace->entries = current->preempt_trace[idx].data;
+
+			save_stack_trace(trace);
 		}
 	}
 #endif
@@ -2708,11 +2715,8 @@ static void print_preempt_trace(struct task_struct *task)
 	printk("| %d-level deep critical section nesting:\n", lim);
 	printk("----------------------------------------\n");
 	for (i = 1; i <= lim; i++) {
-		printk(".. [<%08lx>] .... ", task->preempt_trace_eip[i]);
-		print_symbol("%s\n", task->preempt_trace_eip[i]);
-		printk(".....[<%08lx>] ..   ( <= ",
-				task->preempt_trace_parent_eip[i]);
-		print_symbol("%s)\n", task->preempt_trace_parent_eip[i]);
+		printk("  ---- Critial Section #%d ----\n", i);
+		print_stack_trace(&task->preempt_trace[i].trace, 5);
 	}
 	printk("\n");
 }


  reply	other threads:[~2007-08-10 14:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-10 14:14 [PATCH 0/2] RT: Enhance PREEMPT_TRACE with deeper stacks Gregory Haskins
2007-08-10 14:14 ` Gregory Haskins [this message]
2007-08-30  0:48   ` [PATCH 1/2] Adds full stack to critical-section tracing Daniel Walker
2007-08-10 14:14 ` [PATCH 2/2] Some stacks show up untracable, so fall back to old method in this case Gregory Haskins

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=20070810141413.12966.13475.stgit@lsg \
    --to=ghaskins@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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