LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org
Cc: Holger Wolf <wolf@linux.vnet.ibm.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: [patch 13/18] latencytop s390 support.
Date: Tue, 05 Feb 2008 16:38:48 +0100	[thread overview]
Message-ID: <20080205153914.533265710@de.ibm.com> (raw)
In-Reply-To: <20080205153835.337897404@de.ibm.com>

[-- Attachment #1: 013-latency-s390.diff --]
[-- Type: text/plain, Size: 2809 bytes --]

From: Heiko Carstens <heiko.carstens@de.ibm.com>

Cc: Holger Wolf <wolf@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
---

 arch/s390/Kconfig             |    3 +++
 arch/s390/kernel/stacktrace.c |   31 +++++++++++++++++++++++--------
 2 files changed, 26 insertions(+), 8 deletions(-)

Index: quilt-2.6/arch/s390/Kconfig
===================================================================
--- quilt-2.6.orig/arch/s390/Kconfig
+++ quilt-2.6/arch/s390/Kconfig
@@ -16,6 +16,9 @@ config LOCKDEP_SUPPORT
 config STACKTRACE_SUPPORT
 	def_bool y
 
+config HAVE_LATENCYTOP_SUPPORT
+	def_bool y
+
 config RWSEM_GENERIC_SPINLOCK
 	bool
 
Index: quilt-2.6/arch/s390/kernel/stacktrace.c
===================================================================
--- quilt-2.6.orig/arch/s390/kernel/stacktrace.c
+++ quilt-2.6/arch/s390/kernel/stacktrace.c
@@ -14,7 +14,8 @@
 static unsigned long save_context_stack(struct stack_trace *trace,
 					unsigned long sp,
 					unsigned long low,
-					unsigned long high)
+					unsigned long high,
+					int savesched)
 {
 	struct stack_frame *sf;
 	struct pt_regs *regs;
@@ -47,10 +48,12 @@ static unsigned long save_context_stack(
 			return sp;
 		regs = (struct pt_regs *)sp;
 		addr = regs->psw.addr & PSW_ADDR_INSN;
-		if (!trace->skip)
-			trace->entries[trace->nr_entries++] = addr;
-		else
-			trace->skip--;
+		if (savesched || !in_sched_functions(addr)) {
+			if (!trace->skip)
+				trace->entries[trace->nr_entries++] = addr;
+			else
+				trace->skip--;
+		}
 		if (trace->nr_entries >= trace->max_entries)
 			return sp;
 		low = sp;
@@ -66,15 +69,27 @@ void save_stack_trace(struct stack_trace
 	orig_sp = sp & PSW_ADDR_INSN;
 	new_sp = save_context_stack(trace, orig_sp,
 				    S390_lowcore.panic_stack - PAGE_SIZE,
-				    S390_lowcore.panic_stack);
+				    S390_lowcore.panic_stack, 1);
 	if (new_sp != orig_sp)
 		return;
 	new_sp = save_context_stack(trace, new_sp,
 				    S390_lowcore.async_stack - ASYNC_SIZE,
-				    S390_lowcore.async_stack);
+				    S390_lowcore.async_stack, 1);
 	if (new_sp != orig_sp)
 		return;
 	save_context_stack(trace, new_sp,
 			   S390_lowcore.thread_info,
-			   S390_lowcore.thread_info + THREAD_SIZE);
+			   S390_lowcore.thread_info + THREAD_SIZE, 1);
+}
+
+void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
+{
+	unsigned long sp, low, high;
+
+	sp = tsk->thread.ksp & PSW_ADDR_INSN;
+	low = (unsigned long) task_stack_page(tsk);
+	high = (unsigned long) task_pt_regs(tsk);
+	save_context_stack(trace, sp, low, high, 0);
+	if (trace->nr_entries < trace->max_entries)
+		trace->entries[trace->nr_entries++] = ULONG_MAX;
 }

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.


  parent reply	other threads:[~2008-02-05 15:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-05 15:38 [patch 00/18] s390 bug fix patches Martin Schwidefsky
2008-02-05 15:38 ` [patch 01/18] cio: make sense id procedure work with partial hardware response Martin Schwidefsky
2008-02-05 15:38 ` [patch 02/18] cio: Clean up chsc response code handling Martin Schwidefsky
2008-02-05 15:38 ` [patch 03/18] cio: Update documentation Martin Schwidefsky
2008-02-05 15:38 ` [patch 04/18] cio: Add shutdown callback for ccwgroup Martin Schwidefsky
2008-02-05 15:38 ` [patch 05/18] DEBUG_PAGEALLOC support for s390 Martin Schwidefsky
2008-02-05 15:38 ` [patch 06/18] Fix linker script Martin Schwidefsky
2008-02-05 15:38 ` [patch 07/18] Fix smp_call_function_mask semantics Martin Schwidefsky
2008-02-05 15:38 ` [patch 08/18] Fix couple of section mismatches Martin Schwidefsky
2008-02-05 15:38 ` [patch 09/18] console: allow vt220 console to be the only console Martin Schwidefsky
2008-02-05 15:38 ` [patch 10/18] Define GENERIC_LOCKBREAK Martin Schwidefsky
2008-02-05 15:38 ` [patch 11/18] Cleanup & optimize bitops Martin Schwidefsky
2008-02-05 15:38 ` [patch 12/18] Implement ext2_find_next_bit Martin Schwidefsky
2008-02-05 15:38 ` Martin Schwidefsky [this message]
2008-02-05 15:38 ` [patch 14/18] dasd: add ifcc handling Martin Schwidefsky
2008-02-05 15:38 ` [patch 15/18] dasd: fix panic caused by alias device offline Martin Schwidefsky
2008-02-05 15:38 ` [patch 16/18] sclp_tty/sclp_vt220: Fix scheduling while atomic Martin Schwidefsky
2008-02-05 15:38 ` [patch 17/18] Remove BUILD_BUG_ON() in vmem code Martin Schwidefsky
2008-02-05 15:38 ` [patch 18/18] dcss: Initialize workqueue before using it Martin Schwidefsky
2008-02-05 15:45   ` Carsten Otte

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=20080205153914.533265710@de.ibm.com \
    --to=schwidefsky@de.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=wolf@linux.vnet.ibm.com \
    --subject='Re: [patch 13/18] latencytop s390 support.' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).