* [RFC PATCH] tracing: Revert "tracing: Remove pid in task_rename tracing output"
@ 2026-03-05 8:08 Xuewen Yan
2026-03-05 15:08 ` Steven Rostedt
0 siblings, 1 reply; 2+ messages in thread
From: Xuewen Yan @ 2026-03-05 8:08 UTC (permalink / raw)
To: rostedt, mhiramat, mathieu.desnoyers, elver, kees
Cc: lorenzo.stoakes, brauner, schuster.simon, david, linux-kernel,
linux-trace-kernel, guohua.yan, ke.wang, xuewen.yan94
This reverts commit e3f6a42272e028c46695acc83fc7d7c42f2750ad.
The commit says that the tracepoint only deals with the current task,
however the following case is not current task:
comm_write
set_task_comm
__set_task_comm
trace_task_rename
So revert the patch to show pid.
Fixes: e3f6a42272e0 ("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>
---
include/trace/events/task.h | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/include/trace/events/task.h b/include/trace/events/task.h
index 4f0759634306..b9a129eb54d9 100644
--- a/include/trace/events/task.h
+++ b/include/trace/events/task.h
@@ -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)
);
/**
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [RFC PATCH] tracing: Revert "tracing: Remove pid in task_rename tracing output"
2026-03-05 8:08 [RFC PATCH] tracing: Revert "tracing: Remove pid in task_rename tracing output" Xuewen Yan
@ 2026-03-05 15:08 ` Steven Rostedt
0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2026-03-05 15:08 UTC (permalink / raw)
To: Xuewen Yan
Cc: mhiramat, mathieu.desnoyers, elver, kees, lorenzo.stoakes,
brauner, schuster.simon, david, linux-kernel, linux-trace-kernel,
guohua.yan, ke.wang, xuewen.yan94
On Thu, 5 Mar 2026 16:08:09 +0800
Xuewen Yan <xuewen.yan@unisoc.com> wrote:
> This reverts commit e3f6a42272e028c46695acc83fc7d7c42f2750ad.
>
> The commit says that the tracepoint only deals with the current task,
> however the following case is not current task:
>
> comm_write
> set_task_comm
> __set_task_comm
> trace_task_rename
I'm fine with the patch, but the change log can use a bit of work:
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.
The above states exactly why current isn't the pid that should be recorded.
Other than that.
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
-- Steve
>
> So revert the patch to show pid.
>
> Fixes: e3f6a42272e0 ("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>
> ---
> include/trace/events/task.h | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/include/trace/events/task.h b/include/trace/events/task.h
> index 4f0759634306..b9a129eb54d9 100644
> --- a/include/trace/events/task.h
> +++ b/include/trace/events/task.h
> @@ -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)
> );
>
> /**
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-05 15:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-05 8:08 [RFC PATCH] tracing: Revert "tracing: Remove pid in task_rename tracing output" Xuewen Yan
2026-03-05 15:08 ` Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox