kth: Rename db sem to db blk
authorBarret Rhoden <brho@cs.berkeley.edu>
Wed, 7 Nov 2018 20:42:40 +0000 (15:42 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Fri, 14 Dec 2018 22:23:48 +0000 (17:23 -0500)
The old "db sem" will keep working for a while.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/include/kthread.h
kern/src/kthread.c
kern/src/monitor.c

index ba276a5..d9c8a74 100644 (file)
@@ -158,7 +158,7 @@ void sem_down_bulk_irqsave(struct semaphore *sem, int nr_signals,
                            int8_t *irq_state);
 void sem_down_irqsave(struct semaphore *sem, int8_t *irq_state);
 bool sem_up_irqsave(struct semaphore *sem, int8_t *irq_state);
-void print_all_sem_info(pid_t pid);
+void print_db_blk_info(pid_t pid);
 
 void cv_init(struct cond_var *cv);
 void cv_init_irqsave(struct cond_var *cv);
index 5e75c84..dbe6ae7 100644 (file)
@@ -673,7 +673,7 @@ static void db_print_obj(struct kth_db_info *db, pid_t pid)
        spin_unlock_irqsave(db_get_spinlock(db));
 }
 
-void print_all_sem_info(pid_t pid)
+void print_db_blk_info(pid_t pid)
 {
        struct kth_db_info *db_i;
 
@@ -700,7 +700,7 @@ static void db_init(struct kth_db_info *db, int type)
 {
 }
 
-void print_all_sem_info(pid_t pid)
+void print_db_blk_info(pid_t pid)
 {
        printk("Failed to print all sems: build with CONFIG_SEMAPHORE_DEBUG\n");
 }
index 7bc7eb2..3f26125 100644 (file)
@@ -1005,14 +1005,14 @@ int mon_db(int argc, char **argv, struct hw_trapframe *hw_tf)
 
        if (argc < 2) {
                printk("Usage: db OPTION\n");
-               printk("\tsem [PID]: print all semaphore info\n");
+               printk("\tblk [PID]: print all blocked kthreads\n");
                printk("\taddr PID 0xADDR: for PID lookup ADDR's file/vmr info\n");
                return 1;
        }
-       if (!strcmp(argv[1], "sem")) {
+       if (!strcmp(argv[1], "blk") || !strcmp(argv[1], "sem")) {
                if (argc > 2)
                        pid = strtol(argv[2], 0, 0);
-               print_all_sem_info(pid);
+               print_db_blk_info(pid);
        } else if (!strcmp(argv[1], "addr")) {
                if (argc < 4) {
                        printk("Usage: db addr PID 0xADDR\n");