[PATCH] MIPS fixups for LTTng (update)

Manish Lachwani <[email protected]>
Newsgroups gmane.linux.kernel.tracing
Message-ID <[email protected]>
Hi!

The previous patch did not cover all fixes needed for MIPS (32-bit) to work. The attached
patch covers all fixes now.

Btw, I have not tried MIPS 64-bit yet. There may be some added fixups there.

thanks,
Manish Lachwani
mips_lttng_fixups.patch (text/plain, 4 KB)
Source: MontaVista Software, Inc. | Manish Lachwani <[email protected]>
Type: Defect Fix 
Signed-off-by: Manish Lachwani <[email protected]>
Description:

Miscellaneous fixups for LTT on MIPS

 arch/mips/kernel/process.c     |    4 ----
 arch/mips/kernel/scall32-o32.S |    9 ---------
 arch/mips/kernel/traps.c       |    7 -------
 arch/mips/mm/fault.c           |    6 ------
 4 files changed, 26 deletions(-)

Index: linux-2.6.18/arch/mips/kernel/process.c
===================================================================
--- linux-2.6.18.orig/arch/mips/kernel/process.c
+++ linux-2.6.18/arch/mips/kernel/process.c
@@ -276,10 +276,6 @@ long kernel_thread(int (*fn)(void *), vo
 	pid = do_fork(flags | CLONE_VM | CLONE_UNTRACED,
 			0, &regs, 0, NULL, NULL);
 	MARK(kernel_thread_create, "%ld %p", pid, fn);
-#ifdef CONFIG_LTT
-	if(pid >= 0)
-		trace_process_kernel_thread(pid, fn);
-#endif //CONFIG_LTT
 	return pid;
 }
 
Index: linux-2.6.18/arch/mips/kernel/scall32-o32.S
===================================================================
--- linux-2.6.18.orig/arch/mips/kernel/scall32-o32.S
+++ linux-2.6.18/arch/mips/kernel/scall32-o32.S
@@ -69,7 +69,6 @@ stack_done:
 #ifdef CONFIG_LTT
 	sw  t2, PT_R1(sp)
 	move  a0, sp
-	jal     trace_real_syscall_entry
 	lw  t2, PT_R1(sp)
 
 	lw  a0, PT_R4(sp)		# Restore argument registers
@@ -94,10 +93,6 @@ stack_done:
 					# restarting
 1:	sw	v0, PT_R2(sp)		# result
 
-#ifdef CONFIG_LTT
-	jal trace_real_syscall_exit
-#endif // CONFIG_LTT
-
 o32_syscall_exit:
 	raw_local_irq_disable	# make sure need_resched and
 					# signals dont change between
@@ -139,10 +134,6 @@ syscall_trace_entry:
 					# restarting
 1:	sw	v0, PT_R2(sp)		# result
 
-#ifdef CONFIG_LTT
- jal trace_real_syscall_exit
-#endif //CONFIG_LTT)
-
 	j	syscall_exit
 
 /* ------------------------------------------------------------------------ */
Index: linux-2.6.18/arch/mips/kernel/traps.c
===================================================================
--- linux-2.6.18.orig/arch/mips/kernel/traps.c
+++ linux-2.6.18/arch/mips/kernel/traps.c
@@ -591,7 +591,6 @@ asmlinkage void do_fpe(struct pt_regs *r
 {
 	die_if_kernel("FP exception in kernel code", regs);
 
-	trace_kernel_trap_entry(CAUSE_EXCCODE(regs->cp0_cause), (void*)regs->cp0_epc);
 	if (fcr31 & FPU_CSR_UNI_X) {
 		int sig;
 
@@ -748,20 +747,16 @@ asmlinkage void do_cpu(struct pt_regs *r
 
 	die_if_kernel("do_cpu invoked from kernel context!", regs);
 
-	trace_kernel_trap_entry(CAUSE_EXCCODE(regs->cp0_cause), (void*)regs->cp0_epc);
-
 	cpid = (regs->cp0_cause >> CAUSEB_CE) & 3;
 
 	switch (cpid) {
 	case 0:
 		if (!cpu_has_llsc)
 			if (!simulate_llsc(regs)) {
-				trace_kernel_trap_exit();
 				return;
 			}
 
 		if (!simulate_rdhwr(regs)) {
-			trace_kernel_trap_exit();
 			return;
 		}
 
@@ -818,7 +813,6 @@ asmlinkage void do_cpu(struct pt_regs *r
 			}
 #endif /* CONFIG_MIPS_MT_FPAFF */
 		}
-		trace_kernel_trap_exit();
 		return;
 
 	case 2:
@@ -828,7 +822,6 @@ asmlinkage void do_cpu(struct pt_regs *r
 	}
 
 	force_sig(SIGILL, current);
-	trace_kernel_trap_exit();
 }
 
 asmlinkage void do_mdmx(struct pt_regs *regs)
Index: linux-2.6.18/arch/mips/mm/fault.c
===================================================================
--- linux-2.6.18.orig/arch/mips/mm/fault.c
+++ linux-2.6.18/arch/mips/mm/fault.c
@@ -115,7 +115,6 @@ survive:
 	}
 
 	up_read(&mm->mmap_sem);
-	trace_kernel_trap_exit();
 	return;
 
 /*
@@ -144,7 +143,6 @@ bad_area_nosemaphore:
 		/* info.si_code has been set above */
 		info.si_addr = (void __user *) address;
 		force_sig_info(SIGSEGV, &info, tsk);
-		trace_kernel_trap_exit();
 		return;
 	}
 
@@ -210,7 +208,6 @@ do_sigbus:
 	info.si_addr = (void __user *) address;
 	force_sig_info(SIGBUS, &info, tsk);
 
-	trace_kernel_trap_exit();
 	return;
 vmalloc_fault:
 	{
@@ -248,9 +245,6 @@ vmalloc_fault:
 		pte_k = pte_offset_kernel(pmd_k, address);
 		if (!pte_present(*pte_k))
 			goto no_context;
-		trace_kernel_trap_entry(CAUSE_EXCCODE(regs->cp0_cause), (void*)regs->cp0_epc);
-		trace_kernel_trap_exit();
 		return;
 	}
-	trace_kernel_trap_exit();
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.