Skip to content

Commit a6f22e5

Browse files
Xuewen Yanrostedt
authored andcommitted
tracing: Revert "tracing: Remove pid in task_rename tracing output"
This reverts commit e3f6a42. The commit says that the tracepoint only deals with the current task, however the following case is not current task: comm_write() { p = get_proc_task(inode); if (!p) return -ESRCH; if (same_thread_group(current, p)) set_task_comm(p, buffer); } where set_task_comm() calls __set_task_comm() which records the update of p and not current. So revert the patch to show pid. Cc: <mhiramat@kernel.org> Cc: <mathieu.desnoyers@efficios.com> Cc: <elver@google.com> Cc: <kees@kernel.org> Link: https://patch.msgid.link/20260306075954.4533-1-xuewen.yan@unisoc.com Fixes: e3f6a42 ("tracing: Remove pid in task_rename tracing output") Reported-by: Guohua Yan <guohua.yan@unisoc.com> Signed-off-by: Xuewen Yan <xuewen.yan@unisoc.com> Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent f338e77 commit a6f22e5

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

include/trace/events/task.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,22 @@ TRACE_EVENT(task_rename,
3838
TP_ARGS(task, comm),
3939

4040
TP_STRUCT__entry(
41+
__field( pid_t, pid)
4142
__array( char, oldcomm, TASK_COMM_LEN)
4243
__array( char, newcomm, TASK_COMM_LEN)
4344
__field( short, oom_score_adj)
4445
),
4546

4647
TP_fast_assign(
48+
__entry->pid = task->pid;
4749
memcpy(entry->oldcomm, task->comm, TASK_COMM_LEN);
4850
strscpy(entry->newcomm, comm, TASK_COMM_LEN);
4951
__entry->oom_score_adj = task->signal->oom_score_adj;
5052
),
5153

52-
TP_printk("oldcomm=%s newcomm=%s oom_score_adj=%hd",
53-
__entry->oldcomm, __entry->newcomm, __entry->oom_score_adj)
54+
TP_printk("pid=%d oldcomm=%s newcomm=%s oom_score_adj=%hd",
55+
__entry->pid, __entry->oldcomm,
56+
__entry->newcomm, __entry->oom_score_adj)
5457
);
5558

5659
/**

0 commit comments

Comments
 (0)