| #
193e68d5 |
| 25-Apr-2025 |
Olivier Certner <olce@FreeBSD.org> |
ps(1): Aliases: Resolve once, merge specifications
With this change, an alias keyword is resolved once and for all by merging specifications of the keyword (or chain of keywords) it points to. This
ps(1): Aliases: Resolve once, merge specifications
With this change, an alias keyword is resolved once and for all by merging specifications of the keyword (or chain of keywords) it points to. This merge in particular determines the final attributes of the alias keyword, as well as the final keyword it points to, which uniquely determines which information is printed (all non-alias keywords are assumed to display different data).
Also, the alias resolving code has been moved into the resolve_alias() function and helpers (e.g., merge_alias()). Aliases are still resolved lazily as needed by default. The new top-level resolve_aliases() function is used to resolve them at once at program startup if ps(1) has been compiled with PS_CHECK_KEYWORDS defined. Else, it can also be called directly from a debugger.
This is in preparation for removing columns that actually display the same information in a subsequent commit, as this requires being able to (quickly) determine if they are aliases to each other.
***
The merge process is now explicit and more flexible. Previously, all fields of the resolved keyword were unconditionally used for the alias (the pointer to an alias keyword structure was replaced by one to the aliased keyword's one). Now, field 'final_kw' on the alias keyword will store a pointer to the aliased keyword structure (and not only its name, as a subsequent commit will need the structure address). Fields 'header', 'field' and 'flag' are taken from the aliased keyword if they have default values (NULL or 0), else the alias' values prevail. This allows an alias to override one or more of these fields. All fields after 'oproc', because they describe the information to display consistently with each other, are always taken from the aliased keyword. merge_alias() checks that the values of these fields in the alias keyword structure are unspecified (NULL, or some neutral value like 0 and UNSPEC).
While here, parsefmt() was reworked to avoid any direct recursion and the break-up/recombination steps that were used when processing aliases. The latter was due to the mutual recursion with findvar() and its odd-for-that-purpose signature. findvar() has been removed in the process. Simplification of parsefmt() also allows to be more precise with the errors reported (in particular, the case of an empty keyword with a specific header would just be reported as a "keyword not found" message).
While here, introduce the check_keywords() function, performing sanity checks on the declared keywords, currently only validating that they are declared in alphabetical order. As for resolve_aliases(), this function is called at startup on PS_CHECK_KEYWORDS, else it is available to be called from a debugger.
Ideally, alias resolution should be done at compile time. In practice, it seems doing so at runtime was never a problem (there are only a few aliases compared to all available keywords, and there's currently at most one level of aliasing). With the changes here, it seems very unlikely to become one even if many more keywords, aliases or aliasing levels are added.
MFC after: 3 days Sponsored by: The FreeBSD Foundation
show more ...
|
|
Revision tags: release/13.4.0-p5, release/13.5.0-p1, release/14.2.0-p3, release/13.5.0, release/14.2.0-p2, release/14.1.0-p8, release/13.4.0-p4, release/14.1.0-p7, release/14.2.0-p1, release/13.4.0-p3, release/14.2.0 |
|
| #
62e6ca0f |
| 09-Nov-2024 |
Konstantin Belousov <kib@FreeBSD.org> |
ps(1): clean up after swapout removal
The process flag P_INMEM is always set. Eliminate all checks for the bit. Also eliminate LAZY_PS define and code covered by it: we do not have an u-area for
ps(1): clean up after swapout removal
The process flag P_INMEM is always set. Eliminate all checks for the bit. Also eliminate LAZY_PS define and code covered by it: we do not have an u-area for long time, and it cannot be swapped out.
Also eliminate setting controlled by the '-f' switch, but accept it for backward compatibility.
The 'W' process secondary state (swapped out) is impossible, stop calculating it.
Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D47492
show more ...
|
|
Revision tags: release/13.4.0 |
|
| #
e9ac4169 |
| 15-Jul-2024 |
Warner Losh <imp@FreeBSD.org> |
Remove residual blank line at start of Makefile
This is a residual of the $FreeBSD$ removal.
MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
|
|
Revision tags: release/14.1.0, release/13.3.0 |
|
| #
90aea514 |
| 23-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
bin: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl s
bin: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script.
Sponsored by: Netflix
show more ...
|
|
Revision tags: release/14.0.0 |
|
| #
d0b2dbfa |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
|
|
Revision tags: release/13.2.0, release/12.4.0, release/13.1.0, release/12.3.0, release/13.0.0, release/12.2.0, release/11.4.0, release/12.1.0, release/11.3.0, release/12.0.0, release/11.2.0, release/10.4.0, release/11.1.0, release/11.0.1, release/11.0.0 |
|
| #
13caa468 |
| 16-Apr-2016 |
Glen Barber <gjb@FreeBSD.org> |
Merge the projects/release-pkg branch to head.
This allows packaging the base system with pkg(8), including but not limited to providing the ability to provide upstream binary update possibilities f
Merge the projects/release-pkg branch to head.
This allows packaging the base system with pkg(8), including but not limited to providing the ability to provide upstream binary update possibilities for non-tier-1 architectures.
This merge is a requirement of the 11.0-RELEASE, and as such, thank you to everyone that has tested the project branch.
Documentation in build(7) etc. is still somewhat sparse, but updates to those parts will follow.
Sponsored by: The FreeBSD Foundation
show more ...
|
|
Revision tags: release/10.3.0 |
|
| #
ac2875fa |
| 09-Feb-2016 |
Glen Barber <gjb@FreeBSD.org> |
Explicitly add unmarked bin/ binaries to the runtime package. Note: tcsh(1) has a MK_TCSH=no test, so this should be a separate package, which requires pre-install/post-install scripts, to be added l
Explicitly add unmarked bin/ binaries to the runtime package. Note: tcsh(1) has a MK_TCSH=no test, so this should be a separate package, which requires pre-install/post-install scripts, to be added later.
Sponsored by: The FreeBSD Foundation
show more ...
|
| #
b626f5a7 |
| 04-Jan-2016 |
Glen Barber <gjb@FreeBSD.org> |
MFH r289384-r293170
Sponsored by: The FreeBSD Foundation
|
| #
a5d8944a |
| 19-Nov-2015 |
Navdeep Parhar <np@FreeBSD.org> |
Catch up with head (r291075).
|
| #
031c294c |
| 19-Oct-2015 |
Baptiste Daroussin <bapt@FreeBSD.org> |
Merge from head
|
| #
550d2b80 |
| 18-Oct-2015 |
Enji Cooper <ngie@FreeBSD.org> |
Make libxo depend on libutil because it uses humanize_number after r287111
Remove overlinking in lib/libxo/tests, sbin/savecore, and usr.bin/{iscsictl,wc,xo}
PR: 203673 Sponsored by: EMC / Isilon S
Make libxo depend on libutil because it uses humanize_number after r287111
Remove overlinking in lib/libxo/tests, sbin/savecore, and usr.bin/{iscsictl,wc,xo}
PR: 203673 Sponsored by: EMC / Isilon Storage Division
show more ...
|
| #
f94594b3 |
| 12-Sep-2015 |
Baptiste Daroussin <bapt@FreeBSD.org> |
Finish merging from head, messed up in previous attempt
|
| #
00176600 |
| 09-Sep-2015 |
Navdeep Parhar <np@FreeBSD.org> |
Merge r286744-r287584 from head.
|
| #
d9442b10 |
| 05-Sep-2015 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r286858 through r287489.
|
| #
23a32822 |
| 25-Aug-2015 |
Baptiste Daroussin <bapt@FreeBSD.org> |
Merge from HEAD
|
| #
d1a0d267 |
| 24-Aug-2015 |
Marcel Moolenaar <marcel@FreeBSD.org> |
Upgrade libxo to 0.4.5.
Local changes incorporated by 0.4.5: r284340 Local changes retained: r276260, r282117
Obtained from: https://github.com/Juniper/libxo
|
|
Revision tags: release/10.2.0 |
|
| #
416ba5c7 |
| 22-Jun-2015 |
Navdeep Parhar <np@FreeBSD.org> |
Catch up with HEAD (r280229-r284686).
|
| #
37a48d40 |
| 28-May-2015 |
Glen Barber <gjb@FreeBSD.org> |
MFH: r282615-r283655
Sponsored by: The FreeBSD Foundation
|
| #
98e0ffae |
| 27-May-2015 |
Simon J. Gerraty <sjg@FreeBSD.org> |
Merge sync of head
|
| #
8beb1a2f |
| 23-May-2015 |
Marcel Moolenaar <marcel@FreeBSD.org> |
Convert to use libxo. Document use of libxo as well.
Obtained from: Phil Shafer <phil@juniper.net> Sponsored by: Juniper Networks, Inc.
|
| #
d899be7d |
| 19-Jan-2015 |
Glen Barber <gjb@FreeBSD.org> |
Reintegrate head: r274132-r277384
Sponsored by: The FreeBSD Foundation
|
| #
8f0ea33f |
| 13-Jan-2015 |
Glen Barber <gjb@FreeBSD.org> |
Reintegrate head revisions r273096-r277147
Sponsored by: The FreeBSD Foundation
|
| #
840e7092 |
| 29-Nov-2014 |
Enji Cooper <ngie@FreeBSD.org> |
MFHead @ r275232
|
| #
2c97f721 |
| 25-Nov-2014 |
Dimitry Andric <dim@FreeBSD.org> |
r274961 through r275075
|
| #
12cd1730 |
| 25-Nov-2014 |
Baptiste Daroussin <bapt@FreeBSD.org> |
Convert bin/ to LIBADD, reduce overlinking allow to build all components as static
|