Skip to contentSkip to conversation

LTTng : Linux Trace Toolkit Next Generation 0.5.95, kernel 2.6.17

PATCH New Mathieu Desnoyers 1 participant 1 message Aug 30, 2006 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 15/16 LTTng : Linux Trace Toolkit Next Generation 0.5.95, kernel 2.6.17

15- LTTng architecture dependant instrumentation --- sh (incomplete) patch-2.6.17-lttng-0.5.95-instrumentation-sh.diff

OpenPGP public key:              http://krystal.dyndns.org:8080/key/compudj.gpg
Key fingerprint:     8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68 
arch/sh/kernel/irq.c +2 -0
@@ -12,6 +12,8 @@ #include <linux/irq.h>
 #include <linux/interrupt.h>
 #include <linux/kernel_stat.h>
 #include <linux/seq_file.h>
+#include <linux/ltt-events.h>
+
 #include <asm/irq.h>
 #include <asm/processor.h>
 #include <asm/cpu/mmu_context.h>
arch/sh/kernel/process.c +1 -0
index 22dc9c2..4af1849 100644
@@ -21,6 +21,7 @@ #include <linux/pm.h>
 #include <linux/ptrace.h>
 #include <linux/kallsyms.h>
 #include <linux/kexec.h>
+#include <linux/ltt-events.h>
 
 #include <asm/io.h>
 #include <asm/uaccess.h>
arch/sh/kernel/sys_sh.c +3 -0
index 917b2f3..d4a8619 100644
@@ -21,6 +21,7 @@ #include <linux/syscalls.h>
 #include <linux/mman.h>
 #include <linux/file.h>
 #include <linux/utsname.h>
+#include <linux/ltt-events.h>
 
 #include <asm/uaccess.h>
 #include <asm/ipc.h>
@@ -174,6 +175,8 @@ asmlinkage int sys_ipc(uint call, int fi
 	version = call >> 16; /* hack for backward compatibility */
 	call &= 0xffff;
 
+	ltt_ev_ipc(LTT_EV_IPC_CALL, call, first);
+
 	if (call <= SEMCTL)
 		switch (call) {
 		case SEMOP:
arch/sh/kernel/traps.c +76 -2

108 lines not on this page · raw message

arch/sh/mm/fault.c +13 -0
index 775f86c..f3f08b3 100644
@@ -21,6 +21,7 @@ #include <linux/smp.h>
 #include <linux/smp_lock.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
+#include <linux/ltt-events.h>
 
 #include <asm/system.h>
 #include <asm/io.h>
@@ -53,6 +54,14 @@ #endif
 	tsk = current;
 	mm = tsk->mm;
 
+#ifdef CONFIG_LTT
+	{
+		unsigned long trapnr;
+		asm volatile("stc       r2_bank,%0": "=r" (trapnr));
+		ltt_ev_trap_entry(trapnr >> 5, regs->pc);  /* trap 4,5 or 6 */
+	}
+#endif
+
 	/*
 	 * If we're in an interrupt or have no user
 	 * context, we must not take the fault..
@@ -106,6 +115,7 @@ survive:
 	}
 
 	up_read(&mm->mmap_sem);
+	ltt_ev_trap_exit();
 	return;
 
 /*
@@ -119,6 +129,7 @@ bad_area:
 		tsk->thread.address = address;
 		tsk->thread.error_code = writeaccess;
 		force_sig(SIGSEGV, tsk);
+		ltt_ev_trap_exit();
 		return;
 	}
 
@@ -185,6 +196,8 @@ do_sigbus:
 	/* Kernel mode? Handle exceptions or die */
 	if (!user_mode(regs))
 		goto no_context;
+
+	ltt_ev_trap_exit();
 }
 
 /*
arch/x86_64/Kconfig +0 -0
index 408d44a..1937b8b 100644