Skip to content

Commit

Permalink
tracing: Remove pid in task_rename tracing output
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marco Elver authored and Kees Cook committed Dec 23, 2024
1 parent c38904e commit e3f6a42
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions include/trace/events/task.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,19 @@ 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("pid=%d oldcomm=%s newcomm=%s oom_score_adj=%hd",
__entry->pid, __entry->oldcomm,
__entry->newcomm, __entry->oom_score_adj)
TP_printk("oldcomm=%s newcomm=%s oom_score_adj=%hd",
__entry->oldcomm, __entry->newcomm, __entry->oom_score_adj)
);

/**
Expand Down

0 comments on commit e3f6a42

Please sign in to comment.