From 2a715fd012ed4730328dc6e48e1c6ded021abbfc Mon Sep 17 00:00:00 2001 From: Pavankumar Kondeti Date: Tue, 9 Jun 2020 16:20:50 +0530 Subject: [PATCH] ANDROID: sched/tracing: Print task status in sched_migrate_task A task can migrate either while it is waking or while it is running via load balancer. Print the task status i.e running or not in sched_migrate_task. This helps in counting the different types of migrations without relying on other trace events. Bug: 176709810 Change-Id: Ib473f9ccdc78003bb1f5d2dc24354f2db7a684f5 Signed-off-by: Pavankumar Kondeti Signed-off-by: Satya Durga Srinivasu Prabhala --- include/trace/events/sched.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index 3f94218f2520..bcd7f1fbb8cd 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h @@ -198,6 +198,7 @@ TRACE_EVENT(sched_migrate_task, __field( int, prio ) __field( int, orig_cpu ) __field( int, dest_cpu ) + __field( int, running ) ), TP_fast_assign( @@ -206,11 +207,13 @@ TRACE_EVENT(sched_migrate_task, __entry->prio = p->prio; /* XXX SCHED_DEADLINE */ __entry->orig_cpu = task_cpu(p); __entry->dest_cpu = dest_cpu; + __entry->running = (p->state == TASK_RUNNING); ), - TP_printk("comm=%s pid=%d prio=%d orig_cpu=%d dest_cpu=%d", + TP_printk("comm=%s pid=%d prio=%d orig_cpu=%d dest_cpu=%d running=%d", __entry->comm, __entry->pid, __entry->prio, - __entry->orig_cpu, __entry->dest_cpu) + __entry->orig_cpu, __entry->dest_cpu, + __entry->running) ); DECLARE_EVENT_CLASS(sched_process_template,