[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210430142223.25500-3-peter.enderborg@sony.com>
Date: Fri, 30 Apr 2021 16:22:23 +0200
From: Peter Enderborg <peter.enderborg@...y.com>
To: <linux-kernel@...r.kernel.org>,
Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
"Eric W . Biederman" <ebiederm@...ssion.com>,
Peter Zijlstra <peterz@...radead.org>,
Alexei Starovoitov <ast@...nel.org>,
Christian Brauner <christian.brauner@...ntu.com>,
Davidlohr Bueso <dave@...olabs.net>,
Michel Lespinasse <walken@...gle.com>,
Jann Horn <jannh@...gle.com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Christophe Leroy <christophe.leroy@....fr>,
Minchan Kim <minchan@...nel.org>
CC: Peter Enderborg <peter.enderborg@...y.com>
Subject: [PATCH 2/2] tracing: Align task.h to use __assing_str for strings.
This moves the comm strings to use the tracing string functions
instead of char arrays so they all work in the same way.
Signed-off-by: Peter Enderborg <peter.enderborg@...y.com>
---
include/trace/events/task.h | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/include/trace/events/task.h b/include/trace/events/task.h
index 2e977d2935e1..2bd314e60cb6 100644
--- a/include/trace/events/task.h
+++ b/include/trace/events/task.h
@@ -14,20 +14,20 @@ TRACE_EVENT(task_newtask,
TP_STRUCT__entry(
__field( pid_t, pid)
- __array( char, comm, TASK_COMM_LEN)
+ __string(comm, task->comm)
__field( unsigned long, clone_flags)
__field( short, oom_score_adj)
),
TP_fast_assign(
__entry->pid = task->pid;
- memcpy(__entry->comm, task->comm, TASK_COMM_LEN);
+ __assign_str(comm, task->comm);
__entry->clone_flags = clone_flags;
__entry->oom_score_adj = task->signal->oom_score_adj;
),
TP_printk("pid=%d comm=%s clone_flags=%lx oom_score_adj=%hd",
- __entry->pid, __entry->comm,
+ __entry->pid, __get_str(comm),
__entry->clone_flags, __entry->oom_score_adj)
);
@@ -39,21 +39,21 @@ TRACE_EVENT(task_rename,
TP_STRUCT__entry(
__field( pid_t, pid)
- __array( char, oldcomm, TASK_COMM_LEN)
- __array( char, newcomm, TASK_COMM_LEN)
+ __string(oldcomm, task->comm)
+ __string(newcomm, comm)
__field( short, oom_score_adj)
),
TP_fast_assign(
__entry->pid = task->pid;
- memcpy(entry->oldcomm, task->comm, TASK_COMM_LEN);
- strlcpy(entry->newcomm, comm, TASK_COMM_LEN);
+ __assign_str(oldcomm, task->comm);
+ __assign_str(newcomm, comm);
__entry->oom_score_adj = task->signal->oom_score_adj;
),
TP_printk("pid=%d oldcomm=%s newcomm=%s oom_score_adj=%hd",
- __entry->pid, __entry->oldcomm,
- __entry->newcomm, __entry->oom_score_adj)
+ __entry->pid, __get_str(oldcomm),
+ __get_str(newcomm), __entry->oom_score_adj)
);
TRACE_EVENT(task_exit,
--
2.17.1
Powered by blists - more mailing lists