Commit 1acaa1b2 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by Steven Rostedt
Browse files

tracing: Update the comm field in the right variable in update_max_tr

The latency output showed:

 #    | task: -3 (uid:0 nice:0 policy:1 rt_prio:99)

The comm is missing in the "task:" and it looks like a minus 3 is
the output. The correct display should be:

 #    | task: migration/0-3 (uid:0 nice:0 policy:1 rt_prio:99)

The problem is that the comm is being stored in the wrong data
structure. The[cpu] is what stores the comm, not the

Before this patch the[cpu]->comm was zeroed and the /debug/trace
ended up showing just the '-' sign followed by the pid.

Also remove a needless initialization of max_data.
Signed-off-by: default avatarArnaldo Carvalho de Melo <>
LKML-Reference: <>
Signed-off-by: default avatarSteven Rostedt <>
parent a094fe04
......@@ -592,7 +592,7 @@ static void
__update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu)
struct trace_array_cpu *data = tr->data[cpu];
struct trace_array_cpu *max_data = tr->data[cpu];
struct trace_array_cpu *max_data;
max_tr.cpu = cpu;
max_tr.time_start = data->preempt_timestamp;
......@@ -602,7 +602,7 @@ __update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu)
max_data->critical_start = data->critical_start;
max_data->critical_end = data->critical_end;
memcpy(data->comm, tsk->comm, TASK_COMM_LEN);
memcpy(max_data->comm, tsk->comm, TASK_COMM_LEN);
max_data->pid = tsk->pid;
max_data->uid = task_uid(tsk);
max_data->nice = tsk->static_prio - 20 - MAX_RT_PRIO;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment