* [PATCH] ftrace/ARM: add ARM support for C version of recordmcount
@ 2010-11-22 18:13 ` Rabin Vincent
0 siblings, 0 replies; 10+ messages in thread
From: Rabin Vincent @ 2010-11-22 18:13 UTC (permalink / raw)
To: Steven Rostedt; +Cc: linux-kernel, linux-arm-kernel, jreiser, Rabin Vincent
Depending on the compiler version, ARM GCC calls the mcount function
either __gnu_mcount_nc or mcount.
Also, arch/arm/kernel/ftrace.c references mcount like
kernel/tracing/ftrace.c, so change the exclusion filter to match any
ftrace.c
Signed-off-by: Rabin Vincent <rabin@rab.in>
---
arch/arm/Kconfig | 1 +
scripts/recordmcount.c | 7 +++++--
scripts/recordmcount.h | 5 +++--
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 81c71da..5fdddda 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -23,6 +23,7 @@ config ARM
select PERF_USE_VMALLOC
select HAVE_REGS_AND_STACK_ACCESS_API
select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V7))
+ select HAVE_C_RECORDMCOUNT
help
The ARM series is a line of low-power-consumption RISC chip designs
licensed by ARM Ltd and targeted at embedded applications and
diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
index f2f32ee..038b3d1 100644
--- a/scripts/recordmcount.c
+++ b/scripts/recordmcount.c
@@ -38,6 +38,7 @@ static void *ehdr_curr; /* current ElfXX_Ehdr * for resource cleanup */
static char gpfx; /* prefix for global symbol name (sometimes '_') */
static struct stat sb; /* Remember .st_size, etc. */
static jmp_buf jmpenv; /* setjmp/longjmp per-file error escape */
+static const char *altmcount; /* alternate mcount symbol name */
/* setjmp() return values */
enum {
@@ -299,7 +300,9 @@ do_file(char const *const fname)
fail_file();
} break;
case EM_386: reltype = R_386_32; break;
- case EM_ARM: reltype = R_ARM_ABS32; break;
+ case EM_ARM: reltype = R_ARM_ABS32;
+ altmcount = "__gnu_mcount_nc";
+ break;
case EM_IA_64: reltype = R_IA64_IMM64; gpfx = '_'; break;
case EM_MIPS: /* reltype: e_class */ gpfx = '_'; break;
case EM_PPC: reltype = R_PPC_ADDR32; gpfx = '_'; break;
@@ -357,7 +360,7 @@ do_file(char const *const fname)
int
main(int argc, char const *argv[])
{
- const char ftrace[] = "kernel/trace/ftrace.o";
+ const char ftrace[] = "/ftrace.o";
int ftrace_size = sizeof(ftrace) - 1;
int n_error = 0; /* gcc-4.3.0 false positive complaint */
diff --git a/scripts/recordmcount.h b/scripts/recordmcount.h
index 58e933a..8087bc8 100644
--- a/scripts/recordmcount.h
+++ b/scripts/recordmcount.h
@@ -275,11 +275,12 @@ static uint_t *sift_rel_mcount(uint_t *mlocp,
Elf_Sym const *const symp =
&sym0[Elf_r_sym(relp)];
char const *symname = &str0[w(symp->st_name)];
+ char const *mcount = '_' == gpfx ? "_mcount" : "mcount";
if ('.' == symname[0])
++symname; /* ppc64 hack */
- if (0 == strcmp((('_' == gpfx) ? "_mcount" : "mcount"),
- symname))
+ if (0 == strcmp(mcount, symname) ||
+ (altmcount && 0 == strcmp(altmcount, symname)))
mcountsym = Elf_r_sym(relp);
}
--
1.7.2.3
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH] ftrace/ARM: add ARM support for C version of recordmcount
@ 2010-11-22 18:13 ` Rabin Vincent
0 siblings, 0 replies; 10+ messages in thread
From: Rabin Vincent @ 2010-11-22 18:13 UTC (permalink / raw)
To: linux-arm-kernel
Depending on the compiler version, ARM GCC calls the mcount function
either __gnu_mcount_nc or mcount.
Also, arch/arm/kernel/ftrace.c references mcount like
kernel/tracing/ftrace.c, so change the exclusion filter to match any
ftrace.c
Signed-off-by: Rabin Vincent <rabin@rab.in>
---
arch/arm/Kconfig | 1 +
scripts/recordmcount.c | 7 +++++--
scripts/recordmcount.h | 5 +++--
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 81c71da..5fdddda 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -23,6 +23,7 @@ config ARM
select PERF_USE_VMALLOC
select HAVE_REGS_AND_STACK_ACCESS_API
select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V7))
+ select HAVE_C_RECORDMCOUNT
help
The ARM series is a line of low-power-consumption RISC chip designs
licensed by ARM Ltd and targeted at embedded applications and
diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
index f2f32ee..038b3d1 100644
--- a/scripts/recordmcount.c
+++ b/scripts/recordmcount.c
@@ -38,6 +38,7 @@ static void *ehdr_curr; /* current ElfXX_Ehdr * for resource cleanup */
static char gpfx; /* prefix for global symbol name (sometimes '_') */
static struct stat sb; /* Remember .st_size, etc. */
static jmp_buf jmpenv; /* setjmp/longjmp per-file error escape */
+static const char *altmcount; /* alternate mcount symbol name */
/* setjmp() return values */
enum {
@@ -299,7 +300,9 @@ do_file(char const *const fname)
fail_file();
} break;
case EM_386: reltype = R_386_32; break;
- case EM_ARM: reltype = R_ARM_ABS32; break;
+ case EM_ARM: reltype = R_ARM_ABS32;
+ altmcount = "__gnu_mcount_nc";
+ break;
case EM_IA_64: reltype = R_IA64_IMM64; gpfx = '_'; break;
case EM_MIPS: /* reltype: e_class */ gpfx = '_'; break;
case EM_PPC: reltype = R_PPC_ADDR32; gpfx = '_'; break;
@@ -357,7 +360,7 @@ do_file(char const *const fname)
int
main(int argc, char const *argv[])
{
- const char ftrace[] = "kernel/trace/ftrace.o";
+ const char ftrace[] = "/ftrace.o";
int ftrace_size = sizeof(ftrace) - 1;
int n_error = 0; /* gcc-4.3.0 false positive complaint */
diff --git a/scripts/recordmcount.h b/scripts/recordmcount.h
index 58e933a..8087bc8 100644
--- a/scripts/recordmcount.h
+++ b/scripts/recordmcount.h
@@ -275,11 +275,12 @@ static uint_t *sift_rel_mcount(uint_t *mlocp,
Elf_Sym const *const symp =
&sym0[Elf_r_sym(relp)];
char const *symname = &str0[w(symp->st_name)];
+ char const *mcount = '_' == gpfx ? "_mcount" : "mcount";
if ('.' == symname[0])
++symname; /* ppc64 hack */
- if (0 == strcmp((('_' == gpfx) ? "_mcount" : "mcount"),
- symname))
+ if (0 == strcmp(mcount, symname) ||
+ (altmcount && 0 == strcmp(altmcount, symname)))
mcountsym = Elf_r_sym(relp);
}
--
1.7.2.3
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] ftrace/ARM: add ARM support for C version of recordmcount
2010-11-22 18:13 ` Rabin Vincent
@ 2010-11-22 19:33 ` Steven Rostedt
-1 siblings, 0 replies; 10+ messages in thread
From: Steven Rostedt @ 2010-11-22 19:33 UTC (permalink / raw)
To: Rabin Vincent; +Cc: linux-kernel, linux-arm-kernel, jreiser
On Mon, 2010-11-22 at 23:43 +0530, Rabin Vincent wrote:
> Depending on the compiler version, ARM GCC calls the mcount function
> either __gnu_mcount_nc or mcount.
>
> Also, arch/arm/kernel/ftrace.c references mcount like
> kernel/tracing/ftrace.c, so change the exclusion filter to match any
> ftrace.c
>
Could you separate that out into two patches. I think this is too much
of a "side effect" for a "add arch" patch.
Thanks,
-- Steve
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] ftrace/ARM: add ARM support for C version of recordmcount
@ 2010-11-22 19:33 ` Steven Rostedt
0 siblings, 0 replies; 10+ messages in thread
From: Steven Rostedt @ 2010-11-22 19:33 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, 2010-11-22 at 23:43 +0530, Rabin Vincent wrote:
> Depending on the compiler version, ARM GCC calls the mcount function
> either __gnu_mcount_nc or mcount.
>
> Also, arch/arm/kernel/ftrace.c references mcount like
> kernel/tracing/ftrace.c, so change the exclusion filter to match any
> ftrace.c
>
Could you separate that out into two patches. I think this is too much
of a "side effect" for a "add arch" patch.
Thanks,
-- Steve
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCHv2 1/2] ftrace: ignore any ftrace.o in C version of recordmcount
2010-11-22 19:33 ` Steven Rostedt
@ 2010-11-23 14:14 ` Rabin Vincent
-1 siblings, 0 replies; 10+ messages in thread
From: Rabin Vincent @ 2010-11-23 14:14 UTC (permalink / raw)
To: Steven Rostedt; +Cc: linux-kernel, linux-arm-kernel, jreiser, Rabin Vincent
arch/arm/kernel/ftrace.c references mcount like kernel/tracing/ftrace.c,
so change the exclusion filter to match any ftrace.o.
Signed-off-by: Rabin Vincent <rabin@rab.in>
---
scripts/recordmcount.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
index f2f32ee..ac6e51c 100644
--- a/scripts/recordmcount.c
+++ b/scripts/recordmcount.c
@@ -357,7 +357,7 @@ do_file(char const *const fname)
int
main(int argc, char const *argv[])
{
- const char ftrace[] = "kernel/trace/ftrace.o";
+ const char ftrace[] = "/ftrace.o";
int ftrace_size = sizeof(ftrace) - 1;
int n_error = 0; /* gcc-4.3.0 false positive complaint */
--
1.7.2.3
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCHv2 1/2] ftrace: ignore any ftrace.o in C version of recordmcount
@ 2010-11-23 14:14 ` Rabin Vincent
0 siblings, 0 replies; 10+ messages in thread
From: Rabin Vincent @ 2010-11-23 14:14 UTC (permalink / raw)
To: linux-arm-kernel
arch/arm/kernel/ftrace.c references mcount like kernel/tracing/ftrace.c,
so change the exclusion filter to match any ftrace.o.
Signed-off-by: Rabin Vincent <rabin@rab.in>
---
scripts/recordmcount.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
index f2f32ee..ac6e51c 100644
--- a/scripts/recordmcount.c
+++ b/scripts/recordmcount.c
@@ -357,7 +357,7 @@ do_file(char const *const fname)
int
main(int argc, char const *argv[])
{
- const char ftrace[] = "kernel/trace/ftrace.o";
+ const char ftrace[] = "/ftrace.o";
int ftrace_size = sizeof(ftrace) - 1;
int n_error = 0; /* gcc-4.3.0 false positive complaint */
--
1.7.2.3
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCHv2 2/2] ftrace/ARM: add ARM support for C version of recordmcount
2010-11-22 19:33 ` Steven Rostedt
@ 2010-11-23 14:14 ` Rabin Vincent
-1 siblings, 0 replies; 10+ messages in thread
From: Rabin Vincent @ 2010-11-23 14:14 UTC (permalink / raw)
To: Steven Rostedt; +Cc: linux-kernel, linux-arm-kernel, jreiser, Rabin Vincent
Depending on the compiler version, ARM GCC calls the mcount function
either __gnu_mcount_nc or mcount.
Signed-off-by: Rabin Vincent <rabin@rab.in>
---
arch/arm/Kconfig | 1 +
scripts/recordmcount.c | 5 ++++-
scripts/recordmcount.h | 5 +++--
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 81c71da..5fdddda 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -23,6 +23,7 @@ config ARM
select PERF_USE_VMALLOC
select HAVE_REGS_AND_STACK_ACCESS_API
select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V7))
+ select HAVE_C_RECORDMCOUNT
help
The ARM series is a line of low-power-consumption RISC chip designs
licensed by ARM Ltd and targeted at embedded applications and
diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
index ac6e51c..038b3d1 100644
--- a/scripts/recordmcount.c
+++ b/scripts/recordmcount.c
@@ -38,6 +38,7 @@ static void *ehdr_curr; /* current ElfXX_Ehdr * for resource cleanup */
static char gpfx; /* prefix for global symbol name (sometimes '_') */
static struct stat sb; /* Remember .st_size, etc. */
static jmp_buf jmpenv; /* setjmp/longjmp per-file error escape */
+static const char *altmcount; /* alternate mcount symbol name */
/* setjmp() return values */
enum {
@@ -299,7 +300,9 @@ do_file(char const *const fname)
fail_file();
} break;
case EM_386: reltype = R_386_32; break;
- case EM_ARM: reltype = R_ARM_ABS32; break;
+ case EM_ARM: reltype = R_ARM_ABS32;
+ altmcount = "__gnu_mcount_nc";
+ break;
case EM_IA_64: reltype = R_IA64_IMM64; gpfx = '_'; break;
case EM_MIPS: /* reltype: e_class */ gpfx = '_'; break;
case EM_PPC: reltype = R_PPC_ADDR32; gpfx = '_'; break;
diff --git a/scripts/recordmcount.h b/scripts/recordmcount.h
index 58e933a..8087bc8 100644
--- a/scripts/recordmcount.h
+++ b/scripts/recordmcount.h
@@ -275,11 +275,12 @@ static uint_t *sift_rel_mcount(uint_t *mlocp,
Elf_Sym const *const symp =
&sym0[Elf_r_sym(relp)];
char const *symname = &str0[w(symp->st_name)];
+ char const *mcount = '_' == gpfx ? "_mcount" : "mcount";
if ('.' == symname[0])
++symname; /* ppc64 hack */
- if (0 == strcmp((('_' == gpfx) ? "_mcount" : "mcount"),
- symname))
+ if (0 == strcmp(mcount, symname) ||
+ (altmcount && 0 == strcmp(altmcount, symname)))
mcountsym = Elf_r_sym(relp);
}
--
1.7.2.3
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCHv2 2/2] ftrace/ARM: add ARM support for C version of recordmcount
@ 2010-11-23 14:14 ` Rabin Vincent
0 siblings, 0 replies; 10+ messages in thread
From: Rabin Vincent @ 2010-11-23 14:14 UTC (permalink / raw)
To: linux-arm-kernel
Depending on the compiler version, ARM GCC calls the mcount function
either __gnu_mcount_nc or mcount.
Signed-off-by: Rabin Vincent <rabin@rab.in>
---
arch/arm/Kconfig | 1 +
scripts/recordmcount.c | 5 ++++-
scripts/recordmcount.h | 5 +++--
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 81c71da..5fdddda 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -23,6 +23,7 @@ config ARM
select PERF_USE_VMALLOC
select HAVE_REGS_AND_STACK_ACCESS_API
select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V7))
+ select HAVE_C_RECORDMCOUNT
help
The ARM series is a line of low-power-consumption RISC chip designs
licensed by ARM Ltd and targeted at embedded applications and
diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
index ac6e51c..038b3d1 100644
--- a/scripts/recordmcount.c
+++ b/scripts/recordmcount.c
@@ -38,6 +38,7 @@ static void *ehdr_curr; /* current ElfXX_Ehdr * for resource cleanup */
static char gpfx; /* prefix for global symbol name (sometimes '_') */
static struct stat sb; /* Remember .st_size, etc. */
static jmp_buf jmpenv; /* setjmp/longjmp per-file error escape */
+static const char *altmcount; /* alternate mcount symbol name */
/* setjmp() return values */
enum {
@@ -299,7 +300,9 @@ do_file(char const *const fname)
fail_file();
} break;
case EM_386: reltype = R_386_32; break;
- case EM_ARM: reltype = R_ARM_ABS32; break;
+ case EM_ARM: reltype = R_ARM_ABS32;
+ altmcount = "__gnu_mcount_nc";
+ break;
case EM_IA_64: reltype = R_IA64_IMM64; gpfx = '_'; break;
case EM_MIPS: /* reltype: e_class */ gpfx = '_'; break;
case EM_PPC: reltype = R_PPC_ADDR32; gpfx = '_'; break;
diff --git a/scripts/recordmcount.h b/scripts/recordmcount.h
index 58e933a..8087bc8 100644
--- a/scripts/recordmcount.h
+++ b/scripts/recordmcount.h
@@ -275,11 +275,12 @@ static uint_t *sift_rel_mcount(uint_t *mlocp,
Elf_Sym const *const symp =
&sym0[Elf_r_sym(relp)];
char const *symname = &str0[w(symp->st_name)];
+ char const *mcount = '_' == gpfx ? "_mcount" : "mcount";
if ('.' == symname[0])
++symname; /* ppc64 hack */
- if (0 == strcmp((('_' == gpfx) ? "_mcount" : "mcount"),
- symname))
+ if (0 == strcmp(mcount, symname) ||
+ (altmcount && 0 == strcmp(altmcount, symname)))
mcountsym = Elf_r_sym(relp);
}
--
1.7.2.3
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCHv2 1/2] ftrace: ignore any ftrace.o in C version of recordmcount
2010-11-23 14:14 ` Rabin Vincent
@ 2010-11-23 14:32 ` Steven Rostedt
-1 siblings, 0 replies; 10+ messages in thread
From: Steven Rostedt @ 2010-11-23 14:32 UTC (permalink / raw)
To: Rabin Vincent; +Cc: linux-kernel, linux-arm-kernel, jreiser
Do you want to push these through the arm tree. It may be easier that
way.
You can add my:
Acked-by: Steven Rostedt <rostedt@goodmis.org>
to both patches.
-- Steve
On Tue, 2010-11-23 at 19:44 +0530, Rabin Vincent wrote:
> arch/arm/kernel/ftrace.c references mcount like kernel/tracing/ftrace.c,
> so change the exclusion filter to match any ftrace.o.
>
> Signed-off-by: Rabin Vincent <rabin@rab.in>
> ---
> scripts/recordmcount.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
> index f2f32ee..ac6e51c 100644
> --- a/scripts/recordmcount.c
> +++ b/scripts/recordmcount.c
> @@ -357,7 +357,7 @@ do_file(char const *const fname)
> int
> main(int argc, char const *argv[])
> {
> - const char ftrace[] = "kernel/trace/ftrace.o";
> + const char ftrace[] = "/ftrace.o";
> int ftrace_size = sizeof(ftrace) - 1;
> int n_error = 0; /* gcc-4.3.0 false positive complaint */
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCHv2 1/2] ftrace: ignore any ftrace.o in C version of recordmcount
@ 2010-11-23 14:32 ` Steven Rostedt
0 siblings, 0 replies; 10+ messages in thread
From: Steven Rostedt @ 2010-11-23 14:32 UTC (permalink / raw)
To: linux-arm-kernel
Do you want to push these through the arm tree. It may be easier that
way.
You can add my:
Acked-by: Steven Rostedt <rostedt@goodmis.org>
to both patches.
-- Steve
On Tue, 2010-11-23 at 19:44 +0530, Rabin Vincent wrote:
> arch/arm/kernel/ftrace.c references mcount like kernel/tracing/ftrace.c,
> so change the exclusion filter to match any ftrace.o.
>
> Signed-off-by: Rabin Vincent <rabin@rab.in>
> ---
> scripts/recordmcount.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
> index f2f32ee..ac6e51c 100644
> --- a/scripts/recordmcount.c
> +++ b/scripts/recordmcount.c
> @@ -357,7 +357,7 @@ do_file(char const *const fname)
> int
> main(int argc, char const *argv[])
> {
> - const char ftrace[] = "kernel/trace/ftrace.o";
> + const char ftrace[] = "/ftrace.o";
> int ftrace_size = sizeof(ftrace) - 1;
> int n_error = 0; /* gcc-4.3.0 false positive complaint */
>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2010-11-23 14:32 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-22 18:13 [PATCH] ftrace/ARM: add ARM support for C version of recordmcount Rabin Vincent
2010-11-22 18:13 ` Rabin Vincent
2010-11-22 19:33 ` Steven Rostedt
2010-11-22 19:33 ` Steven Rostedt
2010-11-23 14:14 ` [PATCHv2 1/2] ftrace: ignore any ftrace.o in " Rabin Vincent
2010-11-23 14:14 ` Rabin Vincent
2010-11-23 14:32 ` Steven Rostedt
2010-11-23 14:32 ` Steven Rostedt
2010-11-23 14:14 ` [PATCHv2 2/2] ftrace/ARM: add ARM support for " Rabin Vincent
2010-11-23 14:14 ` Rabin Vincent
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.