]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
Print per-phase x86 timing
authorDavid Woodhouse <dwmw@amazon.co.uk>
Tue, 14 Dec 2021 16:46:30 +0000 (16:46 +0000)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Tue, 14 Dec 2021 16:50:18 +0000 (16:50 +0000)
arch/x86/kernel/smpboot.c

index 725fede281ace6345efc11de25afe98d2ab33131..4fde609107d84d25af12362890f193788d67858f 100644 (file)
@@ -1338,7 +1338,9 @@ early_param("no_parallel_bringup", no_parallel_bringup);
 int native_cpu_up(unsigned int cpu, struct task_struct *tidle)
 {
        int ret;
+       cycles_t t[5];
 
+       t[0] = get_cycles();
        /* If parallel AP bringup isn't enabled, perform the first steps now. */
        if (!do_parallel_bringup) {
                ret = do_cpu_up(cpu, tidle);
@@ -1346,16 +1348,24 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle)
                        return ret;
        }
 
+       t[1] = get_cycles();
        ret = do_wait_cpu_initialized(cpu);
        if (ret)
                return ret;
 
+       t[2] = get_cycles();
        ret = do_wait_cpu_callin(cpu);
        if (ret)
                return ret;
 
+       t[3] = get_cycles();
        ret = do_wait_cpu_online(cpu);
 
+       t[4] = get_cycles();
+
+       printk("Brought up CPU %d in %lld, %lld, %lld, %lld, cycles\n", cpu,
+              t[1] - t[0], t[2] - t[1], t[3] - t[2], t[4] - t[3]);
+
        if (x86_platform.legacy.warm_reset) {
                /*
                 * Cleanup possible dangling ends...