lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 16 Jul 2010 04:21:49 GMT
From:	tip-bot for Matt Fleming <matt@...sole-pimps.org>
To:	linux-tip-commits@...r.kernel.org
Cc:	acme@...hat.com, linux-kernel@...r.kernel.org, paulus@...ba.org,
	hpa@...or.com, mingo@...hat.com, a.p.zijlstra@...llo.nl,
	masami.hiramatsu.pt@...achi.com, matt@...sole-pimps.org,
	imunsie@...ibm.com, tglx@...utronix.de, mingo@...e.hu
Subject: [tip:perf/core] perf tools: Add DWARF register lookup for SH

Commit-ID:  0dd9ac63ce26ec87b080ca9c3e6efed33c23ace6
Gitweb:     http://git.kernel.org/tip/0dd9ac63ce26ec87b080ca9c3e6efed33c23ace6
Author:     Matt Fleming <matt@...sole-pimps.org>
AuthorDate: Sat, 10 Jul 2010 16:10:39 +0100
Committer:  Arnaldo Carvalho de Melo <acme@...hat.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@...achi.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Ingo Molnar <mingo@...e.hu>
Cc: Ian Munsie <imunsie@...ibm.com>
LKML-Reference: <e55812819ad18c2ceca5651ac7698a2af46180d7.1278774279.git.matt@...sole-pimps.org>
Signed-off-by: Matt Fleming <matt@...sole-pimps.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.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@...sole-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@...ux.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 */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ