The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] ftrace: Add missing __init in ftrace_profile_debugfs()
@ 2009-07-12 10:58 Rakib Mullick
  2009-07-13  0:47 ` Li Zefan
  0 siblings, 1 reply; 4+ messages in thread
From: Rakib Mullick @ 2009-07-12 10:58 UTC (permalink / raw)
  To: LKML, Ingo Molnar; +Cc: Steven Rostedt

 Impact: Fix section mismatch.

The function ftrace_profile_debugfs() references a variable placed in
.init.data section. Thus causes a section mismatch warning. Since
ftrace_profile_debugfs() has been called from only
ftrace_init_debugfs, so we can safely mark ftrace_profile_debugfs as
init. Also it contains a trivial style fix, __init should be placed
between function type and function name (ftrace_init_debugfs).

We were warned by the following warning:

 LD      kernel/trace/libftrace.o
WARNING: kernel/trace/libftrace.o(.text+0xff0): Section mismatch in
reference from the function ftrace_profile_debugfs() to the variable
.init.data:function_stats
The function ftrace_profile_debugfs() references
the variable __initdata function_stats.
This is often because ftrace_profile_debugfs lacks a __initdata
annotation or the annotation of function_stats is wrong.


---
Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>

--- linus/kernel/trace/ftrace.c	2009-07-11 20:54:13.000000000 +0600
+++ rakib/kernel/trace/ftrace.c	2009-07-12 12:21:54.000000000 +0600
@@ -768,7 +768,7 @@ static struct tracer_stat function_stats
 	.stat_show	= function_stat_show
 };

-static void ftrace_profile_debugfs(struct dentry *d_tracer)
+static void __init ftrace_profile_debugfs(struct dentry *d_tracer)
 {
 	struct ftrace_profile_stat *stat;
 	struct dentry *entry;
@@ -813,7 +813,7 @@ static void ftrace_profile_debugfs(struc
 }

 #else /* CONFIG_FUNCTION_PROFILER */
-static void ftrace_profile_debugfs(struct dentry *d_tracer)
+static void __init ftrace_profile_debugfs(struct dentry *d_tracer)
 {
 }
 #endif /* CONFIG_FUNCTION_PROFILER */
@@ -3068,7 +3068,7 @@ static const struct file_operations ftra
 	.write = ftrace_pid_write,
 };

-static __init int ftrace_init_debugfs(void)
+static int __init ftrace_init_debugfs(void)
 {
 	struct dentry *d_tracer;

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

* Re: [PATCH] ftrace: Add missing __init in ftrace_profile_debugfs()
  2009-07-12 10:58 [PATCH] ftrace: Add missing __init in ftrace_profile_debugfs() Rakib Mullick
@ 2009-07-13  0:47 ` Li Zefan
  2009-07-13  3:58   ` Rakib Mullick
  0 siblings, 1 reply; 4+ messages in thread
From: Li Zefan @ 2009-07-13  0:47 UTC (permalink / raw)
  To: Rakib Mullick; +Cc: LKML, Ingo Molnar, Steven Rostedt

Rakib Mullick wrote:
>  Impact: Fix section mismatch.
> 
> The function ftrace_profile_debugfs() references a variable placed in
> .init.data section. Thus causes a section mismatch warning. Since
> ftrace_profile_debugfs() has been called from only
> ftrace_init_debugfs, so we can safely mark ftrace_profile_debugfs as

Thanks. It has been fixed by commit
9d9949ce45b42be7a8157ea00fff2b1005ed844a in tip tree

> init. Also it contains a trivial style fix, __init should be placed
> between function type and function name (ftrace_init_debugfs).
> 

I think both styles are Ok.


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

* Re: [PATCH] ftrace: Add missing __init in ftrace_profile_debugfs()
  2009-07-13  0:47 ` Li Zefan
@ 2009-07-13  3:58   ` Rakib Mullick
  2009-07-13  9:01     ` Ingo Molnar
  0 siblings, 1 reply; 4+ messages in thread
From: Rakib Mullick @ 2009-07-13  3:58 UTC (permalink / raw)
  To: Li Zefan; +Cc: LKML, Ingo Molnar, Steven Rostedt

On Mon, Jul 13, 2009 at 6:47 AM, Li Zefan<lizf@cn.fujitsu.com> wrote:

> Thanks. It has been fixed by commit
> 9d9949ce45b42be7a8157ea00fff2b1005ed844a in tip tree
>
Ah, sorry for noice.

>> init. Also it contains a trivial style fix, __init should be placed
>> between function type and function name (ftrace_init_debugfs).
>>
>
> I think both styles are Ok.

Yes, but I think we need to be consistent with one style.
>
>

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

* Re: [PATCH] ftrace: Add missing __init in ftrace_profile_debugfs()
  2009-07-13  3:58   ` Rakib Mullick
@ 2009-07-13  9:01     ` Ingo Molnar
  0 siblings, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2009-07-13  9:01 UTC (permalink / raw)
  To: Rakib Mullick; +Cc: Li Zefan, LKML, Steven Rostedt


* Rakib Mullick <rakib.mullick@gmail.com> wrote:

> On Mon, Jul 13, 2009 at 6:47 AM, Li Zefan<lizf@cn.fujitsu.com> wrote:
> 
> > Thanks. It has been fixed by commit
> > 9d9949ce45b42be7a8157ea00fff2b1005ed844a in tip tree
> >
> Ah, sorry for noice.

that commit was queued up for .32 - i've cherry-picked it over into 
the .31 queue of commits.

	Ingo

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

end of thread, other threads:[~2009-07-13  9:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-12 10:58 [PATCH] ftrace: Add missing __init in ftrace_profile_debugfs() Rakib Mullick
2009-07-13  0:47 ` Li Zefan
2009-07-13  3:58   ` Rakib Mullick
2009-07-13  9:01     ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox