top - Fix -t / -S
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 23 Sep 2012 02:07:02 +0000 (19:07 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 23 Sep 2012 02:07:02 +0000 (19:07 -0700)
* -t to show threads now just shows threaded processes (all LWPs),
  and no longer also shows system processes.

* -s to show system threads now works as expected.

usr.bin/top/m_dragonfly.c

index 3e586f4..75a58a8 100644 (file)
@@ -483,7 +483,7 @@ get_process_info(struct system_info *si, struct process_select *sel,
                 * status field.  Processes with P_SYSTEM set are system
                 * processes---these get ignored unless show_sysprocs is set.
                 */
-               if ((show_threads && (LP(pp, pid) == -1)) ||
+               if ((show_system && (LP(pp, pid) == -1)) ||
                    (show_system || ((PP(pp, flags) & P_SYSTEM) == 0))) {
                        int pstate = LP(pp, stat);
 
@@ -492,7 +492,7 @@ get_process_info(struct system_info *si, struct process_select *sel,
                                process_states[0]++;
                        if (pstate >= 0 && pstate < MAXPSTATES)
                                process_states[pstate]++;
-                       if ((show_threads && (LP(pp, pid) == -1)) ||
+                       if ((show_system && (LP(pp, pid) == -1)) ||
                            (show_idle || (LP(pp, pctcpu) != 0) ||
                            (pstate == LSRUN)) &&
                            (!show_uid || PP(pp, ruid) == (uid_t) sel->uid)) {