Skip to content

Commit e3f6a42

Browse files
melverkees
authored andcommitted
tracing: Remove pid in task_rename tracing output
Remove pid in task_rename tracepoint output, since that tracepoint only deals with the current task, and is printed by default. This also saves some space in the entry and avoids wasted padding. Link: https://lkml.kernel.org/r/20241105120247.596a0dc9@gandalf.local.home Suggested-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Marco Elver <elver@google.com> Link: https://lore.kernel.org/r/20241108113455.2924361-2-elver@google.com Signed-off-by: Kees Cook <kees@kernel.org>
1 parent c38904e commit e3f6a42

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

include/trace/events/task.h

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

4040
TP_STRUCT__entry(
41-
__field( pid_t, pid)
4241
__array( char, oldcomm, TASK_COMM_LEN)
4342
__array( char, newcomm, TASK_COMM_LEN)
4443
__field( short, oom_score_adj)
4544
),
4645

4746
TP_fast_assign(
48-
__entry->pid = task->pid;
4947
memcpy(entry->oldcomm, task->comm, TASK_COMM_LEN);
5048
strscpy(entry->newcomm, comm, TASK_COMM_LEN);
5149
__entry->oom_score_adj = task->signal->oom_score_adj;
5250
),
5351

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

5956
/**

0 commit comments

Comments
 (0)