DEBUG: Add trace for cpus_up/down.
authorYoungtae Lee <yt0729.lee@samsung.com>
Mon, 23 Apr 2018 12:06:54 +0000 (21:06 +0900)
committerlakkyung.jung <lakkyung.jung@samsung.com>
Mon, 23 Jul 2018 05:59:16 +0000 (14:59 +0900)
Change-Id: Ic19ff47bd706813bafc99f2d3e421d846acb5c42
Signed-off-by: Youngtae Lee <yt0729.lee@samsung.com>
include/trace/events/power.h
kernel/cpu.c

index 13b38537d4392cba66d6be5891c453e2f6c73e76..38e730981b6ebd3839ce94d0cc528171e610607a 100644 (file)
@@ -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 */
index 5a8e868269494938f7e6f62bef459b5942888d8a..e76e357144da90127d33afe8e5107bd6f2770aca 100644 (file)
@@ -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;
 }