diff options
author | Michael Foiani <mfoiani@cs.brown.edu> | 2024-02-11 04:05:38 -0500 |
---|---|---|
committer | Michael Foiani <mfoiani@cs.brown.edu> | 2024-02-11 04:05:38 -0500 |
commit | c2cebabba05eff0436faf90bbd691c1e36f7013c (patch) | |
tree | 395bd6c7513b028c82b9c4cd5ffc1ebf8e1787ca /kernel/proc | |
parent | 65ece110519f88227039921b09dab60ec4d3d982 (diff) |
add debug statements and start some testing
Diffstat (limited to 'kernel/proc')
-rw-r--r-- | kernel/proc/kthread.c | 4 | ||||
-rw-r--r-- | kernel/proc/proc.c | 4 | ||||
-rw-r--r-- | kernel/proc/sched.c | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/kernel/proc/kthread.c b/kernel/proc/kthread.c index 5f707c3..42beb77 100644 --- a/kernel/proc/kthread.c +++ b/kernel/proc/kthread.c @@ -69,6 +69,8 @@ kthread_t *kthread_create(proc_t *proc, kthread_func_t func, long arg1, void *arg2) { // NOT_YET_IMPLEMENTED("PROCS: kthread_create"); + dbg(DBG_THR, "ATTEMPT to create a new thread with proc name=%s, id=%d\n", proc->p_name, proc->p_pid); + kthread_t *new_thread = slab_obj_alloc(kthread_allocator); if (new_thread == NULL) { @@ -97,6 +99,8 @@ kthread_t *kthread_create(proc_t *proc, kthread_func_t func, long arg1, list_init(&new_thread->kt_mutexes); new_thread->kt_recent_core = 0; + dbg(DBG_THR, "SUCCESFULLY created a new thread with proc name=%s, id=%d\n", proc->p_name, proc->p_pid); + return new_thread; } diff --git a/kernel/proc/proc.c b/kernel/proc/proc.c index fd253f6..ef8245d 100644 --- a/kernel/proc/proc.c +++ b/kernel/proc/proc.c @@ -181,6 +181,8 @@ proc_t *proc_create(const char *name) return NULL; } + dbg(DBG_PROC, "creating process name=%s & pid =%d\n", name, proc_pid); + proc_t *proc = (proc_t *)slab_obj_alloc(proc_allocator); if (proc == NULL) { @@ -378,7 +380,7 @@ void proc_destroy(proc_t *proc) vmmap_destroy(&proc->p_vmmap); #endif - dbg(DBG_THR, "destroying P%d\n", proc->p_pid); + dbg(DBG_PROC, "destroying P%d\n", proc->p_pid); KASSERT(proc->p_pml4); pt_destroy(proc->p_pml4); diff --git a/kernel/proc/sched.c b/kernel/proc/sched.c index 26d0b22..c4f1d5a 100644 --- a/kernel/proc/sched.c +++ b/kernel/proc/sched.c @@ -270,6 +270,8 @@ void sched_make_runnable(kthread_t *thr) { // NOT_YET_IMPLEMENTED("PROCS: sched_make_runnable"); + dbg(DBG_SCHED, "Making thread with proc pid %d runnable\n", thr->kt_proc->p_pid); + KASSERT(thr != curthr); KASSERT(thr->kt_state != KT_RUNNABLE); |