sched: Update tracepoint to include task info
Update sched_get_task_cpu_cycles trace to include pid and name of the task to help with debug better. Change-Id: Ic307ebcf0a44c94bf0a2aa1a02b8aeff39010b29 Signed-off-by: Puja Gupta <pujag@codeaurora.org> Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
This commit is contained in:
parent
6e92713cba
commit
f9e96dfcb8
2 changed files with 10 additions and 5 deletions
|
@ -436,9 +436,9 @@ TRACE_EVENT(sched_update_task_ravg,
|
||||||
|
|
||||||
TRACE_EVENT(sched_get_task_cpu_cycles,
|
TRACE_EVENT(sched_get_task_cpu_cycles,
|
||||||
|
|
||||||
TP_PROTO(int cpu, int event, u64 cycles, u64 exec_time),
|
TP_PROTO(int cpu, int event, u64 cycles, u64 exec_time, struct task_struct *p),
|
||||||
|
|
||||||
TP_ARGS(cpu, event, cycles, exec_time),
|
TP_ARGS(cpu, event, cycles, exec_time, p),
|
||||||
|
|
||||||
TP_STRUCT__entry(
|
TP_STRUCT__entry(
|
||||||
__field(int, cpu )
|
__field(int, cpu )
|
||||||
|
@ -448,6 +448,8 @@ TRACE_EVENT(sched_get_task_cpu_cycles,
|
||||||
__field(u32, freq )
|
__field(u32, freq )
|
||||||
__field(u32, legacy_freq )
|
__field(u32, legacy_freq )
|
||||||
__field(u32, max_freq)
|
__field(u32, max_freq)
|
||||||
|
__field(pid_t, pid )
|
||||||
|
__array(char, comm, TASK_COMM_LEN )
|
||||||
),
|
),
|
||||||
|
|
||||||
TP_fast_assign(
|
TP_fast_assign(
|
||||||
|
@ -458,12 +460,14 @@ TRACE_EVENT(sched_get_task_cpu_cycles,
|
||||||
__entry->freq = cpu_cycles_to_freq(cycles, exec_time);
|
__entry->freq = cpu_cycles_to_freq(cycles, exec_time);
|
||||||
__entry->legacy_freq = cpu_cur_freq(cpu);
|
__entry->legacy_freq = cpu_cur_freq(cpu);
|
||||||
__entry->max_freq = cpu_max_freq(cpu);
|
__entry->max_freq = cpu_max_freq(cpu);
|
||||||
|
__entry->pid = p->pid;
|
||||||
|
memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
|
||||||
),
|
),
|
||||||
|
|
||||||
TP_printk("cpu=%d event=%d cycles=%llu exec_time=%llu freq=%u legacy_freq=%u max_freq=%u",
|
TP_printk("cpu=%d event=%d cycles=%llu exec_time=%llu freq=%u legacy_freq=%u max_freq=%u task=%d (%s)",
|
||||||
__entry->cpu, __entry->event, __entry->cycles,
|
__entry->cpu, __entry->event, __entry->cycles,
|
||||||
__entry->exec_time, __entry->freq, __entry->legacy_freq,
|
__entry->exec_time, __entry->freq, __entry->legacy_freq,
|
||||||
__entry->max_freq)
|
__entry->max_freq, __entry->pid, __entry->comm)
|
||||||
);
|
);
|
||||||
|
|
||||||
TRACE_EVENT(sched_update_history,
|
TRACE_EVENT(sched_update_history,
|
||||||
|
|
|
@ -2608,7 +2608,8 @@ update_task_rq_cpu_cycles(struct task_struct *p, struct rq *rq, int event,
|
||||||
|
|
||||||
p->cpu_cycles = cur_cycles;
|
p->cpu_cycles = cur_cycles;
|
||||||
|
|
||||||
trace_sched_get_task_cpu_cycles(cpu, event, rq->cc.cycles, rq->cc.time);
|
trace_sched_get_task_cpu_cycles(cpu, event, rq->cc.cycles,
|
||||||
|
rq->cc.time, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
Loading…
Add table
Reference in a new issue