Allow filtering by PID for "db sem"
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 23 Feb 2017 16:21:47 +0000 (11:21 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 2 Mar 2017 18:01:28 +0000 (13:01 -0500)
commit31e572ba36f16f7f17724bc3703977f6b9789d86
treeda3fee91957d3af194b6c980cbd6c3aa7918d933
parent1030d060f8476186575035cb147421e511014d5d
Allow filtering by PID for "db sem"

The PID argument to "db sem" is optional.  Without it, it shows all
semaphores.  With it, it will only show sems with kthreads of a particular
process.  Use PID == 0 for "no process" (e.g., ktasks).

bash-4.3$ m db sem 272
All sems with waiters:
Semaphore 0xffff8000096db630 has -1 signals (neg = waiters)
        Kthread 0xffff800007dfd620 (open /net/tcp/0/listen at fd -100),
            proc 272, sysc 0x00007f7fff9fe840,
            pc/frame 0xffffffffc201948a 0xfffffff000017ad8

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