<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/bin/ps/Makefile, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>ps(1): Aliases: Resolve once, merge specifications</title>
<updated>2025-04-28T11:57:01+00:00</updated>
<author>
<name>Olivier Certner</name>
<email>olce@FreeBSD.org</email>
</author>
<published>2025-04-25T13:20:08+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=193e68d5174ffde70acc427f9d830797df9a13cb'/>
<id>193e68d5174ffde70acc427f9d830797df9a13cb</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>ps(1): clean up after swapout removal</title>
<updated>2024-11-09T17:22:42+00:00</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2024-11-09T01:37:07+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=62e6ca0f07e448da27cb2cc8165e749e7fdfcd7e'/>
<id>62e6ca0f07e448da27cb2cc8165e749e7fdfcd7e</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove residual blank line at start of Makefile</title>
<updated>2024-07-15T22:43:39+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2024-07-15T04:46:32+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=e9ac41698b2f322d55ccf9da50a3596edb2c1800'/>
<id>e9ac41698b2f322d55ccf9da50a3596edb2c1800</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>bin: Remove ancient SCCS tags.</title>
<updated>2023-11-27T05:23:28+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-11-23T17:21:37+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=90aea514c6249118e880d75972d063362f4bf492'/>
<id>90aea514c6249118e880d75972d063362f4bf492</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove $FreeBSD$: one-line sh pattern</title>
<updated>2023-08-16T17:55:03+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:55:03+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf'/>
<id>d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf</id>
<content type='text'>
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
</pre>
</div>
</content>
</entry>
<entry>
<title>Explicitly add unmarked bin/ binaries to the runtime package.</title>
<updated>2016-02-09T16:58:50+00:00</updated>
<author>
<name>Glen Barber</name>
<email>gjb@FreeBSD.org</email>
</author>
<published>2016-02-09T16:58:50+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=ac2875fa16f0a3747b0e3f249814c4297605be61'/>
<id>ac2875fa16f0a3747b0e3f249814c4297605be61</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>Make libxo depend on libutil because it uses humanize_number after r287111</title>
<updated>2015-10-18T07:30:50+00:00</updated>
<author>
<name>Enji Cooper</name>
<email>ngie@FreeBSD.org</email>
</author>
<published>2015-10-18T07:30:50+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=550d2b80ec3c504b41ade3a7aed379eb32c68418'/>
<id>550d2b80ec3c504b41ade3a7aed379eb32c68418</id>
<content type='text'>
Remove overlinking in lib/libxo/tests, sbin/savecore, and
usr.bin/{iscsictl,wc,xo}

PR: 203673
Sponsored by: EMC / Isilon Storage Division
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove overlinking in lib/libxo/tests, sbin/savecore, and
usr.bin/{iscsictl,wc,xo}

PR: 203673
Sponsored by: EMC / Isilon Storage Division
</pre>
</div>
</content>
</entry>
<entry>
<title>Upgrade libxo to 0.4.5.</title>
<updated>2015-08-24T16:26:20+00:00</updated>
<author>
<name>Marcel Moolenaar</name>
<email>marcel@FreeBSD.org</email>
</author>
<published>2015-08-24T16:26:20+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=d1a0d267b78b542fbd7e6553af2493760f49bfa8'/>
<id>d1a0d267b78b542fbd7e6553af2493760f49bfa8</id>
<content type='text'>
Local changes incorporated by 0.4.5: r284340
Local changes retained: r276260, r282117

Obtained from:	https://github.com/Juniper/libxo
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Local changes incorporated by 0.4.5: r284340
Local changes retained: r276260, r282117

Obtained from:	https://github.com/Juniper/libxo
</pre>
</div>
</content>
</entry>
<entry>
<title>Convert to use libxo. Document use of libxo as well.</title>
<updated>2015-05-22T23:07:55+00:00</updated>
<author>
<name>Marcel Moolenaar</name>
<email>marcel@FreeBSD.org</email>
</author>
<published>2015-05-22T23:07:55+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=8beb1a2fdc0090864bf5558c0c10e6ed4ef89b24'/>
<id>8beb1a2fdc0090864bf5558c0c10e6ed4ef89b24</id>
<content type='text'>
Obtained from:  Phil Shafer &lt;phil@juniper.net&gt;
Sponsored by:   Juniper Networks, Inc.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Obtained from:  Phil Shafer &lt;phil@juniper.net&gt;
Sponsored by:   Juniper Networks, Inc.
</pre>
</div>
</content>
</entry>
<entry>
<title>Convert bin/ to LIBADD, reduce overlinking allow to build all components as</title>
<updated>2014-11-25T11:15:40+00:00</updated>
<author>
<name>Baptiste Daroussin</name>
<email>bapt@FreeBSD.org</email>
</author>
<published>2014-11-25T11:15:40+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=12cd1730ee44a04d5137368d62233dc38c7ce233'/>
<id>12cd1730ee44a04d5137368d62233dc38c7ce233</id>
<content type='text'>
static
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
static
</pre>
</div>
</content>
</entry>
</feed>
