mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hirokazu Takata <takata@linux-m32r.org>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, takata@linux-m32r.org
Subject: [PATCH 2.6.9-rc1-mm4 1/6] [m32r] Update for profiling
Date: Sun, 12 Sep 2004 05:43:50 +0900 (JST)	[thread overview]
Message-ID: <20040912.054350.846936276.takata@linux-m32r.org> (raw)
In-Reply-To: <20040912.052403.730551818.takata@linux-m32r.org>

[PATCH 2.6.9-rc1-mm4 1/6] [m32r] Update for profiling
  This patch is for profiling support. 
  profile_tick() is used instead of m32r_do_profile().

	* arch/m32r/kernel/smp.c
	(smp_local_timer_interrupt): Change profile API, use profile_tick()
	instead of m32r_do_profile().

	* arch/m32r/kernel/time.c: ditto.

	* include/asm-m32r/hw_irq.h (m32r_do_profile): Removed.

	* include/asm-m32r/ptrace.h (profile_pc): Add profile_pc() macro.

Signed-off-by: Hirokazu Takata <takata@linux-m32r.org>
---

 arch/m32r/kernel/smp.c    |   10 ++++------
 arch/m32r/kernel/time.c   |    5 ++---
 include/asm-m32r/hw_irq.h |   33 +--------------------------------
 include/asm-m32r/ptrace.h |   14 ++++++++------
 4 files changed, 15 insertions(+), 47 deletions(-)


diff -ruNp linux-2.6.9-rc1-mm4.orig/arch/m32r/kernel/smp.c linux-2.6.9-rc1-mm4/arch/m32r/kernel/smp.c
--- linux-2.6.9-rc1-mm4.orig/arch/m32r/kernel/smp.c	2004-09-08 08:14:03.000000000 +0900
+++ linux-2.6.9-rc1-mm4/arch/m32r/kernel/smp.c	2004-09-09 23:07:43.000000000 +0900
@@ -1,8 +1,7 @@
 /*
  *  linux/arch/m32r/kernel/smp.c
- *    orig : i386 2.4.10
  *
- *  MITSUBISHI M32R SMP support routines.
+ *  M32R SMP support routines.
  *
  *  Copyright (c) 2001, 2002  Hitoshi Yamamoto
  *
@@ -14,8 +13,6 @@
  *  later.
  */
 
-/* $Id$ */
-
 #undef DEBUG_SMP
 
 #include <linux/irq.h>
@@ -23,6 +20,7 @@
 #include <linux/spinlock.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
+#include <linux/profile.h>
 
 #include <asm/cacheflush.h>
 #include <asm/pgalloc.h>
@@ -109,7 +107,7 @@ static void send_IPI_mask(cpumask_t, int
 unsigned long send_IPI_mask_phys(cpumask_t, int, int);
 
 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
-/* Rescheduling request Routins                                              */
+/* Rescheduling request Routines                                             */
 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
 
 /*==========================================================================*
@@ -762,7 +760,7 @@ void smp_local_timer_interrupt(struct pt
 	 * useful with a profiling multiplier != 1
 	 */
 
-	m32r_do_profile(regs);
+	profile_tick(CPU_PROFILING, regs);
 
 	if (--per_cpu(prof_counter, cpu_id) <= 0) {
 		/*
diff -ruNp linux-2.6.9-rc1-mm4.orig/arch/m32r/kernel/time.c linux-2.6.9-rc1-mm4/arch/m32r/kernel/time.c
--- linux-2.6.9-rc1-mm4.orig/arch/m32r/kernel/time.c	2004-09-08 08:14:03.000000000 +0900
+++ linux-2.6.9-rc1-mm4/arch/m32r/kernel/time.c	2004-09-09 23:07:56.000000000 +0900
@@ -15,8 +15,6 @@
  *    Copyright (C) 2000  Philipp Rumpf <prumpf@tux.org>
  */
 
-/* $Id$ */
-
 #undef  DEBUG_TIMER
 
 #include <linux/config.h>
@@ -29,6 +27,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/interrupt.h>
+#include <linux/profile.h>
 
 #include <asm/io.h>
 #include <asm/m32r.h>
@@ -243,7 +242,7 @@ irqreturn_t timer_interrupt(int irq, voi
 	write_sequnlock(&xtime_lock);
 
 #ifndef CONFIG_SMP
-	m32r_do_profile(regs);
+	profile_tick(CPU_PROFILING, regs);
 #endif
 
 	return IRQ_HANDLED;
diff -ruNp linux-2.6.9-rc1-mm4.orig/include/asm-m32r/hw_irq.h linux-2.6.9-rc1-mm4/include/asm-m32r/hw_irq.h
--- linux-2.6.9-rc1-mm4.orig/include/asm-m32r/hw_irq.h	2004-09-08 08:14:17.000000000 +0900
+++ linux-2.6.9-rc1-mm4/include/asm-m32r/hw_irq.h	2004-09-09 21:10:28.000000000 +0900
@@ -1,40 +1,9 @@
 #ifndef _ASM_M32R_HW_IRQ_H
 #define _ASM_M32R_HW_IRQ_H
 
-/* $Id$ */
-
-#include <linux/profile.h>
-#include <linux/sched.h>
-#include <asm/sections.h>
-
-static __inline__ void hw_resend_irq(struct hw_interrupt_type *h,
-				     unsigned int i)
+static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
 {
 	/* Nothing to do */
 }
 
-static __inline__ void m32r_do_profile (struct pt_regs *regs)
-{
-        unsigned long pc = regs->bpc;
-
-        profile_hook(regs);
-
-        if (user_mode(regs))
-                return;
-
-        if (!prof_buffer)
-                return;
-
-        pc -= (unsigned long) &_stext;
-        pc >>= prof_shift;
-        /*
-         * Don't ignore out-of-bounds PC values silently,
-         * put them into the last histogram slot, so if
-         * present, they will show up as a sharp peak.
-         */
-        if (pc > prof_len - 1)
-                pc = prof_len - 1;
-        atomic_inc((atomic_t *)&prof_buffer[pc]);
-}
-
 #endif /* _ASM_M32R_HW_IRQ_H */
diff -ruNp linux-2.6.9-rc1-mm4.orig/include/asm-m32r/ptrace.h linux-2.6.9-rc1-mm4/include/asm-m32r/ptrace.h
--- linux-2.6.9-rc1-mm4.orig/include/asm-m32r/ptrace.h	2004-09-08 08:14:17.000000000 +0900
+++ linux-2.6.9-rc1-mm4/include/asm-m32r/ptrace.h	2004-09-12 04:41:01.000000000 +0900
@@ -1,14 +1,15 @@
-#ifndef _M32R_PTRACE_H
-#define _M32R_PTRACE_H
-
-/* $Id$ */
+#ifndef _ASM_M32R_PTRACE_H
+#define _ASM_M32R_PTRACE_H
 
 /*
+ * linux/include/asm-m32r/ptrace.h
+ *
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 2001, 2002, 2004  Hirokazu Takata
+ * M32R version:
+ *   Copyright (C) 2001-2002, 2004  Hirokazu Takata <takata at linux-m32r.org>
  */
 
 #include <linux/config.h>
@@ -153,6 +154,7 @@ struct pt_regs {
 #endif
 
 #define instruction_pointer(regs) ((regs)->bpc)
+#define profile_pc(regs) instruction_pointer(regs)
 
 extern void show_regs(struct pt_regs *);
 
@@ -160,4 +162,4 @@ extern void withdraw_debug_trap(struct p
 
 #endif /* __KERNEL */
 
-#endif /* _M32R_PTRACE_H */
+#endif /* _ASM_M32R_PTRACE_H */
 
--
Hirokazu Takata <takata@linux-m32r.org>
Linux/M32R Project:  http://www.linux-m32r.org/

  reply	other threads:[~2004-09-11 20:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-11 20:24 [PATCH 2.6.9-rc1-mm4 0/6] [m32r] Update to fix compile errors Hirokazu Takata
2004-09-11 20:43 ` Hirokazu Takata [this message]
2004-09-11 20:48 ` [PATCH 2.6.9-rc1-mm4 2/6] [m32r] Update zone_sizes_init() Hirokazu Takata
2004-09-11 20:51 ` [PATCH 2.6.9-rc1-mm4 3/6] [m32r] Update to fix compile errors Hirokazu Takata
2004-09-11 20:51 ` [PATCH 2.6.9-rc1-mm4 4/6] [m32r] Update uaccess.h Hirokazu Takata
2004-09-11 20:51 ` [PATCH 2.6.9-rc1-mm4 5/6] [m32r] Update checksum functions Hirokazu Takata
2004-09-11 20:51 ` [PATCH 2.6.9-rc1-mm4 6/6] [m32r] Update CF/PCMCIA drivers Hirokazu Takata
2004-09-11 21:02   ` Christoph Hellwig
2004-09-11 21:05   ` Arjan van de Ven

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=20040912.054350.846936276.takata@linux-m32r.org \
    --to=takata@linux-m32r.org \
    --cc=akpm@osdl.org \
    --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

all inboxes | Powered by JetHome®