linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] tracing: merge seq_print_sym_short() and seq_print_sym_offset()
@ 2018-10-26 21:13 Rasmus Villemoes
  2018-10-26 21:13 ` [PATCH 2/3] tracing: avoid -Wformat-nonliteral warning Rasmus Villemoes
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Rasmus Villemoes @ 2018-10-26 21:13 UTC (permalink / raw)
  To: Steven Rostedt, Ingo Molnar; +Cc: Rasmus Villemoes, linux-kernel

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)
 {
 	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);
-- 
2.19.1.6.gbde171bbf5


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

* [PATCH 2/3] tracing: avoid -Wformat-nonliteral warning
  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 ` Rasmus Villemoes
  2018-10-26 21:13 ` [PATCH 3/3] tracing: simplify printf'ing in seq_print_sym Rasmus Villemoes
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Rasmus Villemoes @ 2018-10-26 21:13 UTC (permalink / raw)
  To: Steven Rostedt, Ingo Molnar; +Cc: Rasmus Villemoes, linux-kernel

Building with -Wformat-nonliteral, gcc complains

kernel/trace/trace_output.c: In function ‘seq_print_sym’:
kernel/trace/trace_output.c:356:3: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
   trace_seq_printf(s, fmt, name);

But seq_print_sym only has a single caller which passes "%s" as fmt, so
we might as well just use that directly. That also paves the way for
further cleanups that will actually make that format string go away
entirely.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 kernel/trace/trace_output.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
index 501311dcfca6..7417ce5fe4bb 100644
--- a/kernel/trace/trace_output.c
+++ b/kernel/trace/trace_output.c
@@ -339,8 +339,7 @@ static inline const char *kretprobed(const char *name)
 #endif /* CONFIG_KRETPROBES */
 
 static void
-seq_print_sym(struct trace_seq *s, const char *fmt, unsigned long address,
-	      bool with_offset)
+seq_print_sym(struct trace_seq *s, unsigned long address, bool with_offset)
 {
 	char str[KSYM_SYMBOL_LEN];
 #ifdef CONFIG_KALLSYMS
@@ -353,12 +352,12 @@ seq_print_sym(struct trace_seq *s, const char *fmt, unsigned long address,
 	name = kretprobed(str);
 
 	if (name && strlen(name)) {
-		trace_seq_printf(s, fmt, name);
+		trace_seq_printf(s, "%s", name);
 		return;
 	}
 #endif
 	snprintf(str, KSYM_SYMBOL_LEN, "0x%08lx", address);
-	trace_seq_printf(s, fmt, str);
+	trace_seq_printf(s, "%s", str);
 }
 
 #ifndef CONFIG_64BIT
@@ -407,7 +406,7 @@ seq_print_ip_sym(struct trace_seq *s, unsigned long ip, unsigned long sym_flags)
 		goto out;
 	}
 
-	seq_print_sym(s, "%s", ip, sym_flags & TRACE_ITER_SYM_OFFSET);
+	seq_print_sym(s, ip, sym_flags & TRACE_ITER_SYM_OFFSET);
 
 	if (sym_flags & TRACE_ITER_SYM_ADDR)
 		trace_seq_printf(s, " <" IP_FMT ">", ip);
-- 
2.19.1.6.gbde171bbf5


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

* [PATCH 3/3] tracing: simplify printf'ing in seq_print_sym
  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 ` Rasmus Villemoes
  2018-10-26 21:41 ` [PATCH 1/3] tracing: merge seq_print_sym_short() and seq_print_sym_offset() Steven Rostedt
  2018-10-29 22:35 ` [PATCH v2 0/3] tracing: a few simplifying patches Rasmus Villemoes
  3 siblings, 0 replies; 9+ messages in thread
From: Rasmus Villemoes @ 2018-10-26 21:13 UTC (permalink / raw)
  To: Steven Rostedt, Ingo Molnar; +Cc: Rasmus Villemoes, linux-kernel

trace_seq_printf(..., "%s", ...) can be done with trace_seq_puts()
instead, avoiding printf overhead. In the second instance, the string
we're copying was just created from an snprintf() to a stack buffer, so
we might as well do that printf directly. This naturally leads to moving
the declaration of the str buffer inside the CONFIG_KALLSYMS guard,
which in turn will make gcc inline the function for !CONFIG_KALLSYMS (it
only has a single caller, but the huge stack frame seems to make gcc not
inline it for CONFIG_KALLSYMS).

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 kernel/trace/trace_output.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
index 7417ce5fe4bb..0f96262d23be 100644
--- a/kernel/trace/trace_output.c
+++ b/kernel/trace/trace_output.c
@@ -341,8 +341,8 @@ static inline const char *kretprobed(const char *name)
 static void
 seq_print_sym(struct trace_seq *s, unsigned long address, bool with_offset)
 {
-	char str[KSYM_SYMBOL_LEN];
 #ifdef CONFIG_KALLSYMS
+	char str[KSYM_SYMBOL_LEN];
 	const char *name;
 
 	if (with_offset)
@@ -352,12 +352,11 @@ seq_print_sym(struct trace_seq *s, unsigned long address, bool with_offset)
 	name = kretprobed(str);
 
 	if (name && strlen(name)) {
-		trace_seq_printf(s, "%s", name);
+		trace_seq_puts(s, name);
 		return;
 	}
 #endif
-	snprintf(str, KSYM_SYMBOL_LEN, "0x%08lx", address);
-	trace_seq_printf(s, "%s", str);
+	trace_seq_printf(s, "0x%08lx", address);
 }
 
 #ifndef CONFIG_64BIT
-- 
2.19.1.6.gbde171bbf5


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

* Re: [PATCH 1/3] tracing: merge seq_print_sym_short() and seq_print_sym_offset()
  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
  2018-10-29 22:35 ` [PATCH v2 0/3] tracing: a few simplifying patches Rasmus Villemoes
  3 siblings, 0 replies; 9+ messages in thread
From: Steven Rostedt @ 2018-10-26 21:41 UTC (permalink / raw)
  To: Rasmus Villemoes; +Cc: Ingo Molnar, linux-kernel


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);


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

* [PATCH v2 0/3] tracing: a few simplifying patches
  2018-10-26 21:13 [PATCH 1/3] tracing: merge seq_print_sym_short() and seq_print_sym_offset() Rasmus Villemoes
                   ` (2 preceding siblings ...)
  2018-10-26 21:41 ` [PATCH 1/3] tracing: merge seq_print_sym_short() and seq_print_sym_offset() Steven Rostedt
@ 2018-10-29 22:35 ` Rasmus Villemoes
  2018-10-29 22:35   ` [PATCH v2 1/3] tracing: merge seq_print_sym_short() and seq_print_sym_offset() Rasmus Villemoes
                     ` (3 more replies)
  3 siblings, 4 replies; 9+ messages in thread
From: Rasmus Villemoes @ 2018-10-29 22:35 UTC (permalink / raw)
  To: Steven Rostedt, linux-kernel; +Cc: Ingo Molnar, Rasmus Villemoes

Playing around with -Wformat-nonliteral, I stumbled on two instances
in trace_output.c. Looking at the code a bit, turns out one can remove
the use of the non-constant format string and eliminate some code
duplication at the same time.

v2: Include cover letter, rename argument with_offset -> offset.

Rasmus Villemoes (3):
  tracing: merge seq_print_sym_short() and seq_print_sym_offset()
  tracing: avoid -Wformat-nonliteral warning
  tracing: simplify printf'ing in seq_print_sym

 kernel/trace/trace_output.c | 38 ++++++++-----------------------------
 1 file changed, 8 insertions(+), 30 deletions(-)

-- 
2.19.1.6.gbde171bbf5


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

* [PATCH v2 1/3] tracing: merge seq_print_sym_short() and seq_print_sym_offset()
  2018-10-29 22:35 ` [PATCH v2 0/3] tracing: a few simplifying patches Rasmus Villemoes
@ 2018-10-29 22:35   ` Rasmus Villemoes
  2018-10-29 22:35   ` [PATCH v2 2/3] tracing: avoid -Wformat-nonliteral warning Rasmus Villemoes
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Rasmus Villemoes @ 2018-10-29 22:35 UTC (permalink / raw)
  To: Steven Rostedt, Ingo Molnar; +Cc: Rasmus Villemoes, linux-kernel

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..85ecd061c7be 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 offset)
 {
 	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 (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);
-- 
2.19.1.6.gbde171bbf5


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

* [PATCH v2 2/3] tracing: avoid -Wformat-nonliteral warning
  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   ` 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
  3 siblings, 0 replies; 9+ messages in thread
From: Rasmus Villemoes @ 2018-10-29 22:35 UTC (permalink / raw)
  To: Steven Rostedt, Ingo Molnar; +Cc: Rasmus Villemoes, linux-kernel

Building with -Wformat-nonliteral, gcc complains

kernel/trace/trace_output.c: In function ‘seq_print_sym’:
kernel/trace/trace_output.c:356:3: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
   trace_seq_printf(s, fmt, name);

But seq_print_sym only has a single caller which passes "%s" as fmt, so
we might as well just use that directly. That also paves the way for
further cleanups that will actually make that format string go away
entirely.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 kernel/trace/trace_output.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
index 85ecd061c7be..f06fb899b746 100644
--- a/kernel/trace/trace_output.c
+++ b/kernel/trace/trace_output.c
@@ -339,8 +339,7 @@ static inline const char *kretprobed(const char *name)
 #endif /* CONFIG_KRETPROBES */
 
 static void
-seq_print_sym(struct trace_seq *s, const char *fmt, unsigned long address,
-	      bool offset)
+seq_print_sym(struct trace_seq *s, unsigned long address, bool offset)
 {
 	char str[KSYM_SYMBOL_LEN];
 #ifdef CONFIG_KALLSYMS
@@ -353,12 +352,12 @@ seq_print_sym(struct trace_seq *s, const char *fmt, unsigned long address,
 	name = kretprobed(str);
 
 	if (name && strlen(name)) {
-		trace_seq_printf(s, fmt, name);
+		trace_seq_printf(s, "%s", name);
 		return;
 	}
 #endif
 	snprintf(str, KSYM_SYMBOL_LEN, "0x%08lx", address);
-	trace_seq_printf(s, fmt, str);
+	trace_seq_printf(s, "%s", str);
 }
 
 #ifndef CONFIG_64BIT
@@ -407,7 +406,7 @@ seq_print_ip_sym(struct trace_seq *s, unsigned long ip, unsigned long sym_flags)
 		goto out;
 	}
 
-	seq_print_sym(s, "%s", ip, sym_flags & TRACE_ITER_SYM_OFFSET);
+	seq_print_sym(s, ip, sym_flags & TRACE_ITER_SYM_OFFSET);
 
 	if (sym_flags & TRACE_ITER_SYM_ADDR)
 		trace_seq_printf(s, " <" IP_FMT ">", ip);
-- 
2.19.1.6.gbde171bbf5


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

* [PATCH v2 3/3] tracing: simplify printf'ing in seq_print_sym
  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   ` Rasmus Villemoes
  2018-10-31 11:45   ` [PATCH v2 0/3] tracing: a few simplifying patches Steven Rostedt
  3 siblings, 0 replies; 9+ messages in thread
From: Rasmus Villemoes @ 2018-10-29 22:35 UTC (permalink / raw)
  To: Steven Rostedt, Ingo Molnar; +Cc: Rasmus Villemoes, linux-kernel

trace_seq_printf(..., "%s", ...) can be done with trace_seq_puts()
instead, avoiding printf overhead. In the second instance, the string
we're copying was just created from an snprintf() to a stack buffer, so
we might as well do that printf directly. This naturally leads to moving
the declaration of the str buffer inside the CONFIG_KALLSYMS guard,
which in turn will make gcc inline the function for !CONFIG_KALLSYMS (it
only has a single caller, but the huge stack frame seems to make gcc not
inline it for CONFIG_KALLSYMS).

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 kernel/trace/trace_output.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
index f06fb899b746..54373d93e251 100644
--- a/kernel/trace/trace_output.c
+++ b/kernel/trace/trace_output.c
@@ -341,8 +341,8 @@ static inline const char *kretprobed(const char *name)
 static void
 seq_print_sym(struct trace_seq *s, unsigned long address, bool offset)
 {
-	char str[KSYM_SYMBOL_LEN];
 #ifdef CONFIG_KALLSYMS
+	char str[KSYM_SYMBOL_LEN];
 	const char *name;
 
 	if (offset)
@@ -352,12 +352,11 @@ seq_print_sym(struct trace_seq *s, unsigned long address, bool offset)
 	name = kretprobed(str);
 
 	if (name && strlen(name)) {
-		trace_seq_printf(s, "%s", name);
+		trace_seq_puts(s, name);
 		return;
 	}
 #endif
-	snprintf(str, KSYM_SYMBOL_LEN, "0x%08lx", address);
-	trace_seq_printf(s, "%s", str);
+	trace_seq_printf(s, "0x%08lx", address);
 }
 
 #ifndef CONFIG_64BIT
-- 
2.19.1.6.gbde171bbf5


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

* Re: [PATCH v2 0/3] tracing: a few simplifying patches
  2018-10-29 22:35 ` [PATCH v2 0/3] tracing: a few simplifying patches Rasmus Villemoes
                     ` (2 preceding siblings ...)
  2018-10-29 22:35   ` [PATCH v2 3/3] tracing: simplify printf'ing in seq_print_sym Rasmus Villemoes
@ 2018-10-31 11:45   ` Steven Rostedt
  3 siblings, 0 replies; 9+ messages in thread
From: Steven Rostedt @ 2018-10-31 11:45 UTC (permalink / raw)
  To: Rasmus Villemoes; +Cc: linux-kernel, Ingo Molnar

On Mon, 29 Oct 2018 23:35:39 +0100
Rasmus Villemoes <linux@rasmusvillemoes.dk> wrote:

Hi Rasmus,

I'm currently traveling. I'll try to take a look at these later. If you
don't hear from me by next week, feel free to send me a gentle
reminder ;-)

-- Steve


> Playing around with -Wformat-nonliteral, I stumbled on two instances
> in trace_output.c. Looking at the code a bit, turns out one can remove
> the use of the non-constant format string and eliminate some code
> duplication at the same time.
> 
> v2: Include cover letter, rename argument with_offset -> offset.
> 
> Rasmus Villemoes (3):
>   tracing: merge seq_print_sym_short() and seq_print_sym_offset()
>   tracing: avoid -Wformat-nonliteral warning
>   tracing: simplify printf'ing in seq_print_sym
> 
>  kernel/trace/trace_output.c | 38 ++++++++-----------------------------
>  1 file changed, 8 insertions(+), 30 deletions(-)
> 


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

end of thread, other threads:[~2018-10-31 11:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 1/3] tracing: merge seq_print_sym_short() and seq_print_sym_offset() Steven Rostedt
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).