various tracer cleanups
PATCH 1/2 various tracer cleanups
The first of the two patches pending in my repos for too long. This one reformats i386's mcount.S and fixes some comments, turns mutex-semaphores into real mutexes, and does further minor cleanups.
Jan
--- arch/i386/kernel/mcount.S | 54 +++++++++++++++++++++++----------------------- kernel/ipipe/core.c | 2 - kernel/ipipe/tracer.c | 24 ++++++++++---------- 3 files changed, 40 insertions(+), 40 deletions(-)
arch/i386/kernel/mcount.S +27 -27
@@ -6,38 +6,38 @@ .globl mcount mcount: - cmpl $0,ipipe_trace_enable - je out + cmpl $0,ipipe_trace_enable + je out - pushl %ebp - movl %esp,%ebp + pushl %ebp + movl %esp,%ebp - pushl %eax - pushl %ecx - pushl %edx + pushl %eax + pushl %ecx + pushl %edx - pushl $0 # no additional value (v) + pushl $0 # no additional value (v) #ifdef CONFIG_REGPARM - movl (%ebp),%eax - movl 0x4(%ebp),%edx # __CALLER_ADDR0 - movl 0x4(%eax),%ecx # __CALLER_ADDR1 - movl $0,%eax # IPIPE_TRACE_FN - call __ipipe_trace - popl %eax + movl (%ebp),%eax + movl 0x4(%ebp),%edx # __CALLER_ADDR0 + movl 0x4(%eax),%ecx # __CALLER_ADDR1 + movl $0,%eax # IPIPE_TRACE_FUNC + call __ipipe_trace + popl %eax #else /* !CONFIG_REGPARM */ - movl (%ebp),%eax - movl 0x4(%eax),%eax - pushl %eax # __CALLER_ADDR1 - movl 0x4(%ebp),%eax - pushl %eax # __CALLER_ADDR0 - pushl $0 # IPIPE_TRACE_FN - call __ipipe_trace - addl $0x10,%esp + movl (%ebp),%eax + movl 0x4(%eax),%eax + pushl %eax # __CALLER_ADDR1 + movl 0x4(%ebp),%eax + pushl %eax # __CALLER_ADDR0 + pushl $0 # IPIPE_TRACE_FUNC + call __ipipe_trace + addl $0x10,%esp #endif /* CONFIG_REGPARM */ - popl %edx - popl %ecx - popl %eax - popl %ebp + popl %edx + popl %ecx + popl %eax + popl %ebp out: - ret + ret
kernel/ipipe/tracer.c +12 -12
@@ -128,9 +128,9 @@ static IPIPE_DEFINE_SPINLOCK(global_pathstatic int pre_trace =IPIPE_DEFAULT_PRE_TRACE ;static int post_trace =IPIPE_DEFAULT_POST_TRACE ;static int back_trace =IPIPE_DEFAULT_BACK_TRACE ; -static int verbose_trace =0 ; +static int verbose_trace; -static DECLARE_MUTEX (out_mutex); +static DEFINE_MUTEX (out_mutex);static struct ipipe_trace_path *print_path;static struct ipipe_trace_path *panic_path;static int print_pre_trace;
@@ -869,7 +869,7 @@ static void *__ipipe_max_prtrace_start(s {loff_t n = *pos; -down (&out_mutex); +mutex_lock (&out_mutex);if (!n) {struct ipipe_trace_path *path;
@@ -951,7 +951,7 @@ static void __ipipe_prtrace_stop(struct {if (print_path) print_path->dump_lock =0 ; -up (&out_mutex); +mutex_unlock (&out_mutex); }static int __ipipe_prtrace_show (struct seq_file *m,void *p)
@@ -1012,9 +1012,9 @@ static ssize_t __ipipe_max_reset(struct file *file, const char __user *pbuffer, size_t count, loff_t *data) { - down(&out_mutex); + mutex_lock(&out_mutex);ipipe_trace_max_reset (); -up (&out_mutex); +mutex_unlock (&out_mutex);return count; }
@@ -1031,7 +1031,7 @@ static void *__ipipe_frozen_prtrace_star {loff_t n = *pos; -down (&out_mutex); +mutex_lock (&out_mutex);if (!n) {struct ipipe_trace_path *path;
@@ -1119,11 +1119,11 @@ __ipipe_frozen_ctrl(struct file *file, cif (((*end !='\0' ) && !isspace (*end)) || (val <0 ))return -EINVAL ; -down (&out_mutex); +mutex_lock (&out_mutex);ipipe_trace_frozen_reset ();if (val >0 )ipipe_trace_freeze (-1 ); -up (&out_mutex); +mutex_unlock (&out_mutex);return count; }
@@ -1172,9 +1172,9 @@ static int __ipipe_wr_proc_val(struct fiif (((*end !='\0' ) && !isspace (*end)) || (val <0 ))return -EINVAL ; -down (&out_mutex); +mutex_lock (&out_mutex); *(int *)data = val; -up (&out_mutex); +mutex_unlock (&out_mutex);return count; }
@@ -1203,7 +1203,7 @@ void __init __ipipe_init_tracer(void)#ifdef CONFIG_IPIPE_TRACE_VMALLOC int cpu, path; -for (cpu =0 ; cpu <NR_CPUS ; cpu++) { +foreach_possible_cpu (cpu) { trace_paths[cpu] =vmalloc (sizeof (struct ipipe_trace_path ) *IPIPE_TRACE_PATHS );if (!trace_paths) {
kernel/ipipe/core.c +1 -1
@@ -1374,7 +1374,7 @@ void __ipipe_remove_domain_proc(struct iremove_proc_entry (ipd->name,ipipe_proc_root); } -void ipipe_init_proc (void ) +void __init ipipe_init_proc (void ) { ipipe_proc_root =create_proc_entry ("ipipe" ,S_IFDIR ,0 );create_proc_read_entry ("version" ,0444 ,ipipe_proc_root,&__ipipe_version_info_proc,NULL );