FreeBSD src
Go to file
John Baldwin 9289f547a2 Move mksubr from kdump into libsysdecode.
Restructure this script so that it generates a header of tables instead
of a source file.  The tables are included in a flags.c source file which
provides functions to decode various system call arguments.

For functions that decode an enumeration, the function returns a pointer
to a string for known values and NULL for unknown values.

For functions that do more complex decoding (typically of a bitmask), the
function accepts a pointer to a FILE object (open_memstream() can be used
as a string builder) to which decoded values are written.  If the
function operates on a bitmask, the function returns true if any bits
were decoded or false if the entire value was valid.  Additionally, the
third argument accepts a pointer to a value to which any undecoded bits
are stored.  This pointer can be NULL if the caller doesn't care about
remaining bits.

Convert kdump over to using decoder functions from libsysdecode instead of
mksubr.  truss also uses decoders from libsysdecode instead of private
lookup tables, though lookup tables for objects not decoded by kdump remain
in truss for now.  Eventually most of these tables should move into
libsysdecode as the automated table generation approach from mksubr is
less stale than the static tables in truss.

Some changes have been made to truss and kdump output:
- The flags passed to open() are now properly decoded in that one of
  O_RDONLY, O_RDWR, O_WRONLY, or O_EXEC is always included in a decoded
  mask.
- Optional arguments to open(), openat(), and fcntl() are only printed
  in kdump if they exist (e.g. the mode is only printed for open() if
  O_CREAT is set in the flags).
- Print argument to F_GETLK/SETLK/SETLKW in kdump as a pointer, not int.
- Include all procctl() commands.
- Correctly decode pipe2() flags in truss by not assuming full
  open()-like flags with O_RDONLY, etc.
- Decode file flags passed to *chflags() as file flags (UF_* and SF_*)
  rather than as a file mode.
- Fix decoding of quotactl() commands by splitting out the two command
  components instead of assuming the raw command value matches the
  primary command component.

In addition, truss and kdump now build without triggering any warnings.
All of the sysdecode manpages now include the required headers in the
synopsis.

Reviewed by:	kib (several older versions), wblock (manpages)
MFC after:	2 months
Differential Revision:	https://reviews.freebsd.org/D7847
2016-10-17 22:37:07 +00:00
bin Increase timeout so low-end platforms have a chance to complete test 2016-10-17 10:21:53 +00:00
cddl Fix tst.args1.c on LP64 platforms. 2016-10-16 19:50:10 +00:00
contrib MFV r307214: 2016-10-13 11:40:34 +00:00
crypto Merge OpenSSL 1.0.2j. 2016-09-26 14:22:17 +00:00
etc rtwn(4), urtwn(4): merge common code, add support for 11ac devices. 2016-10-17 20:38:24 +00:00
gnu Remove GNU rcs from base. 2016-10-15 12:07:37 +00:00
include Re-apply change 306811 or alternatively, revert change 307385. 2016-10-16 02:43:51 +00:00
kerberos5
lib Move mksubr from kdump into libsysdecode. 2016-10-17 22:37:07 +00:00
libexec Reference the libc symbols ypresp_{allfn,data} instead of local symbols. 2016-10-16 19:12:22 +00:00
release adjust picobsd script to work with HEAD 2016-10-14 15:16:44 +00:00
rescue DIRDEPS_BUILD: Build crunchide for the host. 2016-09-01 23:52:25 +00:00
sbin pf: port extended DSCP support from OpenBSD 2016-10-13 20:34:44 +00:00
secure Merge OpenSSL 1.0.2j. 2016-09-26 14:22:17 +00:00
share Fix dates + add an UPDATING entry. 2016-10-17 21:35:13 +00:00
sys cxgbe(4): Adjust whitespace to line up the column titles in cim_qcfg 2016-10-17 20:57:54 +00:00
targets Update i386 build of loader.efi (but leave it disabled) so that we at 2016-10-14 17:25:29 +00:00
tests Skip test on MIPS as we don't have shared page implemented yet. 2016-10-10 14:21:40 +00:00
tools rtwn(4), urtwn(4): merge common code, add support for 11ac devices. 2016-10-17 20:38:24 +00:00
usr.bin Move mksubr from kdump into libsysdecode. 2016-10-17 22:37:07 +00:00
usr.sbin Typo fixed: arbitraty -> arbitrary. 2016-10-17 09:40:18 +00:00
.arcconfig callsign isn't required anymore 2016-09-29 06:19:45 +00:00
.arclint
COPYRIGHT
LOCKS
MAINTAINERS
Makefile Add a 'make print-dir' that simply traverses all directories and prints them. 2016-08-31 19:30:52 +00:00
Makefile.inc1 groff is not needed in the bootstrap tools if the system is built 2016-10-08 18:57:11 +00:00
Makefile.libcompat Fix in-tree GCC builds after r304681. 2016-08-23 19:29:37 +00:00
ObsoleteFiles.inc Fix dates + add an UPDATING entry. 2016-10-17 21:35:13 +00:00
README
UPDATING Fix dates + add an UPDATING entry. 2016-10-17 21:35:13 +00:00

This is the top level of the FreeBSD source directory.  This file
was last revised on:
$FreeBSD$

For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
sources in this tree - please see the specific source directories for
more information).

The Makefile in this directory supports a number of targets for
building components (or all) of the FreeBSD source tree.  See build(7)
and http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
for more information, including setting make(1) variables.

The `buildkernel` and `installkernel` targets build and install
the kernel and the modules (see below).  Please see the top of
the Makefile in this directory for more information on the
standard build targets and compile-time flags.

Building a kernel is a somewhat more involved process.  See build(7), config(8),
and http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html
for more information.

Note: If you want to build and install the kernel with the
`buildkernel` and `installkernel` targets, you might need to build
world before.  More information is available in the handbook.

The kernel configuration files reside in the sys/<arch>/conf
sub-directory.  GENERIC is the default configuration used in release builds.
NOTES contains entries and documentation for all possible
devices, not just those commonly used.


Source Roadmap:
---------------

bin		System/user commands.

cddl		Various commands and libraries under the Common Development
		and Distribution License.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberos5	Kerberos5 (Heimdal) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

rescue		Build system for statically linked /rescue utilities.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

sys		Kernel sources.

tests		Regression tests which can be run by Kyua.  See tests/README
		for additional information.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.


For information on synchronizing your source tree with one or more of
the FreeBSD Project's development branches, please see:

  http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/synching.html