Commit Graph

299 Commits

Author SHA1 Message Date
rillig f56f0d26c4 {usr.,}{s,}bin: replace LINT_SUPPORTED with the standard NOLINT
While here, re-enable lint in those cases where lint was skipped due to
a bug in interpreting abstract types, which was fixed in cgram.y 1.469
from 2023-08-02.
2024-04-20 13:24:48 +00:00
riastradh ad49149131 elftoolchain: Be consistent about which ELF header files we use.
1. For tools that use elftoolchain: always use elftoolchain's
   elfdefinitions.h.  Don't even think about looking at the host's
   sys/exec_elf.h, which makes no sense and should never happen.

   (ELF tools that don't use elftoolchain, like m68k-elf2coff,
   continue to use nbincludes/sys/exec_elf.h.  But no more nbincludes
   hacks in elftoolchain.)

2. For kernel components (solaris, zfs, dtrace): always use
   sys/exec_elf.h, even in Solaris components via sys/elf.h.
   elfdefinitions.h is not wired up in the kernel build at all.

3. For most userland components that involve libelf: use
   elfdefinitions.h via libelf header files (libelf.h, gelf.h).

   libdtrace in particular requires _all_ R_* reloc type definitions,
   but sys/exec_elf.h brings in only the _current machine's_ R_*
   reloc type definitions.  (While here: Use uintptr_t instead of
   Elf_Addr for pointer-to-integer cast, since Elf_Addr is MD and
   provided only by sys/exec_elf.h, not by elfdefinitions.h.)

   And most userland components using libelf don't rely on any
   properties of the current machine from sys/exec_elf.h, so they can
   use libelf's elfdefinition.h.

   Exceptions:

   - dtrace drti.c relies on link.h -> link_elf.h -> sys/exec_elf.h,
     but it also relies on sys/dtrace.h -> sys/elf.h ->
     elfdefinitions.h like other userland components using sys/elf.h.

   - kdump-ioctl.c uses sys/exec_elf.h directly and sys/dtrace.h ->
     sys/elf.h -> elfdefinitions like other userland components using
     sys/elf.h.

   - t_ptrace_wait.c (via t_ptrace_core_wait.h) uses libelf to parse
     core files, but relies on sys/exec_elf.h for struct
     netbsd_elfcore_procinfo.

   None of these exceptions needs all R_* reloc type definitions, so
   as a workaround, we can just suppress libelf's elfdefinitions.h by
   defining _SYS_ELFDEFINITIONS_H_ and use sys/exec_elf.h in these
   exceptions.

And undo the whole BUILTIN_ELF_HEADERS mistake.  This was:

- half bogus workarounds for missing build_install dependencies in
  tools/Makefile, which are no longer missing now, and
- half futile attempt to use src/sys/sys/exec_elf.h via nbincludes in
  tools involving libelf instead of libelf's elfdefinitions.h, which
  collides.

Longer-term, we may wish to unify sys/exec_elf.h and libelf's
elfdefinitions.h, so we don't have to play these games.

But at least now the games are limited to three .c files (one of
which is generated by Makefile.ioctl-c), rather than haphazardly
applied tree-wide by monstrous kludges in widely used .h files with
broken hackarounds to get the tools build lurching to completion.
2024-04-01 18:33:22 +00:00
ryoon 5970d5082c Remove debug print 2024-03-16 23:40:25 +00:00
rillig 13c8c0a7de kdump: keep the comment with its corresponding code
No binary change.
2024-03-10 18:54:41 +00:00
christos b0c85e5803 decode some {g,s}etsockopt*. 2024-03-10 17:08:31 +00:00
kre 498f74e32f PR bin/57918
Redo the previous correctly, the test should be whether or not only the
bottom 32 bits are set, rather than whether any of bits 32..63 are set.
This makes no difference if u_long (or unsigned long long) is 64 bits,
it is the same test in that case, but if u_long were 128 bits there is
a notable difference (though for the particular issue observed in the PR,
it is likely to work either way).
2024-02-11 01:08:57 +00:00
christos d743ad5b0e PR/57918: Taylor R Campbell: Don't try to print symbolically ioctls that
have bits set on the high 32 bits of a 64 bit long.
2024-02-10 12:53:36 +00:00
lukem f937c412f3 bsd.own.mk: rename to CC_WNO_ADDRESS_OF_PACKED_MEMBER
Provide a single variable
	CC_WNO_ADDRESS_OF_PACKED_MEMBER
with options for both clang and gcc, to replace
	CLANG_NO_ADDR_OF_PACKED_MEMBER
	CC_NO_ADDR_OF_PACKED_MEMBER
	GCC_NO_ADDR_OF_PACKED_MEMBER

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
2023-06-03 08:52:53 +00:00
mrg 0cb9ef9131 updates for libdrm 2.4.114.
unfortunately, the i915 ioctls are no longer handled by kdump/ktruss
as the new one conflicts with base.  this needs a clean build in these
dirs (and rescue).  the radeon ioctls have been enabled instead.
2022-11-12 02:20:15 +00:00
gutteridge 8b5211b80a kdump.1: use past tense for history 2022-09-02 03:39:29 +00:00
andvar 207defd036 Add missing double p and d for stopped and overriden accordingly.
Fix few more typos along the way, mainly in copy-pasted comments.
2021-09-11 20:28:03 +00:00
rillig 581d109b89 usr.bin: enable lint checks for most programs in /usr/bin
Previously, lint was only activated for the libraries, but not for the
kernel or userland programs.  Activate lint for the programs in /usr/bin
for now, more will follow later.

This only affects builds that set MKLINT=yes.
2021-08-22 22:24:11 +00:00
chs 1b001e4c1d fix printf format string for xattr names (the length of the xattr name
needs to be a precision rather than a width).
2021-06-20 00:25:29 +00:00
roy 3f011d8972 kdump: include netinet/in_var.h to access in_nbrinfo 2020-09-12 01:36:26 +00:00
mrg d94d71e771 apply GCC_NO_ADDR_OF_PACKED_MEMBER 2020-09-07 00:26:23 +00:00
martin a0926c8673 futexput: cast the mask to u_long (as the op already is) 2020-04-30 15:12:25 +00:00
thorpej 53a266e304 Decode futex op codes. 2020-04-30 12:17:01 +00:00
christos beb931169b Understand xattr ktruser records 2020-04-20 00:35:41 +00:00
wiz c1ffb7d597 Update usage for ioctlprint. 2020-04-03 06:13:07 +00:00
wiz 232ae71526 Increase column widths. Improve -l description wording to match ioctl(2).
Fix Xr.
2020-04-03 06:12:48 +00:00
christos 2433f541c2 remove debugging 2020-04-02 21:36:03 +00:00
christos 4ea9b97786 Add the ability to:
1. list all ioctls (-l)
2. print the internal definition symbolically
3. search by name

$ ioctlprint -f "%n %E %e\n" TIOCGETA
TIOCGETA _IOR('t', 19, struct termios) _IOR('t',0x13,0x2c)
2020-04-02 17:41:33 +00:00
christos e30be371ac *** empty log message *** 2020-04-02 17:40:33 +00:00
wiz 8ec0a7f9b1 Remove superfluous Pp. Add comma in enumeration. Add RCS Id. 2020-04-02 08:38:22 +00:00
wiz 49e3bec9e0 Add comma in enumeration. 2020-04-02 08:35:12 +00:00
kamil 090d46375e Note ioctlprint(1) in SEE ALSO 2020-04-02 03:35:48 +00:00
kamil bf4492493d Add ioctlprint - descriptive ioctl value printer
ioctlprint(1) is embedded in the kdump(1) program.
2020-04-02 03:32:46 +00:00
nonaka 889dcccd73 kdump(1): Symbolic printing for MALLOC_OPTIONS="U". 2019-07-23 01:54:51 +00:00
christos 41bb817512 You don't have to be _LP64 to run 32 bit binaries. You can be mips (64 bit
kernel/32 bit userland).
2019-05-06 19:20:13 +00:00
maxv ba0aa175c4 Remove compat_osf1, discussed on tech-kern@. 2019-03-25 19:24:29 +00:00
martin 47b9b2b3a0 ibcs2 is gone 2018-12-29 18:09:32 +00:00
martin b18e79c6bb compat/svr4* is gone - adapt 2018-12-19 16:27:26 +00:00
rmind 39013e66c1 NPF: Major rework -- migrate NPF to the libnv library.
- This conversion significantly simplifies the code and moves NPF to
  a binary serialisation format (replacing the XML-like format).
- Fix some memory/reference leaks and possibly use-after-free bugs.
- Bump NPF_VERSION as this change makes libnpf incompatible with the
  previous versions.  Also, different serialisation format means NPF
  connection/config saving and loading is not compatible with the
  previous versions either.

Thanks to christos@ for extra testing.
2018-09-29 14:41:35 +00:00
christos 88efda49f6 remove extra quotes. 2018-06-12 15:41:35 +00:00
christos bf830a4102 - instead of hard-coding the include paths in mkioctls, pass them in
from the Makefile so that they are consistent.
- do more sed so that destination paths are not hard-coded inside #include
  statements.
2018-06-12 15:40:39 +00:00
mrg 446e08b1e8 just include <sys/mutex.h> for mkioctls. this works fine for me
for several platforms and fixes the clang build.
2018-06-02 20:07:15 +00:00
martin b30263c2e7 Use proper forward declaration for kmutex_t. This makes MKDTRACE=no builds
work again.
2018-05-29 14:29:53 +00:00
martin 351fd74422 Ooops, backout previous - it was an update build artifact (or something) 2018-05-29 13:10:28 +00:00
martin 2e95568bb1 Backout previous: "typedef void *kmutex_t;
is incompatible with our kmutex_t and breaks the build. ZFS will need
to find a better way to work around this.
2018-05-29 11:18:50 +00:00
chs ba2539a980 merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
 - dtrace FBT probes can now be placed in kernel modules.
 - ZFS now supports mmap().
2018-05-28 21:04:59 +00:00
christos 58cf2108e5 print the mprotect perm argument symbolically. 2018-04-29 18:00:31 +00:00
christos a802845e62 - fix "obsolete" skipping to handle obsolete entries that contain other
variables
- skip files particular to other xserver versions than ours.

XXX: How does this build in the build farm?
2017-11-05 22:52:12 +00:00
christos d4d3ff8a98 deal with the stdbool.h mess defining bool in <net/if.h> and <net/route.h>
and then xf86Opt.h wanting to define a struct field called bool.
2017-11-05 17:44:28 +00:00
wiz 2f78e4cca5 Sync usage with man page. 2017-09-10 10:09:40 +00:00
wiz 928632ef48 Sort flags in SYNOPSIS. Remove unnecessary .Tn. Remove trailing whitespace. 2017-09-10 10:09:34 +00:00
uwe ed98c1eb1b Print negative time offsets correctly. Provide an exegetical quote
from riastradh@, slightly edited to fit the metre.
2017-09-08 21:45:08 +00:00
uwe de9da0ab97 Option -E to display elapsed timestamps (time since beginning of trace).
Option name from FreeBSD.  While here, make it possible to use a
combination of -T -E and -R to display timestamps in several formats.
Idea also from FreeBSD.
2017-09-08 21:09:29 +00:00
uwe fc62aa370e Drop support for KTRFACv0 (NetBSD 3) and KTRFACv1 (NetBSD 5).
Note that on 32-bit platforms it probably never worked anyway because
header size changed from v1 to v2 when time_t became 64 bit.

ok christos@
CVS: ----------------------------------------------------------------------
CVS: CVSROOT  cvs.NetBSD.org:/cvsroot
CVS: please use "PR category/123" to have the commitmsg appended to PR 123
CVS:
CVS: Please evaluate your changes and consider the following.
CVS: Abort checkin if you answer no.
CVS: => For all changes:
CVS: Do the changed files compile?
CVS: Has the change been tested?
CVS: => If you are not completely familiar with the changed components:
CVS: Has the change been posted for review?
CVS: Have you allowed enough time for feedback?
CVS: => If the change is major:
CVS: => If the change adds files to, or removes files from $DESTDIR:
CVS: => If you are changing a library or kernel interface:
CVS: Have you successfully run "./build.sh release"?
2017-09-08 20:36:56 +00:00
sevan 39bbc68a3b Drop main() prototype. 2016-09-05 00:40:28 +00:00
mrg 4ffdae42fa don't hide _DEV_IC_BT8XX_H_ inside DTRACE. 2016-08-18 08:02:58 +00:00