utilities - Print the cpu id for running and runnable threads
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 18 Dec 2010 08:35:13 +0000 (00:35 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 18 Dec 2010 08:35:13 +0000 (00:35 -0800)
* The cpuid was only being printed for the currently running thread on
  a cpu.  Also print it for any scheduled (runnable) threads on that cpu
  even if they aren't the currently running thread.

bin/ps/print.c

index 0a409be..52aee5f 100644 (file)
@@ -194,7 +194,7 @@ state(const KINFO *k, const struct varent *vent)
 
                case LSRUN:
                        *cp = 'R';
-                       if (KI_LWP(k, tdflags) & TDF_RUNNING) {
+                       if (KI_LWP(k, tdflags) & (TDF_RUNNING | TDF_RUNQ)) {
                            ++cp;
                            sprintf(cp, "%d", KI_LWP(k, cpuid));
                            while (cp[1])