aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/kdump/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | 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
* usr.bin: Remove ancient SCCS tags.Warner Losh2023-11-271-1/+0
| | | | | | | | 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
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* kdump: Add preliminary support for decoding Linux syscallsDmitry Chagin2022-06-221-0/+7
| | | | | | Reviewed by: jhb Differential revision: https://reviews.freebsd.org/D35216 MFC after: 2 weeks
* Rename NO_WERROR -> MK_WERROR=noAlex Richardson2021-01-071-2/+0
| | | | | | | | As suggested in D27598. This also supports MK_WERROR.clang=no and MK_WERROR.gcc=no to support the existing NO_WERROR.<compiler> uses. Reviewed By: brooks Differential Revision: https://reviews.freebsd.org/D27601
* We use a few different ifdef's names to check if we are using Casper or not,Mariusz Zaborski2017-09-211-1/+1
| | | | | | | | | | let's standardize this. Now we are always use WITH_CASPER name. Discussed with: emaste@ MFC after: 1 month Notes: svn path=/head/; revision=323866
* Adopt SRCTOP in usr.binWarner Losh2017-03-121-2/+2
| | | | | | | | | | | | Prefer ${SRCTOP}/foo over ${.CURDIR}/../../foo and ${SRCTOP}/usr.bin/foo over ${.CURDIR}/../foo for paths in Makefiles. Differential Revision: https://reviews.freebsd.org/D9932 Sponsored by: Netflix Silence on: arch@ (twice) Notes: svn path=/head/; revision=315170
* Move mksubr from kdump into libsysdecode.John Baldwin2016-10-171-12/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=307538
* Convert casperd(8) daemon to the libcasper.Mariusz Zaborski2016-02-251-2/+4
| | | | | | | | | | | | | | | | | | | | | | | After calling the cap_init(3) function Casper will fork from it's original process, using pdfork(2). Forking from a process has a lot of advantages: 1. We have the same cwd as the original process. 2. The same uid, gid and groups. 3. The same MAC labels. 4. The same descriptor table. 5. The same routing table. 6. The same umask. 7. The same cpuset(1). From now services are also in form of libraries. We also removed libcapsicum at all and converts existing program using Casper to new architecture. Discussed with: pjd, jonathan, ed, drysdale@google.com, emaste Partially reviewed by: drysdale@google.com, bdrewery Approved by: pjd (mentor) Differential Revision: https://reviews.freebsd.org/D4277 Notes: svn path=/head/; revision=296047
* Add support to libsysdecode for decoding system call names.John Baldwin2016-01-261-19/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | A new sysdecode_syscallname() function accepts a system call code and returns a string of the corresponding name (or NULL if the code is unknown). To support different process ABIs, the new function accepts a value from a new sysdecode_abi enum as its first argument to select the ABI in use. Current ABIs supported include FREEBSD (native binaries), FREEBSD32, LINUX, LINUX32, and CLOUDABI64. Note that not all ABIs are supported by all platforms. In general, a given ABI is only supported if a platform can execute binaries for that ABI. To simplify the implementation, libsysdecode's build reuses the existing pre-generated files from the kernel source tree rather than duplicating new copies of said files during the build. kdump(1) and truss(1) now use these functions to map system call identifiers to names. For kdump(1), a new 'syscallname()' function consolidates duplicated code from ktrsyscall() and ktrsyscallret(). The Linux ABI no longer requires custom handling for ktrsyscall() and linux_ktrsyscall() has been removed as a result. Reviewed by: bdrewery Differential Revision: https://reviews.freebsd.org/D4823 Notes: svn path=/head/; revision=294849
* Move the mkioctls script to libsysdecode and use it to generate aJohn Baldwin2015-12-221-12/+2
| | | | | | | | | | | | | | sysdecode_ioctlname() function. This function matches the behavior of the truss variant in that it returns a pointer to a string description for known ioctls. The caller is responsible for displaying unknown ioctl requests. For kdump this meant moving the logic to handle unknown ioctl requests out of the generated function and into an ioctlname() function in kdump.c instead. Differential Revision: https://reviews.freebsd.org/D4610 Notes: svn path=/head/; revision=292622
* Start on a new library (libsysdecode) that provides routines for decodingJohn Baldwin2015-12-151-2/+3
| | | | | | | | | | | | | | | | | | | | system call information such as system call arguments. Initially this will consist of pulling duplicated code out of truss and kdump though it may prove useful for other utilities in the future. This commit moves the shared utrace(2) record parser out of kdump into the library and updates kdump and truss to use it. One difference from the previous version is that the library version treats unknown events that start with the "RTLD" signature as unknown events. This simplifies the interface and allows the consumer to decide how to handle all non-recognized events. Instead, this function only generates a string description for known malloc() and RTLD records. Reviewed by: bdrewery Differential Revision: https://reviews.freebsd.org/D4537 Notes: svn path=/head/; revision=292236
* Replace DPSRCS that work fine in SRCS.Bryan Drewery2015-11-251-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is so that 'make depend' is not a required build step in these files. DPSRCS is overall unneeded. DPSRCS already contains SRCS, so anything which can safely be in SRCS should be. DPSRCS is mostly just a way to generate files that should not be linked into the final PROG/LIB. For headers and grammars it is safe for them to be in SRCS since they will be excluded during linking and installation. The only remaining uses of DPSRCS are for generating .c or .o files that must be built before 'make depend' can run 'mkdep' on the SRCS c files list. A semi-proper example is in tests/sys/kern/acct/Makefile where a checked-in .c file has an #include on a generated .c file. The generated .c file should not be linked into the final PROG though since it is #include'd. The more proper way here is just to build/link it in though without DPSRCS. Another example is in sys/modules/linux/Makefile where a shell script runs to parse a DPSRCS .o file that should not be linked into the module. Beyond those, the need for DPSRCS is largely unneeded, redundant, and forces 'make depend' to be ran. Generally, these Makefiles should avoid the need for DPSRCS and define proper dependencies for their files as well. An example of an improper usage and why this matters is in usr.bin/netstat. nl_defs.h was only in DPSRCS and so was not generated during 'make all', but only during 'make depend'. The files including it lacked proper depenencies on it, which forced running 'make depend' to workaround that bug. The 'make depend' target should mostly be used for incremental build help, not to produce a working build. This specific example was broken in the meta build until r287905 since it does not run 'make depend'. The gnu/lib/libreadline/readline case is fine since bsd.lib.mk has 'OBJS: SRCS:M*.h' when there is no .depend file. Sponsored by: EMC / Isilon Storage Division MFC after: 1 week Notes: svn path=/head/; revision=291330
* truss: Add support for utrace(2).Bryan Drewery2015-10-061-1/+1
| | | | | | | | | | | | | | | | | This uses the kdump(1) utrace support code directly until a common library is created. This allows malloc(3) tracing with MALLOC_CONF=utrace:true and rtld tracing with LD_UTRACE=1. Unknown utrace(2) data is just printed as hex. PR: 43819 [inspired by] Reviewed by: jhb MFC after: 2 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D3819 Notes: svn path=/head/; revision=288957
* Add ioctl.c, linux_syscalls.c, linux32_syscalls.c to beforedepend target.Craig Rodrigues2015-06-151-0/+6
| | | | | | | These files need to be generated before mkdep is run. Notes: svn path=/head/; revision=284407
* Create proper targets for linux*syscalls.cSimon J. Gerraty2015-06-141-8/+8
| | | | Notes: svn path=/head/; revision=284370
* Use INCLUDEDIR rather than hard coded /usr/includeSimon J. Gerraty2015-06-111-3/+3
| | | | | | | | Differential Revision: D2748 Reviewed by: brooks imp Notes: svn path=/head/; revision=284268
* Teach kdump to understand both linux emulation.Dmitry Chagin2015-05-241-5/+8
| | | | | | | | Differential Revision: https://reviews.freebsd.org/D1079 Reviewed by: emaste Notes: svn path=/head/; revision=283430
* kdump: eliminate new clang warnings.Dmitry Chagin2015-01-061-10/+8
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=276758
* Convert to usr.bin/ to LIBADDBaptiste Daroussin2014-11-251-3/+2
| | | | | | | Reduce overlinking Notes: svn path=/head/; revision=275042
* Use src.opts.mk in preference to bsd.own.mk except where we need stuffWarner Losh2014-05-061-1/+1
| | | | | | | from the latter. Notes: svn path=/head/; revision=265420
* Fix world build WITHOUT_PF.Gleb Smirnoff2014-02-121-0/+4
| | | | | | | Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=261797
* Include bsd.own.mk for MK_CASPER to work.Pawel Jakub Dawidek2013-12-151-0/+2
| | | | | | | Reported by: nwhitehorn Notes: svn path=/head/; revision=259440
* Make use of Casper's system.pwd and system.grp services when the -r optionPawel Jakub Dawidek2013-12-151-0/+6
| | | | | | | | | | | | is given to convert uids and gids to user names and group names even when running in capability mode sandbox. While here log on stderr when we successfully enter the sandbox. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=259434
* In kdump's mkioctls script, use '${CPP}' instead of hardcodedly usingDimitry Andric2012-04-091-1/+1
| | | | | | | | | | 'gcc -E'. This fixes building when WITH_CLANG_IS_CC is in effect. Report by: Niclas Zeising <zeising@daemonic.se> MFC after: 1 week Notes: svn path=/head/; revision=234058
* It turns out that truss also used kdump's mkioctls script, and expectedDag-Erling Smørgrav2011-10-211-1/+1
| | | | | | | | | | | | | | | ioctlname() to return a pointer to the name rather than print it. This did not show up in testing because truss had its own prototype for ioctlname(), so it would build fine and run fine as long as the program being traced did not issue an ioctl. Teach mkioctls to generate different versions of ioctlname() based on its first command-line argument. Pointed out by: Garrett Cooper <yanegomi@gmail.com> Notes: svn path=/head/; revision=226608
* Clean up mkioctls a bit, and fix cross-building by checking ${MACHINE}Dag-Erling Smørgrav2011-10-131-1/+2
| | | | | | | | | instead of $(uname -m). Pointed out by: nyan@ Notes: svn path=/head/; revision=226344
* Make kdump compile cleanly at WARNS level 6, with one exception: theDag-Erling Smørgrav2011-10-121-2/+2
| | | | | | | | | | | | | ipfilter headers contain a duplicated function declaration. Turn off -Werror to allow kdump to compile in spite of this. It would be neat to be able to turn off -Werror on a file-by-file basis... PR: bin/161478 Submitted by: Garrett Cooper <yanegomi@gmail.com> Notes: svn path=/head/; revision=226329
* Fix the dependency issue properly by a) moving kdump_subr.c to the frontDag-Erling Smørgrav2011-10-081-6/+2
| | | | | | | of the SRCS list and b) listing kdump_subr.h in DPSRCS. Notes: svn path=/head/; revision=226158
* 1) Some of the #defines or enums for which we auto-generate namingDag-Erling Smørgrav2011-10-081-3/+12
| | | | | | | | | | | | | | | | functions may be wider than int, so use intmax_t throughout. Also add missing casts in printf() calls. 2) Clean up some of the auto-generated code to improve readability. 3) Auto-generate kdump_subr.h. Note that this requires a semi-ugly hack in the Makefile to make sure it is generated before make(1) tries to build kdump.c, or preprocess it for 'make depend'. MFC after: 3 weeks Notes: svn path=/head/; revision=226145
* Teach kdump to decode linux syscalls names too.Dmitry Chagin2011-03-011-1/+15
| | | | | | | | | | | Fix bug introduced in my previous commit: the kernel always dump native signal numbers, so no need to check the ABI in ktrpsig(). Suggested by: jhb MFC after: 1 Month. Notes: svn path=/head/; revision=219138
* Build usr.bin/ with WARNS=6 by default.Ed Schouten2010-01-021-0/+2
| | | | | | | Also add some missing $FreeBSD$ to keep svn happy. Notes: svn path=/head/; revision=201386
* Revert CLEANDEPFILES commit per ru@'s request; it does not really solveDag-Erling Smørgrav2008-02-051-2/+1
| | | | | | | the problem. The correct fix will follow. Notes: svn path=/head/; revision=175980
* Normally, when a header file is removed from the build (as i4b headersDag-Erling Smørgrav2008-02-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | were recently), a simple 'make cleandepend; make depend' is sufficient to keep the tree buildable after a cvs update when doing incremental builds. However, kdump and truss use a script which searches for header files that define ioctls, and generates C code that includes them. This script will usually not need updating when a header file is removed, so the normal dependency mechanism will not realize that it needs to be re-run. One is therefore left with code that references dead files but will only be removed by a full 'make clean', which defeats the purpose of incremental builds. To work around this, modify the cleandepend target in bsd.dep.mk to also remove any files listed in a new variable named CLEANDEPFILES, and modify kdump's and truss's Makefiles accordingly. MFC after: 2 weeks Notes: svn path=/head/; revision=175937
* Change kdump to print more useful information, i.e. it changes fromAlexander Leidinger2006-05-201-3/+6
| | | | | | | | | | | | | | | | | | | | | 32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0) 32229 telnet CALL open(0x2807bc28,0,0x1b6) 32229 telnet CALL socket(0x2,0x2,0) to 32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0) 32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6) 32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0) David wanted to implement the suggestions which came up at the review from arch@ too, but real life rejected this proposal. So I commit what we already got and let another volunteer pick the remaining work from the ideas list. Submitted by: "David Kirchner" <dpk@dpk.net> Suggested by: FreeBSD ideas list page Reviewed by: arch Notes: svn path=/head/; revision=158766
* Dependencies are delimited by space not tab.Ruslan Ermilov2002-07-231-2/+2
| | | | Notes: svn path=/head/; revision=100559
* Better fix for style.Mark Murray2002-06-211-6/+6
| | | | | | | Suggested by: ru (but modified a bit by markm) Notes: svn path=/head/; revision=98557
* Style tidy-up.Mark Murray2002-06-211-2/+4
| | | | Notes: svn path=/head/; revision=98553
* I now don't seem to be able to reproduce the -DNOCLEAN buildworldRuslan Ermilov2002-04-111-4/+0
| | | | | | | | | | | | | breakage with ioctl.c. The .depend file should track dependencies just fine, and the worst we can have is to miss new ioctls. But I still think it's a good idea to have -DNOCLEAN build produce the same ioctl.c as it would without -DNOCLEAN. Prodded for a long time by: bde Notes: svn path=/head/; revision=94432
* Fix ioctl.c creation to deal with the depend case more properly.Jordan K. Hubbard2000-09-141-2/+6
| | | | | | | Submitted by: Ruslan Ermilov <ru@sunbay.com> Notes: svn path=/head/; revision=65848
* remove .PHONY to avoid gratuitous rebuild of ioctl.c each time.Jordan K. Hubbard2000-09-141-1/+1
| | | | | | | Approved by: sef Notes: svn path=/head/; revision=65829
* Make auto-generated ioctl.c to be always considered out of dateRuslan Ermilov2000-08-011-1/+1
| | | | | | | | | since it could potentially depend on any ${DESTDIR}/usr/include preprocessor file. This fixes the broken -DNOCLEAN world build I experienced yesterday. Notes: svn path=/head/; revision=64102
* Avoid hardcoding any paths and variables. The include directory mustMarcel Moolenaar1999-12-031-1/+1
| | | | | | | | | | | | | now be specified on the command line. Accept a '-s' option which controls whether a switch-statement is to be used instead of a series of if-statements. Replace cpp with gcc -E. Discussed with: bde Notes: svn path=/head/; revision=54081
* Make sure DESTDIR is set in the environment of mkioctls. This fixesMarcel Moolenaar1999-12-021-1/+2
| | | | | | | | | | the breakage people have encountered at certain times (for example when the altq_*.h files were removed). $FreeBSD$ tag added. Notes: svn path=/head/; revision=54029
* -I${.CURDIR}/../..Poul-Henning Kamp1994-11-211-1/+1
| | | | Notes: svn path=/head/; revision=4722
* BSD 4.4 Lite Usr.bin SourcesRodney W. Grimes1994-05-271-0/+12
Notes: svn path=/cvs2svn/branches/CHRISTOS/; revision=1590