Page MenuHomeFreeBSD

Enhance top(1) to filter on multiple usernames
ClosedPublic

Authored by gahr on Aug 3 2017, 11:32 AM.

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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

gahr created this revision.Aug 3 2017, 11:32 AM
cognet accepted this revision.Aug 3 2017, 11:35 AM
This revision is now accepted and ready to land.Aug 3 2017, 11:35 AM
gahr updated this revision to Diff 31519.Aug 3 2017, 11:46 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
cognet accepted this revision.Aug 3 2017, 11:52 AM
This revision is now accepted and ready to land.Aug 3 2017, 11:52 AM
bapt accepted this revision.Aug 3 2017, 12:10 PM
This revision was automatically updated to reflect the committed changes.