2021-10-09 07:14:28

by Gang Li

[permalink] [raw]
Subject: [PATCH v2 1/2] mm: mmap_lock: remove redundant "\n" in TP_printk

Ftrace core will add "\n" automatically on print. "\n" in TP_printk
will create blank line, so remove it.

Signed-off-by: Gang Li <[email protected]>
---
include/trace/events/mmap_lock.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/trace/events/mmap_lock.h b/include/trace/events/mmap_lock.h
index 0abff67b96f0..5f980c92e3e9 100644
--- a/include/trace/events/mmap_lock.h
+++ b/include/trace/events/mmap_lock.h
@@ -32,7 +32,7 @@ TRACE_EVENT_FN(mmap_lock_start_locking,
),

TP_printk(
- "mm=%p memcg_path=%s write=%s\n",
+ "mm=%p memcg_path=%s write=%s",
__entry->mm,
__get_str(memcg_path),
__entry->write ? "true" : "false"
@@ -63,7 +63,7 @@ TRACE_EVENT_FN(mmap_lock_acquire_returned,
),

TP_printk(
- "mm=%p memcg_path=%s write=%s success=%s\n",
+ "mm=%p memcg_path=%s write=%s success=%s",
__entry->mm,
__get_str(memcg_path),
__entry->write ? "true" : "false",
@@ -92,7 +92,7 @@ TRACE_EVENT_FN(mmap_lock_released,
),

TP_printk(
- "mm=%p memcg_path=%s write=%s\n",
+ "mm=%p memcg_path=%s write=%s",
__entry->mm,
__get_str(memcg_path),
__entry->write ? "true" : "false"
--
2.20.1


2021-10-10 22:23:45

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] mm: mmap_lock: remove redundant "\n" in TP_printk

On Sat, 9 Oct 2021 15:11:05 +0800
Gang Li <[email protected]> wrote:

> Ftrace core will add "\n" automatically on print. "\n" in TP_printk
> will create blank line, so remove it.
>

Yes, thank you!

Reviewed-by: Steven Rostedt (VMware) <[email protected]>

-- Steve

> Signed-off-by: Gang Li <[email protected]>
> ---
> include/trace/events/mmap_lock.h | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/include/trace/events/mmap_lock.h b/include/trace/events/mmap_lock.h
> index 0abff67b96f0..5f980c92e3e9 100644
> --- a/include/trace/events/mmap_lock.h
> +++ b/include/trace/events/mmap_lock.h
> @@ -32,7 +32,7 @@ TRACE_EVENT_FN(mmap_lock_start_locking,
> ),
>
> TP_printk(
> - "mm=%p memcg_path=%s write=%s\n",
> + "mm=%p memcg_path=%s write=%s",
> __entry->mm,
> __get_str(memcg_path),
> __entry->write ? "true" : "false"
> @@ -63,7 +63,7 @@ TRACE_EVENT_FN(mmap_lock_acquire_returned,
> ),
>
> TP_printk(
> - "mm=%p memcg_path=%s write=%s success=%s\n",
> + "mm=%p memcg_path=%s write=%s success=%s",
> __entry->mm,
> __get_str(memcg_path),
> __entry->write ? "true" : "false",
> @@ -92,7 +92,7 @@ TRACE_EVENT_FN(mmap_lock_released,
> ),
>
> TP_printk(
> - "mm=%p memcg_path=%s write=%s\n",
> + "mm=%p memcg_path=%s write=%s",
> __entry->mm,
> __get_str(memcg_path),
> __entry->write ? "true" : "false"

2021-10-11 11:58:07

by Vlastimil Babka

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] mm: mmap_lock: remove redundant "\n" in TP_printk

On 10/9/21 09:11, Gang Li wrote:
> Ftrace core will add "\n" automatically on print. "\n" in TP_printk
> will create blank line, so remove it.
>
> Signed-off-by: Gang Li <[email protected]>

Acked-by: Vlastimil Babka <[email protected]>

> ---
> include/trace/events/mmap_lock.h | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/include/trace/events/mmap_lock.h b/include/trace/events/mmap_lock.h
> index 0abff67b96f0..5f980c92e3e9 100644
> --- a/include/trace/events/mmap_lock.h
> +++ b/include/trace/events/mmap_lock.h
> @@ -32,7 +32,7 @@ TRACE_EVENT_FN(mmap_lock_start_locking,
> ),
>
> TP_printk(
> - "mm=%p memcg_path=%s write=%s\n",
> + "mm=%p memcg_path=%s write=%s",
> __entry->mm,
> __get_str(memcg_path),
> __entry->write ? "true" : "false"
> @@ -63,7 +63,7 @@ TRACE_EVENT_FN(mmap_lock_acquire_returned,
> ),
>
> TP_printk(
> - "mm=%p memcg_path=%s write=%s success=%s\n",
> + "mm=%p memcg_path=%s write=%s success=%s",
> __entry->mm,
> __get_str(memcg_path),
> __entry->write ? "true" : "false",
> @@ -92,7 +92,7 @@ TRACE_EVENT_FN(mmap_lock_released,
> ),
>
> TP_printk(
> - "mm=%p memcg_path=%s write=%s\n",
> + "mm=%p memcg_path=%s write=%s",
> __entry->mm,
> __get_str(memcg_path),
> __entry->write ? "true" : "false"
>