]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
callin debug parallel-debug
authorDavid Woodhouse <dwmw@amazon.co.uk>
Tue, 14 Dec 2021 17:39:15 +0000 (17:39 +0000)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Tue, 14 Dec 2021 17:47:51 +0000 (17:47 +0000)
arch/x86/kernel/smpboot.c

index 4fde609107d84d25af12362890f193788d67858f..5f49eba51c4149df0d8ebb722c02ee1e719b601f 100644 (file)
@@ -172,7 +172,7 @@ static void init_freq_invariance(bool secondary, bool cppc_ready);
 static void smp_callin(void)
 {
        int cpuid;
-
+       cycles_t t[6];
        /*
         * If waken up by an INIT in an 82489DX configuration
         * cpu_callout_mask guarantees we don't get here before
@@ -181,6 +181,7 @@ static void smp_callin(void)
         */
        cpuid = smp_processor_id();
 
+       t[0] = get_cycles();
        /*
         * the boot CPU has finished the init stage and is spinning
         * on callin_map until we finish. We are free to set up this
@@ -188,6 +189,7 @@ static void smp_callin(void)
         * boards)
         */
        apic_ap_setup();
+       t[1] = get_cycles();
 
        /*
         * Save our processor parameters and update topology.
@@ -196,8 +198,10 @@ static void smp_callin(void)
         * calibrate_delay() and notify_cpu_starting().
         */
        smp_store_cpu_info(cpuid, false);
+       t[2] = get_cycles();
 
        init_freq_invariance(true, false);
+       t[3] = get_cycles();
 
        /*
         * Get our bogomips.
@@ -208,19 +212,21 @@ static void smp_callin(void)
        calibrate_delay();
        cpu_data(cpuid).loops_per_jiffy = loops_per_jiffy;
        pr_debug("Stack at about %p\n", &cpuid);
+       t[4] = get_cycles();
 
        wmb();
-
        /*
         * This runs the AP through all the cpuhp states to its target
         * state (CPUHP_ONLINE in the case of serial bringup).
         */
        notify_cpu_starting(cpuid);
-
+       t[5] = get_cycles();
        /*
         * Allow the master to continue.
         */
        cpumask_set_cpu(cpuid, cpu_callin_mask);
+       printk("callin CPU %d started in %lld %lld %lld %lld %lld cycles\n", cpuid,
+              t[1] - t[0], t[2] - t[1], t[3] - t[2], t[4] - t[3], t[5] - t[4]);
 }
 
 static int cpu0_logical_apicid;