Page MenuHomeFreeBSD

Enhance top(1) to filter on multiple usernames
ClosedPublic

Authored by gahr on Aug 3 2017, 11:32 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Sep 25, 11:18 PM
Unknown Object (File)
Mon, Sep 22, 1:57 PM
Unknown Object (File)
Sun, Sep 21, 4:25 PM
Unknown Object (File)
Sep 15 2025, 12:15 PM
Unknown Object (File)
Aug 1 2025, 9:17 PM
Unknown Object (File)
Jul 22 2025, 6:10 AM
Unknown Object (File)
Jul 13 2025, 11:37 PM
Unknown Object (File)
Jul 6 2025, 7:54 PM
Subscribers

Details

Summary

Currently, top(1) interactive mode features a 'u' command to filter the view so
that only processes owned by a given username are displayed.

This changeset enhances the filtering to support the two additional formats
"+username" and "-username". This allows to display processes owned by a set of
usernames. Additionally to resetting the default (pass-all) filter with a
single "+", this changeset allows for the same behaviour with a single "-".

The maxium allowed number of usernames is currently hard-coded to 8 with a
macro. I am open to i) change the number or ii) make it dynamic at runtime, if
any is desired.

Test Plan

No automatic test plan. Manual UI testing was performed.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Aug 3 2017, 11:35 AM
gahr edited edge metadata.

Fix style(9) in usr.bin/top/machine.c

This revision now requires review to proceed.Aug 3 2017, 11:46 AM
This revision is now accepted and ready to land.Aug 3 2017, 11:52 AM
This revision was automatically updated to reflect the committed changes.