All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Philippe Gerum <rpm@xenomai.org>
Cc: adeos-main <adeos-main@gna.org>
Subject: [Adeos-main] [PATCH 1/2] various tracer cleanups
Date: Mon, 08 Jan 2007 23:20:44 +0100	[thread overview]
Message-ID: <45A2C3BC.7070705@domain.hid> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 208 bytes --]

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

[-- Attachment #1.2: tracer-cleanups.patch --]
[-- Type: text/plain, Size: 5122 bytes --]

---
 arch/i386/kernel/mcount.S |   54 +++++++++++++++++++++++-----------------------
 kernel/ipipe/core.c       |    2 -
 kernel/ipipe/tracer.c     |   24 ++++++++++----------
 3 files changed, 40 insertions(+), 40 deletions(-)

Index: linux-2.6.19-ipipe/arch/i386/kernel/mcount.S
===================================================================
--- linux-2.6.19-ipipe.orig/arch/i386/kernel/mcount.S
+++ linux-2.6.19-ipipe/arch/i386/kernel/mcount.S
@@ -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
Index: linux-2.6.19-ipipe/kernel/ipipe/tracer.c
===================================================================
--- linux-2.6.19-ipipe.orig/kernel/ipipe/tracer.c
+++ linux-2.6.19-ipipe/kernel/ipipe/tracer.c
@@ -128,9 +128,9 @@ static IPIPE_DEFINE_SPINLOCK(global_path
 static 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, c
 	if (((*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 fi
 	if (((*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) {
Index: linux-2.6.19-ipipe/kernel/ipipe/core.c
===================================================================
--- linux-2.6.19-ipipe.orig/kernel/ipipe/core.c
+++ linux-2.6.19-ipipe/kernel/ipipe/core.c
@@ -1374,7 +1374,7 @@ void __ipipe_remove_domain_proc(struct i
 	remove_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);

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

                 reply	other threads:[~2007-01-08 22:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45A2C3BC.7070705@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=adeos-main@gna.org \
    --cc=rpm@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.