aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/process_64.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2008-09-21 00:56:39 -0400
committerPaul Mundt <lethal@linux-sh.org>2008-09-21 00:56:39 -0400
commit3d58695edbfac785161bf282dc11fd42a483d6c9 (patch)
tree08b2fc39eda15082d1dba142d6d76a9a05de7efe /arch/sh/kernel/process_64.c
parent8f2baee28093ea77c7cc8da45049fd94cc76998e (diff)
sh: Trivial trace_mark() instrumentation for core events.
This implements a few trace points across events that are deemed interesting. This implements a number of trace points: - The page fault handler / TLB miss - IPC calls - Kernel thread creation The original LTTng patch had the slow-path instrumented, which fails to account for the vast majority of events. In general placing this in the fast-path is not a huge performance hit, as we don't take page faults for kernel addresses. The other bits of interest are some of the other trap handlers, as well as the syscall entry/exit (which is better off being handled through the tracehook API). Most of the other trap handlers are corner cases where alternate means of notification exist, so there is little value in placing extra trace points in these locations. Based on top of the points provided both by the LTTng instrumentation patch as well as the patch shipping in the ST-Linux tree, albeit in a stripped down form. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/process_64.c')
-rw-r--r--arch/sh/kernel/process_64.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/sh/kernel/process_64.c b/arch/sh/kernel/process_64.c
index d0dddc438c0c..b7aa09235b51 100644
--- a/arch/sh/kernel/process_64.c
+++ b/arch/sh/kernel/process_64.c
@@ -396,6 +396,7 @@ ATTRIB_NORET void kernel_thread_helper(void *arg, int (*fn)(void *))
396int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) 396int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
397{ 397{
398 struct pt_regs regs; 398 struct pt_regs regs;
399 int pid;
399 400
400 memset(&regs, 0, sizeof(regs)); 401 memset(&regs, 0, sizeof(regs));
401 regs.regs[2] = (unsigned long)arg; 402 regs.regs[2] = (unsigned long)arg;
@@ -404,8 +405,13 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
404 regs.pc = (unsigned long)kernel_thread_helper; 405 regs.pc = (unsigned long)kernel_thread_helper;
405 regs.sr = (1 << 30); 406 regs.sr = (1 << 30);
406 407
407 return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, 408 /* Ok, create the new process.. */
408 &regs, 0, NULL, NULL); 409 pid = do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0,
410 &regs, 0, NULL, NULL);
411
412 trace_mark(kernel_arch_kthread_create, "pid %d fn %p", pid, fn);
413
414 return pid;
409} 415}
410 416
411/* 417/*