linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] ftrace: updates to recordmcount.pl script
@ 2008-11-20 20:34 Steven Rostedt
  2008-11-20 20:34 ` [PATCH 1/3] sh: dynamic ftrace support Steven Rostedt
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Steven Rostedt @ 2008-11-20 20:34 UTC (permalink / raw)
  To: linux-kernel
  Cc: Matt Fleming, Jim Radford, linuxppc-dev, Paul Mundt, Ingo Molnar,
	Andrew Morton

Ingo,

I took Matt's patch and stripped out all the sh changes, leaving
only the update to recordmcount.pl. Hopefully, this will disappear
when it is pulled into linux-next.

The second patch is the changes needed for PowerPC in the recordmcount.pl
script.

The thrird patch is the cleanup.

All of this is based off of tip/master.

The following patches are in:

  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git

    branch: tip/devel


Matt Fleming (1):
      sh: dynamic ftrace support.

Steven Rostedt (2):
      ftrace: add support for powerpc to recordmcount.pl script
      ftrace: create default variables for archs in recordmcount.pl

----
 scripts/recordmcount.pl |   37 +++++++++++++++++++++++++++++--------
 1 files changed, 29 insertions(+), 8 deletions(-)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/3] sh: dynamic ftrace support.
  2008-11-20 20:34 [PATCH 0/3] ftrace: updates to recordmcount.pl script Steven Rostedt
@ 2008-11-20 20:34 ` Steven Rostedt
  2008-11-21  7:44   ` Paul Mundt
  2008-11-20 20:34 ` [PATCH 2/3] ftrace: add support for powerpc to recordmcount.pl script Steven Rostedt
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Steven Rostedt @ 2008-11-20 20:34 UTC (permalink / raw)
  To: linux-kernel
  Cc: Matt Fleming, Jim Radford, linuxppc-dev, Steven Rostedt,
	Paul Mundt, Ingo Molnar, Andrew Morton

From: Matt Fleming <mjf@gentoo.org>

First cut at dynamic ftrace support.

[
  Steven Rostedt - only updated the recordmcount.pl file.
    There are updates for PowerPC that will conflict with this,
    and we need to base off of these changes.
]

Signed-off-by: Matt Fleming <mjf@gentoo.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
---
 scripts/recordmcount.pl |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index eeac71c..9f75438 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -170,6 +170,17 @@ if ($arch eq "x86_64") {
     $objcopy .= " -O elf32-i386";
     $cc .= " -m32";
 
+} elsif ($arch eq "sh") {
+    $section_regex = "Disassembly of section\\s+(\\S+):";
+    $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:";
+    $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$";
+    $type = ".long";
+
+    # force flags for this arch
+    $ld .= " -m shlelf_linux";
+    $objcopy .= " -O elf32-sh-linux";
+    $cc .= " -m32";
+
 } else {
     die "Arch $arch is not supported with CONFIG_FTRACE_MCOUNT_RECORD";
 }
-- 
1.5.6.5

-- 

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/3] ftrace: add support for powerpc to recordmcount.pl script
  2008-11-20 20:34 [PATCH 0/3] ftrace: updates to recordmcount.pl script Steven Rostedt
  2008-11-20 20:34 ` [PATCH 1/3] sh: dynamic ftrace support Steven Rostedt
@ 2008-11-20 20:34 ` Steven Rostedt
  2008-11-20 20:34 ` [PATCH 3/3] ftrace: create default variables for archs in recordmcount.pl Steven Rostedt
  2008-11-20 22:04 ` [PATCH] ftrace: mcountrecord.pl for arm Jim Radford
  3 siblings, 0 replies; 10+ messages in thread
From: Steven Rostedt @ 2008-11-20 20:34 UTC (permalink / raw)
  To: linux-kernel
  Cc: Matt Fleming, Jim Radford, linuxppc-dev, Steven Rostedt,
	Paul Mundt, Ingo Molnar, Andrew Morton

From: Steven Rostedt <srostedt@redhat.com>

Impact: Add PowerPC port to recordmcount.pl script

This patch updates the recordmcount.pl script to process
PowerPC.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
---
 scripts/recordmcount.pl |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index 9f75438..7ec032e 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -130,6 +130,7 @@ my %weak;		# List of weak functions
 my %convert;		# List of local functions used that needs conversion
 
 my $type;
+my $nm_regex;		# Find the local functions (return function)
 my $section_regex;	# Find the start of a section
 my $function_regex;	# Find the name of a function
 			#    (return offset and func name)
@@ -145,6 +146,7 @@ if ($arch eq "x86") {
 }
 
 if ($arch eq "x86_64") {
+    $nm_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\S+)";
     $section_regex = "Disassembly of section\\s+(\\S+):";
     $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:";
     $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount([+-]0x[0-9a-zA-Z]+)?\$";
@@ -158,6 +160,7 @@ if ($arch eq "x86_64") {
     $cc .= " -m64";
 
 } elsif ($arch eq "i386") {
+    $nm_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\S+)";
     $section_regex = "Disassembly of section\\s+(\\S+):";
     $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:";
     $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$";
@@ -171,6 +174,7 @@ if ($arch eq "x86_64") {
     $cc .= " -m32";
 
 } elsif ($arch eq "sh") {
+    $nm_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\S+)";
     $section_regex = "Disassembly of section\\s+(\\S+):";
     $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:";
     $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$";
@@ -181,6 +185,17 @@ if ($arch eq "x86_64") {
     $objcopy .= " -O elf32-sh-linux";
     $cc .= " -m32";
 
+} elsif ($arch eq "powerpc") {
+    $nm_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\.?\\S+)";
+    $section_regex = "Disassembly of section\\s+(\\S+):";
+    $function_regex = "^([0-9a-fA-F]+)\\s+<(\\.?.*?)>:";
+    $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s\\.?_mcount\$";
+    if ($bits == 64) {
+	$type = ".quad";
+    } else {
+	$type = ".long";
+    }
+
 } else {
     die "Arch $arch is not supported with CONFIG_FTRACE_MCOUNT_RECORD";
 }
@@ -250,7 +265,7 @@ if (!$found_version) {
 #
 open (IN, "$nm $inputfile|") || die "error running $nm";
 while (<IN>) {
-    if (/^[0-9a-fA-F]+\s+t\s+(\S+)/) {
+    if (/$nm_regex/) {
 	$locals{$1} = 1;
     } elsif (/^[0-9a-fA-F]+\s+([wW])\s+(\S+)/) {
 	$weak{$2} = $1;
@@ -302,7 +317,7 @@ sub update_funcs
 	    open(FILE, ">$mcount_s") || die "can't create $mcount_s\n";
 	    $opened = 1;
 	    print FILE "\t.section $mcount_section,\"a\",\@progbits\n";
-	    print FILE "\t.align $alignment\n";
+	    print FILE "\t.align $alignment\n" if (defined($alignment));
 	}
 	printf FILE "\t%s %s + %d\n", $type, $ref_func, $offsets[$i] - $offset;
     }
-- 
1.5.6.5

-- 

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/3] ftrace: create default variables for archs in recordmcount.pl
  2008-11-20 20:34 [PATCH 0/3] ftrace: updates to recordmcount.pl script Steven Rostedt
  2008-11-20 20:34 ` [PATCH 1/3] sh: dynamic ftrace support Steven Rostedt
  2008-11-20 20:34 ` [PATCH 2/3] ftrace: add support for powerpc to recordmcount.pl script Steven Rostedt
@ 2008-11-20 20:34 ` Steven Rostedt
  2008-11-20 22:04 ` [PATCH] ftrace: mcountrecord.pl for arm Jim Radford
  3 siblings, 0 replies; 10+ messages in thread
From: Steven Rostedt @ 2008-11-20 20:34 UTC (permalink / raw)
  To: linux-kernel
  Cc: Matt Fleming, Jim Radford, linuxppc-dev, Steven Rostedt,
	Paul Mundt, Ingo Molnar, Andrew Morton

From: Steven Rostedt <srostedt@redhat.com>

Impact: cleanup of recordmcount.pl

Now that more architectures are being ported to the MCOUNT_RECORD
method, there is no reason to have each declare their own arch
specific variable if most of them share the same value. This patch
creates a set of default values for the arch specific variables
based off of i386.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
---
 scripts/recordmcount.pl |   27 +++++++++++----------------
 1 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index 7ec032e..c5c58ac 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -145,10 +145,17 @@ if ($arch eq "x86") {
     }
 }
 
+#
+# We base the defaults off of i386, the other archs may
+# feel free to change them in the below if statements.
+#
+$nm_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\S+)";
+$section_regex = "Disassembly of section\\s+(\\S+):";
+$function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:";
+$mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$";
+$type = ".long";
+
 if ($arch eq "x86_64") {
-    $nm_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\S+)";
-    $section_regex = "Disassembly of section\\s+(\\S+):";
-    $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:";
     $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount([+-]0x[0-9a-zA-Z]+)?\$";
     $type = ".quad";
     $alignment = 8;
@@ -160,11 +167,6 @@ if ($arch eq "x86_64") {
     $cc .= " -m64";
 
 } elsif ($arch eq "i386") {
-    $nm_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\S+)";
-    $section_regex = "Disassembly of section\\s+(\\S+):";
-    $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:";
-    $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$";
-    $type = ".long";
     $alignment = 4;
 
     # force flags for this arch
@@ -174,11 +176,6 @@ if ($arch eq "x86_64") {
     $cc .= " -m32";
 
 } elsif ($arch eq "sh") {
-    $nm_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\S+)";
-    $section_regex = "Disassembly of section\\s+(\\S+):";
-    $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:";
-    $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$";
-    $type = ".long";
 
     # force flags for this arch
     $ld .= " -m shlelf_linux";
@@ -187,13 +184,11 @@ if ($arch eq "x86_64") {
 
 } elsif ($arch eq "powerpc") {
     $nm_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\.?\\S+)";
-    $section_regex = "Disassembly of section\\s+(\\S+):";
     $function_regex = "^([0-9a-fA-F]+)\\s+<(\\.?.*?)>:";
     $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s\\.?_mcount\$";
+
     if ($bits == 64) {
 	$type = ".quad";
-    } else {
-	$type = ".long";
     }
 
 } else {
-- 
1.5.6.5

-- 

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH] ftrace: mcountrecord.pl for arm
  2008-11-20 20:34 [PATCH 0/3] ftrace: updates to recordmcount.pl script Steven Rostedt
                   ` (2 preceding siblings ...)
  2008-11-20 20:34 ` [PATCH 3/3] ftrace: create default variables for archs in recordmcount.pl Steven Rostedt
@ 2008-11-20 22:04 ` Jim Radford
  2008-11-20 22:11   ` Jim Radford
  3 siblings, 1 reply; 10+ messages in thread
From: Jim Radford @ 2008-11-20 22:04 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Russell King - ARM Linux, Matt Fleming, linux-kernel,
	linuxppc-dev, Paul Mundt, Ingo Molnar, Sam Ravnborg,
	Andrew Morton

Ingo and Steven,

Here is a patch on top of Steven's for recordmcount.pl on arm.

-Jim

---
From: Jim Radford <radford@galvanix.com>
Subject: ftrace: mcountrecord.pl for arm

Signed-Off-By: Jim Radford <radford@galvanix.com>

diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index c5c58ac..3d16795 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -135,6 +135,7 @@ my $section_regex;	# Find the start of a section
 my $function_regex;	# Find the name of a function
 			#    (return offset and func name)
 my $mcount_regex;	# Find the call site to mcount (return offset)
+my $section_type;	# Section header plus possible alignment command
 my $alignment;         # The .align value to use for $mcount_section
 
 if ($arch eq "x86") {
@@ -153,6 +154,7 @@ $nm_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\S+)";
 $section_regex = "Disassembly of section\\s+(\\S+):";
 $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:";
 $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$";
+$section_type = '@progbits';
 $type = ".long";
 
 if ($arch eq "x86_64") {
@@ -191,6 +193,10 @@ if ($arch eq "x86_64") {
 	$type = ".quad";
     }
 
+} elsif ($arch eq "arm") {
+    $alignment = 2;
+    $section_type = '%progbits';
+
 } else {
     die "Arch $arch is not supported with CONFIG_FTRACE_MCOUNT_RECORD";
 }
@@ -311,7 +317,7 @@ sub update_funcs
 	if (!$opened) {
 	    open(FILE, ">$mcount_s") || die "can't create $mcount_s\n";
 	    $opened = 1;
-	    print FILE "\t.section $mcount_section,\"a\",\@progbits\n";
+	    print FILE "\t.section $mcount_section,\"a\",$section_type\n";
 	    print FILE "\t.align $alignment\n" if (defined($alignment));
 	}
 	printf FILE "\t%s %s + %d\n", $type, $ref_func, $offsets[$i] - $offset;

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] ftrace: mcountrecord.pl for arm
  2008-11-20 22:04 ` [PATCH] ftrace: mcountrecord.pl for arm Jim Radford
@ 2008-11-20 22:11   ` Jim Radford
  2008-11-21 13:11     ` Russell King - ARM Linux
  0 siblings, 1 reply; 10+ messages in thread
From: Jim Radford @ 2008-11-20 22:11 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Russell King - ARM Linux, Matt Fleming, linux-kernel,
	linux-arm-kernel, linuxppc-dev, Paul Mundt, Ingo Molnar,
	Sam Ravnborg, Andrew Morton

Ingo and Steven,

Here's an updated version of the arch/arm changes for dynamic ftrace
based on top of your latest tip/master.

-Jim

---
From: Jim Radford <radford@galvanix.com>
Subject: ftrace: enable dynamic ftrace for arm

Update to the latest api, syncing functions with the x86 versions.

Index: linux-2.6/arch/arm/Kconfig
===================================================================
--- linux-2.6.orig/arch/arm/Kconfig
+++ linux-2.6/arch/arm/Kconfig
@@ -16,7 +16,9 @@ config ARM
 	select HAVE_ARCH_KGDB
 	select HAVE_KPROBES if (!XIP_KERNEL)
 	select HAVE_KRETPROBES if (HAVE_KPROBES)
-	select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
+	select HAVE_FTRACE_MCOUNT_RECORD
+	select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL)
+	select HAVE_FUNCTION_TRACER
 	select HAVE_GENERIC_DMA_COHERENT
 	help
 	  The ARM series is a line of low-power-consumption RISC chip designs
Index: linux-2.6/arch/arm/include/asm/ftrace.h
===================================================================
--- linux-2.6.orig/arch/arm/include/asm/ftrace.h
+++ linux-2.6/arch/arm/include/asm/ftrace.h
@@ -7,6 +7,19 @@
 
 #ifndef __ASSEMBLY__
 extern void mcount(void);
+
+static inline unsigned long ftrace_call_adjust(unsigned long addr)
+{
+	return addr;
+}
+
+#ifdef CONFIG_DYNAMIC_FTRACE
+
+struct dyn_arch_ftrace {
+	/* No extra data needed for x86 */
+};
+
+#endif /*  CONFIG_DYNAMIC_FTRACE */
 #endif
 
 #endif
Index: linux-2.6/arch/arm/kernel/entry-common.S
===================================================================
--- linux-2.6.orig/arch/arm/kernel/entry-common.S
+++ linux-2.6/arch/arm/kernel/entry-common.S
@@ -104,14 +104,7 @@ ENDPROC(ret_from_fork)
 #ifdef CONFIG_FUNCTION_TRACER
 #ifdef CONFIG_DYNAMIC_FTRACE
 ENTRY(mcount)
-	stmdb sp!, {r0-r3, lr}
-	mov r0, lr
-	sub r0, r0, #MCOUNT_INSN_SIZE
-
-	.globl mcount_call
-mcount_call:
-	bl ftrace_stub
-	ldmia sp!, {r0-r3, pc}
+	mov pc, lr
 
 ENTRY(ftrace_caller)
 	stmdb sp!, {r0-r3, lr}
Index: linux-2.6/arch/arm/kernel/ftrace.c
===================================================================
--- linux-2.6.orig/arch/arm/kernel/ftrace.c
+++ linux-2.6/arch/arm/kernel/ftrace.c
@@ -23,13 +23,13 @@
 static unsigned long bl_insn;
 static const unsigned long NOP = 0xe1a00000; /* mov r0, r0 */
 
-unsigned char *ftrace_nop_replace(void)
+static unsigned char *ftrace_nop_replace(void)
 {
 	return (char *)&NOP;
 }
 
 /* construct a branch (BL) instruction to addr */
-unsigned char *ftrace_call_replace(unsigned long pc, unsigned long addr)
+static unsigned char *ftrace_call_replace(unsigned long pc, unsigned long addr)
 {
 	long offset;
 
@@ -46,7 +46,7 @@ unsigned char *ftrace_call_replace(unsig
 	return (unsigned char *)&bl_insn;
 }
 
-int ftrace_modify_code(unsigned long pc, unsigned char *old_code,
+static int ftrace_modify_code(unsigned long pc, unsigned char *old_code,
 		       unsigned char *new_code)
 {
 	unsigned long err = 0, replaced = 0, old, new;
@@ -82,22 +82,46 @@ int ftrace_modify_code(unsigned long pc,
 	return err;
 }
 
+int ftrace_make_nop(struct module *mod,
+		    struct dyn_ftrace *rec, unsigned long addr)
+{
+	unsigned char *new, *old;
+	unsigned long ip = rec->ip;
+
+	old = ftrace_call_replace(ip, addr);
+	new = ftrace_nop_replace();
+
+	return ftrace_modify_code(rec->ip, old, new);
+}
+
+int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
+{
+	unsigned char *new, *old;
+	unsigned long ip = rec->ip;
+
+	old = ftrace_nop_replace();
+	new = ftrace_call_replace(ip, addr);
+
+	return ftrace_modify_code(rec->ip, old, new);
+}
+
 int ftrace_update_ftrace_func(ftrace_func_t func)
 {
+	unsigned long ip = (unsigned long)(&ftrace_call);
+	unsigned char old[MCOUNT_INSN_SIZE], *new;
 	int ret;
-	unsigned long pc, old;
-	unsigned char *new;
 
-	pc = (unsigned long)&ftrace_call;
-	memcpy(&old, &ftrace_call, MCOUNT_INSN_SIZE);
-	new = ftrace_call_replace(pc, (unsigned long)func);
-	ret = ftrace_modify_code(pc, (unsigned char *)&old, new);
+	memcpy(old, &ftrace_call, sizeof(old));
+	new = ftrace_call_replace(ip, (unsigned long)func);
+	ret = ftrace_modify_code(ip, (unsigned char *)&old, new);
+
 	return ret;
 }
 
 /* run from kstop_machine */
 int __init ftrace_dyn_arch_init(void *data)
 {
-	ftrace_mcount_set(data);
+	/* The return code is retured via data */
+	*(unsigned long *)data = 0;
 	return 0;
 }

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/3] sh: dynamic ftrace support.
  2008-11-20 20:34 ` [PATCH 1/3] sh: dynamic ftrace support Steven Rostedt
@ 2008-11-21  7:44   ` Paul Mundt
  2008-11-21  9:00     ` Matt Fleming
  0 siblings, 1 reply; 10+ messages in thread
From: Paul Mundt @ 2008-11-21  7:44 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Matt Fleming, Jim Radford, linux-kernel, linuxppc-dev,
	Steven Rostedt, Ingo Molnar, Andrew Morton

On Thu, Nov 20, 2008 at 03:34:16PM -0500, Steven Rostedt wrote:
> +} elsif ($arch eq "sh") {
> +    $section_regex = "Disassembly of section\\s+(\\S+):";
> +    $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:";
> +    $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$";
> +    $type = ".long";
> +
> +    # force flags for this arch
> +    $ld .= " -m shlelf_linux";
> +    $objcopy .= " -O elf32-sh-linux";
> +    $cc .= " -m32";
> +

Note that if the $alignment changes are in this version, you will also
need to add an $alignment = 2; for sh. That was in Matt's original patch,
but I stripped the alignment line out in the commit given that it was not
yet present in the mainline version of the script.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/3] sh: dynamic ftrace support.
  2008-11-21  7:44   ` Paul Mundt
@ 2008-11-21  9:00     ` Matt Fleming
  0 siblings, 0 replies; 10+ messages in thread
From: Matt Fleming @ 2008-11-21  9:00 UTC (permalink / raw)
  To: Paul Mundt, Steven Rostedt, linux-kernel, Ingo Molnar,
	Andrew Morton, linuxppc-dev, Jim Radford, Steven Rostedt

On Fri, Nov 21, 2008 at 04:44:29PM +0900, Paul Mundt wrote:
> On Thu, Nov 20, 2008 at 03:34:16PM -0500, Steven Rostedt wrote:
> > +} elsif ($arch eq "sh") {
> > +    $section_regex = "Disassembly of section\\s+(\\S+):";
> > +    $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:";
> > +    $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$";
> > +    $type = ".long";
> > +
> > +    # force flags for this arch
> > +    $ld .= " -m shlelf_linux";
> > +    $objcopy .= " -O elf32-sh-linux";
> > +    $cc .= " -m32";
> > +
> 
> Note that if the $alignment changes are in this version, you will also
> need to add an $alignment = 2; for sh. That was in Matt's original patch,
> but I stripped the alignment line out in the commit given that it was not
> yet present in the mainline version of the script.

I've sent a patch to steven for his tip/devel branch that adds this line.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] ftrace: mcountrecord.pl for arm
  2008-11-20 22:11   ` Jim Radford
@ 2008-11-21 13:11     ` Russell King - ARM Linux
  2008-11-21 13:31       ` Steven Rostedt
  0 siblings, 1 reply; 10+ messages in thread
From: Russell King - ARM Linux @ 2008-11-21 13:11 UTC (permalink / raw)
  To: Jim Radford
  Cc: Matt Fleming, linux-kernel, Steven Rostedt, linux-arm-kernel,
	linuxppc-dev, Paul Mundt, Andrew Morton, Sam Ravnborg,
	Ingo Molnar

On Thu, Nov 20, 2008 at 02:11:49PM -0800, Jim Radford wrote:
> Ingo and Steven,
> 
> Here's an updated version of the arch/arm changes for dynamic ftrace
> based on top of your latest tip/master.

Excuse me if I'm rather confused, but...

When ftrace for ARM was originally merged, neither linux-arm-kernel
nor myself were copied with the patches.  Now, I'm being sent updates
to code that I've no understanding of and haven't seen before.

I mean, yes, it's nice to be copied with patches which are relevent.
It would've been even nicer to have been copied with the patches adding
ftrace in the first place, so people knew something about it and were
aware of the changes.

It seems to me like there's been a total breakdown of communication
when ftrace was initially merged...

So, questions: has ftrace actually been tested on ARM at all?  Has it
been reviewed?  Which ARM platforms has it been tried on?  How stable
is it?  How has it been implemented on ARM?  Does it rely on any CPU
specific behaviour?

Looking at the git history, ftrace was merged via Ingo, so I assume
that Ingo has some understanding of this code.  So, for the time being
if these are urgent updates, I suggest that updates go through Ingo's
tree rather than mine.

And looking at arch/arm/kernel/ftrace.c, it's incompatible with Thumb2
which we've been working towards supporting.  What about SMP?  ARM is
a SMP capable architecture now, and I see no locking in there - what
I do see is static data with pointers to it being returned to other
code... Yuck.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] ftrace: mcountrecord.pl for arm
  2008-11-21 13:11     ` Russell King - ARM Linux
@ 2008-11-21 13:31       ` Steven Rostedt
  0 siblings, 0 replies; 10+ messages in thread
From: Steven Rostedt @ 2008-11-21 13:31 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Abhishek Sagar, Matt Fleming, Jim Radford, LKML, linux-arm-kernel,
	linuxppc-dev, Paul Mundt, Ingo Molnar, Sam Ravnborg,
	Andrew Morton


On Fri, 21 Nov 2008, Russell King - ARM Linux wrote:

> On Thu, Nov 20, 2008 at 02:11:49PM -0800, Jim Radford wrote:
> > Ingo and Steven,
> > 
> > Here's an updated version of the arch/arm changes for dynamic ftrace
> > based on top of your latest tip/master.
> 
> Excuse me if I'm rather confused, but...
> 
> When ftrace for ARM was originally merged, neither linux-arm-kernel
> nor myself were copied with the patches.  Now, I'm being sent updates
> to code that I've no understanding of and haven't seen before.
> 
> I mean, yes, it's nice to be copied with patches which are relevent.
> It would've been even nicer to have been copied with the patches adding
> ftrace in the first place, so people knew something about it and were
> aware of the changes.
> 
> It seems to me like there's been a total breakdown of communication
> when ftrace was initially merged...

Yes I totally agree that in the beginning there was a breakdown of
communication. I myself just learned of the ARM port.

> 
> So, questions: has ftrace actually been tested on ARM at all?  Has it
> been reviewed?  Which ARM platforms has it been tried on?  How stable
> is it?  How has it been implemented on ARM?  Does it rely on any CPU
> specific behaviour?
> 
> Looking at the git history, ftrace was merged via Ingo, so I assume
> that Ingo has some understanding of this code.  So, for the time being
> if these are urgent updates, I suggest that updates go through Ingo's
> tree rather than mine.

I would suggest that they at least get an ACK from you. The original
code should have too.

> 
> And looking at arch/arm/kernel/ftrace.c, it's incompatible with Thumb2
> which we've been working towards supporting.  What about SMP?  ARM is
> a SMP capable architecture now, and I see no locking in there - what
> I do see is static data with pointers to it being returned to other
> code... Yuck.

Some of this code will be redesigned in 29. But as for the locking, this 
code is run under kstop_machine. Which means that even on SMP 
architectures, this acts like a UP box.  Some of the code can be run 
outside of kstop_machine, but it is protected by locks in the module code.
I'll take a look at the ftrace.c arm code and see if there's any problems 
with it. I wrote the x86 version as well as the coming PowerPC port.

Thanks,

-- Steve

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-11-21 13:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-20 20:34 [PATCH 0/3] ftrace: updates to recordmcount.pl script Steven Rostedt
2008-11-20 20:34 ` [PATCH 1/3] sh: dynamic ftrace support Steven Rostedt
2008-11-21  7:44   ` Paul Mundt
2008-11-21  9:00     ` Matt Fleming
2008-11-20 20:34 ` [PATCH 2/3] ftrace: add support for powerpc to recordmcount.pl script Steven Rostedt
2008-11-20 20:34 ` [PATCH 3/3] ftrace: create default variables for archs in recordmcount.pl Steven Rostedt
2008-11-20 22:04 ` [PATCH] ftrace: mcountrecord.pl for arm Jim Radford
2008-11-20 22:11   ` Jim Radford
2008-11-21 13:11     ` Russell King - ARM Linux
2008-11-21 13:31       ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).