From: Youngtae Lee Date: Mon, 23 Apr 2018 12:06:54 +0000 (+0900) Subject: DEBUG: Add trace for cpus_up/down. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=80960b5ed6cdb12c25745a1142d4f711dae3ffac;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git DEBUG: Add trace for cpus_up/down. Change-Id: Ic19ff47bd706813bafc99f2d3e421d846acb5c42 Signed-off-by: Youngtae Lee --- diff --git a/include/trace/events/power.h b/include/trace/events/power.h index 13b38537d439..38e730981b6e 100644 --- a/include/trace/events/power.h +++ b/include/trace/events/power.h @@ -800,6 +800,75 @@ TRACE_EVENT(emc_update_cpu_pwr, TP_printk("pre_cpu_mask=%x, cpu=%u, on=%s", __entry->pre_cpu_mask, __entry->cpu, __entry->on? "ON" : "OFF") ); + +TRACE_EVENT(cpus_up_enter, + + TP_PROTO(int cpu), + + TP_ARGS(cpu), + + TP_STRUCT__entry( + __field(int, cpu) + ), + + TP_fast_assign( + __entry->cpu = cpu; + ), + + TP_printk("enter cpus_up cpu%d", __entry->cpu) +); + +TRACE_EVENT(cpus_up_exit, + + TP_PROTO(int cpu), + + TP_ARGS(cpu), + + TP_STRUCT__entry( + __field(int, cpu) + ), + + TP_fast_assign( + __entry->cpu = cpu; + ), + + TP_printk("exit cpus_up cpu%d", __entry->cpu) +); + +TRACE_EVENT(cpus_down_enter, + + TP_PROTO(int cpu), + + TP_ARGS(cpu), + + TP_STRUCT__entry( + __field(int, cpu) + ), + + TP_fast_assign( + __entry->cpu = cpu; + ), + + TP_printk("enter cpus_down cpu%d", __entry->cpu) +); + +TRACE_EVENT(cpus_down_exit, + + TP_PROTO(int cpu), + + TP_ARGS(cpu), + + TP_STRUCT__entry( + __field(int, cpu) + ), + + TP_fast_assign( + __entry->cpu = cpu; + ), + + TP_printk("exit cpus_down cpu%d", __entry->cpu) +); + #endif /* _TRACE_POWER_H */ /* This part must be outside protection */ diff --git a/kernel/cpu.c b/kernel/cpu.c index 5a8e86826949..e76e357144da 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -1122,6 +1122,7 @@ int cpus_down(struct cpumask cpus) { int err, cpu; + trace_cpus_down_enter(cpumask_first(&cpus)); cpu_maps_update_begin(); if (cpu_hotplug_disabled) { @@ -1139,6 +1140,7 @@ int cpus_down(struct cpumask cpus) out: cpu_maps_update_done(); + trace_cpus_down_exit(cpumask_first(&cpus)); return err; } EXPORT_SYMBOL_GPL(cpus_down); @@ -1456,6 +1458,7 @@ int cpus_up(struct cpumask cpus) { int cpu, err = 0; + trace_cpus_up_enter(cpumask_first(&cpus)); for_each_cpu(cpu, &cpus) if (cpu_online(cpu)) { cpumask_clear_cpu(cpu, &cpus); @@ -1478,6 +1481,7 @@ int cpus_up(struct cpumask cpus) err = _cpus_up(cpus, 0, CPUHP_ONLINE); out: cpu_maps_update_done(); + trace_cpus_up_exit(cpumask_first(&cpus)); return err; }