Commit a6f22e50 authored by Xuewen Yan's avatar Xuewen Yan Committed by Steven Rostedt (Google)
Browse files

tracing: Revert "tracing: Remove pid in task_rename tracing output"

This reverts commit e3f6a422.

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: e3f6a422 ("tracing: Remove pid in task_rename tracing output")
Reported-by: default avatarGuohua Yan <guohua.yan@unisoc.com>
Signed-off-by: default avatarXuewen Yan <xuewen.yan@unisoc.com>
Reviewed-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
parent f338e773
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -38,19 +38,22 @@ TRACE_EVENT(task_rename,
	TP_ARGS(task, comm),

	TP_STRUCT__entry(
		__field(	pid_t,	pid)
		__array(	char, oldcomm,  TASK_COMM_LEN)
		__array(	char, newcomm,  TASK_COMM_LEN)
		__field(	short,	oom_score_adj)
	),

	TP_fast_assign(
		__entry->pid = task->pid;
		memcpy(entry->oldcomm, task->comm, TASK_COMM_LEN);
		strscpy(entry->newcomm, comm, TASK_COMM_LEN);
		__entry->oom_score_adj = task->signal->oom_score_adj;
	),

	TP_printk("oldcomm=%s newcomm=%s oom_score_adj=%hd",
		  __entry->oldcomm, __entry->newcomm, __entry->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)
);

/**