mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Matt Fleming <matt@console-pimps.org>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org, paulus@samba.org,
	hpa@zytor.com, mingo@redhat.com, a.p.zijlstra@chello.nl,
	masami.hiramatsu.pt@hitachi.com, matt@console-pimps.org,
	imunsie@au.ibm.com, tglx@linutronix.de, mingo@elte.hu
Subject: [tip:perf/core] perf tools: Add DWARF register lookup for SH
Date: Fri, 16 Jul 2010 04:21:49 GMT	[thread overview]
Message-ID: <tip-0dd9ac63ce26ec87b080ca9c3e6efed33c23ace6@git.kernel.org> (raw)
In-Reply-To: <e55812819ad18c2ceca5651ac7698a2af46180d7.1278774279.git.matt@console-pimps.org>

Commit-ID:  0dd9ac63ce26ec87b080ca9c3e6efed33c23ace6
Gitweb:     http://git.kernel.org/tip/0dd9ac63ce26ec87b080ca9c3e6efed33c23ace6
Author:     Matt Fleming <matt@console-pimps.org>
AuthorDate: Sat, 10 Jul 2010 16:10:39 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 12 Jul 2010 11:25:10 -0300

perf tools: Add DWARF register lookup for SH

Implement get_arch_regstr() for SH so that, given a DWARF register number, the
corresponding symbolic name of that register can be looked up.

Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Ian Munsie <imunsie@au.ibm.com>
LKML-Reference: <e55812819ad18c2ceca5651ac7698a2af46180d7.1278774279.git.matt@console-pimps.org>
Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/arch/{powerpc => sh}/Makefile           |    0
 .../perf/arch/sh/util/dwarf-regs.c                 |   48 +++++++++++++-------
 2 files changed, 32 insertions(+), 16 deletions(-)

diff --git a/tools/perf/arch/powerpc/Makefile b/tools/perf/arch/sh/Makefile
similarity index 100%
copy from tools/perf/arch/powerpc/Makefile
copy to tools/perf/arch/sh/Makefile
diff --git a/kernel/rcutiny_plugin.h b/tools/perf/arch/sh/util/dwarf-regs.c
similarity index 55%
copy from kernel/rcutiny_plugin.h
copy to tools/perf/arch/sh/util/dwarf-regs.c
index d223a92..a11edb0 100644
--- a/kernel/rcutiny_plugin.h
+++ b/tools/perf/arch/sh/util/dwarf-regs.c
@@ -1,7 +1,7 @@
 /*
- * Read-Copy Update mechanism for mutual exclusion (tree-based version)
- * Internal non-public definitions that provide either classic
- * or preemptable semantics.
+ * Mapping of DWARF debug register numbers into register names.
+ *
+ * Copyright (C) 2010 Matt Fleming <matt@console-pimps.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -17,23 +17,39 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
- * Copyright IBM Corporation, 2009
- *
- * Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
  */
 
-#ifdef CONFIG_DEBUG_LOCK_ALLOC
-
-#include <linux/kernel_stat.h>
+#include <libio.h>
+#include <dwarf-regs.h>
 
 /*
- * During boot, we forgive RCU lockdep issues.  After this function is
- * invoked, we start taking RCU lockdep issues seriously.
+ * Generic dwarf analysis helpers
  */
-void rcu_scheduler_starting(void)
+
+#define SH_MAX_REGS 18
+const char *sh_regs_table[SH_MAX_REGS] = {
+	"r0",
+	"r1",
+	"r2",
+	"r3",
+	"r4",
+	"r5",
+	"r6",
+	"r7",
+	"r8",
+	"r9",
+	"r10",
+	"r11",
+	"r12",
+	"r13",
+	"r14",
+	"r15",
+	"pc",
+	"pr",
+};
+
+/* Return architecture dependent register string (for kprobe-tracer) */
+const char *get_arch_regstr(unsigned int n)
 {
-	WARN_ON(nr_context_switches() > 0);
-	rcu_scheduler_active = 1;
+	return (n <= SH_MAX_REGS) ? sh_regs_table[n] : NULL;
 }
-
-#endif /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */

      parent reply	other threads:[~2010-07-16  4:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-10 15:10 [PATCH] perf: " Matt Fleming
2010-07-12  1:54 ` Masami Hiramatsu
2010-07-12  6:23   ` Matt Fleming
2010-07-12  6:41     ` Paul Mundt
2010-07-12  8:14       ` Matt Fleming
2010-07-12  8:55       ` Masami Hiramatsu
2010-07-12  8:57 ` Masami Hiramatsu
2010-07-12 17:14   ` Arnaldo Carvalho de Melo
2010-07-16  4:21 ` tip-bot for Matt Fleming [this message]

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=tip-0dd9ac63ce26ec87b080ca9c3e6efed33c23ace6@git.kernel.org \
    --to=matt@console-pimps.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=hpa@zytor.com \
    --cc=imunsie@au.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    --cc=tglx@linutronix.de \
    /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

Powered by JetHome