Added tracepoints for CPU boot-up.
authorGerd Zellweger <mail@gerdzellweger.com>
Thu, 10 Oct 2013 11:26:49 +0000 (13:26 +0200)
committerGerd Zellweger <mail@gerdzellweger.com>
Thu, 24 Oct 2013 08:26:07 +0000 (10:26 +0200)
Also, removed trailing whitespace in start_cpu.c

kernel/arch/x86_64/start_aps.c
trace_definitions/trace_defs.pleco
usr/kaluga/Hakefile
usr/kaluga/main.c
usr/kaluga/start_cpu.c
usr/monitor/main.c

index cff3749..d8a0170 100644 (file)
@@ -26,6 +26,7 @@
 #include <arch/x86/kputchar.h>
 #include "xapic_dev.h"
 #include <target/x86_64/offsets_target.h>
+#include <trace/trace.h>
 
 /**
  * start_ap and start_ap_end mark the start end the end point of the assembler
@@ -55,6 +56,9 @@ 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_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);
     uint8_t *real_src = (uint8_t *) &x86_64_start_ap;
@@ -123,6 +127,9 @@ 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_REQUEST_DONE, 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++) {
         if (*ap_lock != 0) {
@@ -134,6 +141,8 @@ 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_START_REQUEST_ACK, core_id);
         *ap_lock = 0;
         debug(SUBSYS_STARTUP, "booted CPU%hhu\n", core_id);
         return 0;
index 5295a6d..c047cda 100644 (file)
@@ -19,7 +19,7 @@
  * Example:
  *
  * The subystem:
- * 
+ *
  * subsystem mysubsystem {
  *             event myevent "",
  * }
@@ -49,6 +49,9 @@ subsystem kernel {
        event SCHED_SCHEDULE            "",
        event SCHED_CURRENT             "",
 
+    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 bbd2a4f..b6b66d7 100644 (file)
@@ -16,7 +16,8 @@
                       flounderBindings = [ "octopus" ],
                       flounderExtraDefs = [ ("monitor_blocking",["rpcclient"]) ],
                       flounderTHCStubs = [ "octopus" ],
-                      addLibraries = libDeps [ "skb", "octopus", "vfs", 
-                                               "spawndomain", "elf", "mm" ],
+                      addLibraries = libDeps [ "skb", "octopus", "vfs",
+                                               "spawndomain", "elf", "mm",
+                                               "trace" ],
                       architectures = [ "x86_64", "x86_32", "armv7" ] }
 ]
index 57d0dfb..5c65d5a 100644 (file)
@@ -32,6 +32,9 @@
 #include <octopus/octopus.h>
 #include <skb/skb.h>
 
+#include <trace/trace.h>
+
+
 #include "kaluga.h"
 
 coreid_t my_core_id = 0;  // Core ID
index d3b9cfd..95db7bf 100644 (file)
@@ -164,7 +164,7 @@ static void cpu_change_event(octopus_mode_t mode, char* record, void* state)
             struct mon_msg_state* mms = NULL;
             err = new_mon_msg(&mms, send_boot_core_request);
             assert(err_is_ok(err));
-           
+
             mms->core_id = core_counter;
             mms->arch_id = arch_id;
             mms->send(mb, mms);
index 7922c41..c70ac2c 100644 (file)
@@ -98,7 +98,7 @@ static errval_t boot_bsp_core(int argc, char *argv[])
     }
 
     /* initialise rcap_db */
-    err = rcap_db_init(); 
+    err = rcap_db_init();
     if (err_is_fail(err)) {
         DEBUG_ERR(err, "monitor rcap_db init failed");
         return err;