Added some trace events to measure time to bring CPU online.
authorGerd Zellweger <mail@gerdzellweger.com>
Thu, 24 Oct 2013 09:05:43 +0000 (11:05 +0200)
committerGerd Zellweger <mail@gerdzellweger.com>
Thu, 14 Nov 2013 08:55:38 +0000 (09:55 +0100)
kernel/arch/x86_64/start_aps.c
trace_definitions/trace_defs.pleco
usr/kaluga/main.c
usr/monitor/main.c

index 9fbfcc0..e4bcb12 100644 (file)
@@ -57,7 +57,7 @@ extern uint64_t x86_64_init_ap_global;
 int start_aps_x86_64_start(uint8_t core_id, genvaddr_t entry)
 {
     trace_event(TRACE_SUBSYS_KERNEL,
-                TRACE_EVENT_KERNEL_START_CORE_REQUEST, core_id);
+                TRACE_EVENT_KERNEL_CORE_START_REQUEST, core_id);
 
     /* Copy the startup code to the real-mode address */
     uint8_t *real_dest = (uint8_t *) local_phys_to_mem(X86_64_REAL_MODE_LINEAR_OFFSET);
@@ -127,8 +127,7 @@ int start_aps_x86_64_start(uint8_t core_id, genvaddr_t entry)
     apic_send_start_up(core_id, xapic_none,
                        X86_64_REAL_MODE_SEGMENT_TO_REAL_MODE_PAGE(X86_64_REAL_MODE_SEGMENT));
 
-    trace_event(TRACE_SUBSYS_KERNEL,
-                TRACE_EVENT_KERNEL_CORE_START_IPI_SENT, core_id);
+    trace_event(TRACE_SUBSYS_KERNEL, TRACE_EVENT_KERNEL_CORE_START_REQUEST, core_id);
 
     //give the new core a bit time to start-up and set the lock
     for (uint64_t i = 0; i < STARTUP_TIMEOUT; i++) {
@@ -141,8 +140,7 @@ int start_aps_x86_64_start(uint8_t core_id, genvaddr_t entry)
     //a core with this APIC ID doesn't exist.
     if (*ap_lock != 0) {
         while (*ap_wait != AP_STARTED);
-        trace_event(TRACE_SUBSYS_KERNEL,
-                    TRACE_EVENT_KERNEL_CORE_IS_UP, core_id);
+        trace_event(TRACE_SUBSYS_KERNEL, TRACE_EVENT_KERNEL_CORE_START_REQUEST_ACK, core_id);
         *ap_lock = 0;
         debug(SUBSYS_STARTUP, "booted CPU%hhu\n", core_id);
         return 0;
index 42dbeee..8e7ec54 100644 (file)
@@ -49,10 +49,9 @@ subsystem kernel {
        event SCHED_SCHEDULE            "",
        event SCHED_CURRENT             "",
 
-    event START_CORE_REQUEST "Received (monitor -> kernel) [in kernel].",
-    event CORE_START_IPI_SENT      "Request sent, waiting for core to appear.",
-    event CORE_IS_UP        "New kernel is online.",
-
+    event CORE_START_REQUEST      "Requested start of a new core.",
+    event CORE_START_REQUEST_DONE "Request is sent, waiting for core to come up.",
+    event CORE_START_REQUEST_ACK  "Core is online.",
 };
 
 subsystem threads {
index 5c01147..a415822 100644 (file)
@@ -70,6 +70,12 @@ int main(int argc, char** argv)
 
     errval_t err;
 
+    trace_reset_all();
+    trace_set_autoflush(true);
+    err = trace_control (TRACE_SUBSYS_KERNEL, TRACE_EVENT_KERNEL_CORE_START_REQUEST, 0);
+    assert(err_is_ok(err));
+    trace_set_all_subsys_enabled(true);
+
     my_core_id = disp_get_core_id();
     parse_arguments(argc, argv);
 
index 84fc513..22b2e82 100644 (file)
@@ -314,6 +314,7 @@ int main(int argc, char *argv[])
             printf("Warning: tracing not available on core %d\n", my_core_id);
         }
     }
+    trace_set_autoflush(true);
 #endif // tracing
 
     domain_mgmt_init();