* [PATCH -tip 1/2] function-graph: fix the output of set_graph_function
@ 2009-07-22 8:38 Li Zefan
2009-07-22 8:38 ` [PATCH -tip 2/2] function-graph: use ftrace_graph_funcs directly Li Zefan
2009-07-24 0:35 ` [PATCH -tip 1/2] function-graph: fix the output of set_graph_function Steven Rostedt
0 siblings, 2 replies; 6+ messages in thread
From: Li Zefan @ 2009-07-22 8:38 UTC (permalink / raw)
To: Steven Rostedt; +Cc: Ingo Molnar, Frederic Weisbecker, LKML
It always shows "ftrace_graph_funcs":
# echo 'sys_open' > set_graph_function
# cat set_graph_function
ftrace_graph_funcs
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
kernel/trace/ftrace.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 24e3ff5..c6c0c07 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -2505,7 +2505,7 @@ static int g_show(struct seq_file *m, void *v)
return 0;
}
- seq_printf(m, "%pf\n", v);
+ seq_printf(m, "%pf\n", (void *)*ptr);
return 0;
}
--
1.6.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH -tip 2/2] function-graph: use ftrace_graph_funcs directly
2009-07-22 8:38 [PATCH -tip 1/2] function-graph: fix the output of set_graph_function Li Zefan
@ 2009-07-22 8:38 ` Li Zefan
2009-07-24 0:37 ` Steven Rostedt
2009-07-24 0:35 ` [PATCH -tip 1/2] function-graph: fix the output of set_graph_function Steven Rostedt
1 sibling, 1 reply; 6+ messages in thread
From: Li Zefan @ 2009-07-22 8:38 UTC (permalink / raw)
To: Steven Rostedt; +Cc: Ingo Molnar, Frederic Weisbecker, LKML
No need to store ftrace_graph_funcs in file->private.
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
kernel/trace/ftrace.c | 22 ++++------------------
1 files changed, 4 insertions(+), 18 deletions(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index c6c0c07..7179bff 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -2463,11 +2463,9 @@ unsigned long ftrace_graph_funcs[FTRACE_GRAPH_MAX_FUNCS] __read_mostly;
static void *
__g_next(struct seq_file *m, loff_t *pos)
{
- unsigned long *array = m->private;
-
if (*pos >= ftrace_graph_count)
return NULL;
- return &array[*pos];
+ return &ftrace_graph_funcs[*pos];
}
static void *
@@ -2531,16 +2529,10 @@ ftrace_graph_open(struct inode *inode, struct file *file)
ftrace_graph_count = 0;
memset(ftrace_graph_funcs, 0, sizeof(ftrace_graph_funcs));
}
+ mutex_unlock(&graph_lock);
- if (file->f_mode & FMODE_READ) {
+ if (file->f_mode & FMODE_READ)
ret = seq_open(file, &ftrace_graph_seq_ops);
- if (!ret) {
- struct seq_file *m = file->private_data;
- m->private = ftrace_graph_funcs;
- }
- } else
- file->private_data = ftrace_graph_funcs;
- mutex_unlock(&graph_lock);
return ret;
}
@@ -2601,7 +2593,7 @@ ftrace_graph_write(struct file *file, const char __user *ubuf,
size_t cnt, loff_t *ppos)
{
unsigned char buffer[FTRACE_BUFF_MAX+1];
- unsigned long *array;
+ unsigned long *array = ftrace_graph_funcs;
size_t read = 0;
ssize_t ret;
int index = 0;
@@ -2617,12 +2609,6 @@ ftrace_graph_write(struct file *file, const char __user *ubuf,
goto out;
}
- if (file->f_mode & FMODE_READ) {
- struct seq_file *m = file->private_data;
- array = m->private;
- } else
- array = file->private_data;
-
ret = get_user(ch, ubuf++);
if (ret)
goto out;
--
1.6.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH -tip 1/2] function-graph: fix the output of set_graph_function
2009-07-22 8:38 [PATCH -tip 1/2] function-graph: fix the output of set_graph_function Li Zefan
2009-07-22 8:38 ` [PATCH -tip 2/2] function-graph: use ftrace_graph_funcs directly Li Zefan
@ 2009-07-24 0:35 ` Steven Rostedt
2009-07-24 0:38 ` Li Zefan
1 sibling, 1 reply; 6+ messages in thread
From: Steven Rostedt @ 2009-07-24 0:35 UTC (permalink / raw)
To: Li Zefan; +Cc: Ingo Molnar, Frederic Weisbecker, LKML
On Wed, 22 Jul 2009, Li Zefan wrote:
> It always shows "ftrace_graph_funcs":
>
> # echo 'sys_open' > set_graph_function
> # cat set_graph_function
> ftrace_graph_funcs
Nice fix. Hmm, this probably should go into 31.
-- Steve
>
> Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
> ---
> kernel/trace/ftrace.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index 24e3ff5..c6c0c07 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -2505,7 +2505,7 @@ static int g_show(struct seq_file *m, void *v)
> return 0;
> }
>
> - seq_printf(m, "%pf\n", v);
> + seq_printf(m, "%pf\n", (void *)*ptr);
>
> return 0;
> }
> --
> 1.6.3
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -tip 2/2] function-graph: use ftrace_graph_funcs directly
2009-07-22 8:38 ` [PATCH -tip 2/2] function-graph: use ftrace_graph_funcs directly Li Zefan
@ 2009-07-24 0:37 ` Steven Rostedt
0 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2009-07-24 0:37 UTC (permalink / raw)
To: Li Zefan; +Cc: Ingo Molnar, Frederic Weisbecker, LKML
On Wed, 22 Jul 2009, Li Zefan wrote:
> No need to store ftrace_graph_funcs in file->private.
Thanks, I'll queue this up for 32.
-- Steve
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -tip 1/2] function-graph: fix the output of set_graph_function
2009-07-24 0:35 ` [PATCH -tip 1/2] function-graph: fix the output of set_graph_function Steven Rostedt
@ 2009-07-24 0:38 ` Li Zefan
2009-07-24 0:41 ` Steven Rostedt
0 siblings, 1 reply; 6+ messages in thread
From: Li Zefan @ 2009-07-24 0:38 UTC (permalink / raw)
To: Steven Rostedt; +Cc: Ingo Molnar, Frederic Weisbecker, LKML
Steven Rostedt wrote:
> On Wed, 22 Jul 2009, Li Zefan wrote:
>
>> It always shows "ftrace_graph_funcs":
>>
>> # echo 'sys_open' > set_graph_function
>> # cat set_graph_function
>> ftrace_graph_funcs
>
> Nice fix. Hmm, this probably should go into 31.
>
The bug is introduced by a patch in tracing/core,
so this fix is for -tip only. :)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -tip 1/2] function-graph: fix the output of set_graph_function
2009-07-24 0:38 ` Li Zefan
@ 2009-07-24 0:41 ` Steven Rostedt
0 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2009-07-24 0:41 UTC (permalink / raw)
To: Li Zefan; +Cc: Ingo Molnar, Frederic Weisbecker, LKML
On Fri, 24 Jul 2009, Li Zefan wrote:
> Steven Rostedt wrote:
> > On Wed, 22 Jul 2009, Li Zefan wrote:
> >
> >> It always shows "ftrace_graph_funcs":
> >>
> >> # echo 'sys_open' > set_graph_function
> >> # cat set_graph_function
> >> ftrace_graph_funcs
> >
> > Nice fix. Hmm, this probably should go into 31.
> >
>
> The bug is introduced by a patch in tracing/core,
> so this fix is for -tip only. :)
OK, thanks for telling me that. It makes it easier for the queue.
-- Steve
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-07-24 0:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-22 8:38 [PATCH -tip 1/2] function-graph: fix the output of set_graph_function Li Zefan
2009-07-22 8:38 ` [PATCH -tip 2/2] function-graph: use ftrace_graph_funcs directly Li Zefan
2009-07-24 0:37 ` Steven Rostedt
2009-07-24 0:35 ` [PATCH -tip 1/2] function-graph: fix the output of set_graph_function Steven Rostedt
2009-07-24 0:38 ` Li Zefan
2009-07-24 0:41 ` Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox