From c9ed39dd5ed10f60353578f66854a2f97a746b84 Mon Sep 17 00:00:00 2001 From: Pavankumar Kondeti Date: Tue, 9 Jun 2020 16:20:50 +0530 Subject: [PATCH 1/2] 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. Change-Id: Ib473f9ccdc78003bb1f5d2dc24354f2db7a684f5 Signed-off-by: Pavankumar Kondeti --- 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 e28fd7aaef26..efe3abf842ae 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h @@ -245,6 +245,7 @@ TRACE_EVENT(sched_migrate_task, __field( int, prio ) __field( int, orig_cpu ) __field( int, dest_cpu ) + __field( int, running ) ), TP_fast_assign( @@ -253,11 +254,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) ); /* From ca7e6941c1adaee6e9a17f557c86f645f2399ca8 Mon Sep 17 00:00:00 2001 From: Pavankumar Kondeti Date: Wed, 10 Jun 2020 08:10:51 +0530 Subject: [PATCH 2/2] sched/tracing: Fix format specifiers in sched_compute_energy The energy values passed to sched_compute_energy trace event are of unsigned long type. So use %lu format specifier instead of %llu. Change-Id: I1e82b34559d76d5cfb023598a8ce62917281a9af Signed-off-by: Pavankumar Kondeti --- include/trace/events/sched.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index efe3abf842ae..7f6994b580f7 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h @@ -990,7 +990,7 @@ TRACE_EVENT(sched_compute_energy, __entry->best_energy = best_energy; ), - TP_printk("pid=%d comm=%s util=%lu prev_cpu=%d prev_energy=%llu eval_cpu=%d eval_energy=%llu best_energy_cpu=%d best_energy=%llu", + TP_printk("pid=%d comm=%s util=%lu prev_cpu=%d prev_energy=%lu eval_cpu=%d eval_energy=%lu best_energy_cpu=%d best_energy=%lu", __entry->pid, __entry->comm, __entry->util, __entry->prev_cpu, __entry->prev_energy, __entry->eval_cpu, __entry->eval_energy, __entry->best_energy_cpu, __entry->best_energy)