All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Ingo Molnar <mingo@redhat.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] tracing: merge seq_print_sym_short() and seq_print_sym_offset()
Date: Fri, 26 Oct 2018 17:41:33 -0400	[thread overview]
Message-ID: <20181026174133.46d899f1@vmware.local.home> (raw)
In-Reply-To: <20181026211347.2442-1-linux@rasmusvillemoes.dk>


Hi Ramus,

Thanks for sending these patches. I have some small nits though.

First, please send a cover letter whenever sending more than one patch.
It just groups them better in my inbox.

The second is embedded below.

On Fri, 26 Oct 2018 23:13:44 +0200
Rasmus Villemoes <linux@rasmusvillemoes.dk> wrote:

> These two functions are nearly identical, so we can avoid some code
> duplication by moving the conditional into a common implementation.
> 
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> ---
>  kernel/trace/trace_output.c | 34 +++++++---------------------------
>  1 file changed, 7 insertions(+), 27 deletions(-)
> 
> diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
> index 6e6cc64faa38..501311dcfca6 100644
> --- a/kernel/trace/trace_output.c
> +++ b/kernel/trace/trace_output.c
> @@ -339,34 +339,17 @@ static inline const char *kretprobed(const char *name)
>  #endif /* CONFIG_KRETPROBES */
>  
>  static void
> -seq_print_sym_short(struct trace_seq *s, const char *fmt, unsigned long address)
> +seq_print_sym(struct trace_seq *s, const char *fmt, unsigned long address,
> +	      bool with_offset)

Just call the variable "offset". It's rather obvious what that means.

The other patches look good, but can you send a v2 of the series, with
these updates?

Thanks!

-- Steve


>  {
>  	char str[KSYM_SYMBOL_LEN];
>  #ifdef CONFIG_KALLSYMS
>  	const char *name;
>  
> -	kallsyms_lookup(address, NULL, NULL, NULL, str);
> -
> -	name = kretprobed(str);
> -
> -	if (name && strlen(name)) {
> -		trace_seq_printf(s, fmt, name);
> -		return;
> -	}
> -#endif
> -	snprintf(str, KSYM_SYMBOL_LEN, "0x%08lx", address);
> -	trace_seq_printf(s, fmt, str);
> -}
> -
> -static void
> -seq_print_sym_offset(struct trace_seq *s, const char *fmt,
> -		     unsigned long address)
> -{
> -	char str[KSYM_SYMBOL_LEN];
> -#ifdef CONFIG_KALLSYMS
> -	const char *name;
> -
> -	sprint_symbol(str, address);
> +	if (with_offset)
> +		sprint_symbol(str, address);
> +	else
> +		kallsyms_lookup(address, NULL, NULL, NULL, str);
>  	name = kretprobed(str);
>  
>  	if (name && strlen(name)) {
> @@ -424,10 +407,7 @@ seq_print_ip_sym(struct trace_seq *s, unsigned long ip, unsigned long sym_flags)
>  		goto out;
>  	}
>  
> -	if (sym_flags & TRACE_ITER_SYM_OFFSET)
> -		seq_print_sym_offset(s, "%s", ip);
> -	else
> -		seq_print_sym_short(s, "%s", ip);
> +	seq_print_sym(s, "%s", ip, sym_flags & TRACE_ITER_SYM_OFFSET);
>  
>  	if (sym_flags & TRACE_ITER_SYM_ADDR)
>  		trace_seq_printf(s, " <" IP_FMT ">", ip);


  parent reply	other threads:[~2018-10-26 21:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-26 21:13 [PATCH 1/3] tracing: merge seq_print_sym_short() and seq_print_sym_offset() Rasmus Villemoes
2018-10-26 21:13 ` [PATCH 2/3] tracing: avoid -Wformat-nonliteral warning Rasmus Villemoes
2018-10-26 21:13 ` [PATCH 3/3] tracing: simplify printf'ing in seq_print_sym Rasmus Villemoes
2018-10-26 21:41 ` Steven Rostedt [this message]
2018-10-29 22:35 ` [PATCH v2 0/3] tracing: a few simplifying patches Rasmus Villemoes
2018-10-29 22:35   ` [PATCH v2 1/3] tracing: merge seq_print_sym_short() and seq_print_sym_offset() Rasmus Villemoes
2018-10-29 22:35   ` [PATCH v2 2/3] tracing: avoid -Wformat-nonliteral warning Rasmus Villemoes
2018-10-29 22:35   ` [PATCH v2 3/3] tracing: simplify printf'ing in seq_print_sym Rasmus Villemoes
2018-10-31 11:45   ` [PATCH v2 0/3] tracing: a few simplifying patches Steven Rostedt

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=20181026174133.46d899f1@vmware.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=mingo@redhat.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 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.