Print out whether a process is VC ctx ready
authorBarret Rhoden <brho@cs.berkeley.edu>
Wed, 25 Jan 2017 19:15:51 +0000 (14:15 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Wed, 8 Feb 2017 21:36:32 +0000 (16:36 -0500)
Early in a process's life, it is not capable of managing itself.  Once it
is ready, it tells the kernel.  Notably, it also changes the syscall
blockon function pointer, which changes how it responds to blocking
syscalls.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/src/process.c

index 0ef571e..f9d754c 100644 (file)
@@ -2377,10 +2377,13 @@ void print_proc_info(pid_t pid)
        uint64_t total_time = 0;
        struct proc *child, *p = pid2proc(pid);
        struct vcore *vc_i;
+       struct preempt_data *vcpd;
+
        if (!p) {
                printk("Bad PID.\n");
                return;
        }
+       vcpd = &p->procdata->vcore_preempt_data[0];
        spinlock_debug(&p->proc_lock);
        //spin_lock(&p->proc_lock); // No locking!!
        printk("struct proc: %p\n", p);
@@ -2389,6 +2392,8 @@ void print_proc_info(pid_t pid)
        printk("PPID: %d\n", p->ppid);
        printk("State: %s (%p)\n", procstate2str(p->state), p->state);
        printk("\tIs %san MCP\n", p->procinfo->is_mcp ? "" : "not ");
+       if (!scp_is_vcctx_ready(vcpd))
+               printk("\tIs NOT vcctx ready\n");
        printk("Refcnt: %d\n", atomic_read(&p->p_kref.refcount) - 1);
        printk("Flags: 0x%08x\n", p->env_flags);
        printk("CR3(phys): %p\n", p->env_cr3);