[ltt-dev] [PATCH] sh: added LTT_DUMP_TABLES support

Giuseppe CAVALLARO peppe.cavallaro at st.com
Fri Jul 31 07:43:26 EDT 2009


Only support syscall descriptor table listening
for SUPERH32.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro at st.com>
---
 arch/sh/Kconfig            |    1 +
 arch/sh/kernel/ptrace_32.c |   24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 1222328..80a466f 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -32,6 +32,7 @@ config SUPERH32
 	select HAVE_DYNAMIC_FTRACE
 	select HAVE_ARCH_KGDB
 	select ARCH_HIBERNATION_POSSIBLE if MMU
+	select HAVE_LTT_DUMP_TABLES
 
 config SUPERH64
 	def_bool ARCH = "sh64"
diff --git a/arch/sh/kernel/ptrace_32.c b/arch/sh/kernel/ptrace_32.c
index 1835fd1..fc1b58f 100644
--- a/arch/sh/kernel/ptrace_32.c
+++ b/arch/sh/kernel/ptrace_32.c
@@ -26,6 +26,9 @@
 #include <linux/tracehook.h>
 #include <linux/elf.h>
 #include <linux/regset.h>
+#include <linux/module.h>
+#include <linux/kallsyms.h>
+#include <linux/marker.h>
 #include <trace/syscall.h>
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
@@ -34,10 +37,31 @@
 #include <asm/mmu_context.h>
 #include <asm/syscalls.h>
 #include <asm/fpu.h>
+#include <asm/unistd.h>
 
 DEFINE_TRACE(syscall_entry);
 DEFINE_TRACE(syscall_exit);
 
+extern unsigned long sys_call_table[];
+void ltt_dump_sys_call_table(void *call_data)
+{
+	int i;
+	char namebuf[KSYM_NAME_LEN];
+
+	for (i = 0; i < NR_syscalls; i++) {
+		sprint_symbol(namebuf, sys_call_table[i]);
+		__trace_mark(0, syscall_state, sys_call_table, call_data,
+			"id %d address %p symbol %s",
+			i, (void *)sys_call_table[i], namebuf);
+	}
+}
+EXPORT_SYMBOL_GPL(ltt_dump_sys_call_table);
+
+void ltt_dump_idt_table(void *call_data)
+{
+}
+EXPORT_SYMBOL_GPL(ltt_dump_idt_table);
+
 /*
  * This routine will get a word off of the process kernel stack.
  */
-- 
1.6.0.4





More information about the lttng-dev mailing list