public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Cc: Ingo Molnar <mingo@elte.hu>, Steven Rostedt <rostedt@goodmis.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] tracing/function: cleanup for function tracer
Date: Fri, 17 Jul 2009 01:38:40 -0400	[thread overview]
Message-ID: <20090717053839.GF4977@nowhere> (raw)
In-Reply-To: <4A5EC6D4.5040007@cn.fujitsu.com>

On Thu, Jul 16, 2009 at 02:21:08PM +0800, Xiao Guangrong wrote:
> We can use %pf input format instead of kallsyms_lookup()
> and %s input format
> 
> Thanks for Li Zefan's offline review.
> 
> Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
> Reviewed-by: Li Zefan <lizf@cn.fujitsu.com>


Queuing these two patches for .32

Thanks!

Frederic.



> ---
>  kernel/trace/ftrace.c          |   17 +++--------------
>  kernel/trace/trace_functions.c |    4 +---
>  2 files changed, 4 insertions(+), 17 deletions(-)
> 
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index 4521c77..8f7d28e 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -1438,18 +1438,13 @@ static int t_hash_show(struct seq_file *m, void *v)
>  {
>  	struct ftrace_func_probe *rec;
>  	struct hlist_node *hnd = v;
> -	char str[KSYM_SYMBOL_LEN];
>  
>  	rec = hlist_entry(hnd, struct ftrace_func_probe, node);
>  
>  	if (rec->ops->print)
>  		return rec->ops->print(m, rec->ip, rec->ops, rec->data);
>  
> -	kallsyms_lookup(rec->ip, NULL, NULL, NULL, str);
> -	seq_printf(m, "%s:", str);
> -
> -	kallsyms_lookup((unsigned long)rec->ops->func, NULL, NULL, NULL, str);
> -	seq_printf(m, "%s", str);
> +	seq_printf(m, "%pf:%pf", (void *)rec->ip, (void *)rec->ops->func);
>  
>  	if (rec->data)
>  		seq_printf(m, ":%p", rec->data);
> @@ -1547,7 +1542,6 @@ static int t_show(struct seq_file *m, void *v)
>  {
>  	struct ftrace_iterator *iter = m->private;
>  	struct dyn_ftrace *rec = v;
> -	char str[KSYM_SYMBOL_LEN];
>  
>  	if (iter->flags & FTRACE_ITER_HASH)
>  		return t_hash_show(m, v);
> @@ -1560,9 +1554,7 @@ static int t_show(struct seq_file *m, void *v)
>  	if (!rec)
>  		return 0;
>  
> -	kallsyms_lookup(rec->ip, NULL, NULL, NULL, str);
> -
> -	seq_printf(m, "%s\n", str);
> +	seq_printf(m, "%pf\n", (void *)rec->ip);
>  
>  	return 0;
>  }
> @@ -2543,7 +2535,6 @@ static void g_stop(struct seq_file *m, void *p)
>  static int g_show(struct seq_file *m, void *v)
>  {
>  	unsigned long *ptr = v;
> -	char str[KSYM_SYMBOL_LEN];
>  
>  	if (!ptr)
>  		return 0;
> @@ -2553,9 +2544,7 @@ static int g_show(struct seq_file *m, void *v)
>  		return 0;
>  	}
>  
> -	kallsyms_lookup(*ptr, NULL, NULL, NULL, str);
> -
> -	seq_printf(m, "%s\n", str);
> +	seq_printf(m, "%pf\n", v);
>  
>  	return 0;
>  }
> diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c
> index 7402144..b53dc99 100644
> --- a/kernel/trace/trace_functions.c
> +++ b/kernel/trace/trace_functions.c
> @@ -288,11 +288,9 @@ static int
>  ftrace_trace_onoff_print(struct seq_file *m, unsigned long ip,
>  			 struct ftrace_probe_ops *ops, void *data)
>  {
> -	char str[KSYM_SYMBOL_LEN];
>  	long count = (long)data;
>  
> -	kallsyms_lookup(ip, NULL, NULL, NULL, str);
> -	seq_printf(m, "%s:", str);
> +	seq_printf(m, "%pf:", (void *)ip);
>  
>  	if (ops == &traceon_probe_ops)
>  		seq_printf(m, "traceon");
> -- 
> 1.6.1.2
> 


      reply	other threads:[~2009-07-17  5:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-16  6:17 [PATCH 1/2] tracing/trace_stack: cleanup for trace_lookup_stack() Xiao Guangrong
2009-07-16  6:21 ` [PATCH 2/2] tracing/function: cleanup for function tracer Xiao Guangrong
2009-07-17  5:38   ` Frederic Weisbecker [this message]

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=20090717053839.GF4977@nowhere \
    --to=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=xiaoguangrong@cn.fujitsu.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox