summaryrefslogtreecommitdiff
path: root/lib/libproc
Commit message (Collapse)AuthorAgeFilesLines
* Do a sweep and remove most WARNS=6 settingsKyle Evans2020-10-011-1/+0
| | | | | | | | | | | | | | | Repeating the default WARNS here makes it slightly more difficult to experiment with default WARNS changes, e.g. if we did something absolutely bananas and introduced a WARNS=7 and wanted to try lifting the default to that. Drop most of them; there is one in the blake2 kernel module, but I suspect it should be dropped -- the default WARNS in the rest of the build doesn't currently apply to kernel modules, and I haven't put too much thought into whether it makes sense to make it so. Notes: svn path=/head/; revision=366304
* Remove -I flag for include path that doesn't existAlex Richardson2020-09-101-1/+0
| | | | | | | | | | Found this while trying to get macOS bootstrap to work again after OpenZFS merge. Reviewed By: #zfs, freqlabs Differential Revision: https://reviews.freebsd.org/D26192 Notes: svn path=/head/; revision=365580
* Merge OpenZFS support in to HEAD.Matt Macy2020-08-253-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The primary benefit is maintaining a completely shared code base with the community allowing FreeBSD to receive new features sooner and with less effort. I would advise against doing 'zpool upgrade' or creating indispensable pools using new features until this change has had a month+ to soak. Work on merging FreeBSD support in to what was at the time "ZFS on Linux" began in August 2018. I first publicly proposed transitioning FreeBSD to (new) OpenZFS on December 18th, 2018. FreeBSD support in OpenZFS was finally completed in December 2019. A CFT for downstreaming OpenZFS support in to FreeBSD was first issued on July 8th. All issues that were reported have been addressed or, for a couple of less critical matters there are pull requests in progress with OpenZFS. iXsystems has tested and dogfooded extensively internally. The TrueNAS 12 release is based on OpenZFS with some additional features that have not yet made it upstream. Improvements include: project quotas, encrypted datasets, allocation classes, vectorized raidz, vectorized checksums, various command line improvements, zstd compression. Thanks to those who have helped along the way: Ryan Moeller, Allan Jude, Zack Welch, and many others. Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D25872 Notes: svn path=/head/; revision=364746
* Re-enable proc_test:symbol_lookup after r360979.Mark Johnston2020-05-121-3/+0
| | | | | | | | | PR: 244732 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=360980
* Temporarily skip 2 failing tests after llvm10 importLi-Wen Hsu2020-03-111-0/+3
| | | | | | | | PR: 244732 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=358887
* Update Makefile.depend filesSimon J. Gerraty2019-12-111-3/+0
| | | | | | | | | | | | | Update a bunch of Makefile.depend files as a result of adding Makefile.depend.options files Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22494 Notes: svn path=/head/; revision=355617
* Add Makefile.depend.optionsSimon J. Gerraty2019-12-111-0/+11
| | | | | | | | | | | | | | | | | | | | Leaf directories that have dependencies impacted by options need a Makefile.depend.options file to avoid churn in Makefile.depend DIRDEPS for cases such as OPENSSL, TCP_WRAPPERS etc can be set in local.dirdeps-options.mk which can add to those set in Makefile.depend.options See share/mk/dirdeps-options.mk Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22469 Notes: svn path=/head/; revision=355616
* pkgbase: Create a FreeBSD-utilities package and make it the default oneEmmanuel Vadot2019-09-051-1/+0
| | | | | | | | | | | | | The default package use to be FreeBSD-runtime but it should only contain binaries and libs enough to boot to single user and repair the system, it is also very handy to have a package that can be tranform to a small mfsroot. So create a new package named FreeBSD-utilities and make it the default one. Also move a few binaries and lib into this package when it make sense. Reviewed by: bapt, gjb Differential Revision: https://reviews.freebsd.org/D21506 Notes: svn path=/head/; revision=351858
* mips: hide regnum definitions behind _KERNEL/_WANT_MIPS_REGNUMKyle Evans2019-08-221-0/+1
| | | | | | | | | | | | | | | | | | | machine/regnum.h ends up being included by sys/procfs.h and sys/ptrace.h via machine/reg.h. Many of the regnum definitions are too short and too generic to be exposing to any userland application including one of these two headers. Moreover, these actively cause build failures in googletest (template <typename T1 ...> expanding to template <typename 9 ...>). Hide the definitions behind _KERNEL or _WANT_MIPS_REGNUM, and patch all of the userland consumers to define as needed. Discussed with: imp, jhb Reviewed by: imp, jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21330 Notes: svn path=/head/; revision=351409
* mips: Fix register target for SP setting in libprocJustin Hibbits2019-08-081-1/+1
| | | | | | | | | Copy-paste-o from r233042 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D21188 Notes: svn path=/head/; revision=350756
* Be consistent about temporary variable use in adjacent loops.Brooks Davis2019-07-221-2/+3
| | | | | | | | | Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=350218
* Remove an unneeded temporary variable in two functions.Brooks Davis2019-07-191-8/+3
| | | | | | | | | | | | There is no need to convert an intptr_t to a long just to cast it to a (void *). Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=350158
* Detach from the child process before completing the test.Mark Johnston2018-07-271-6/+12
| | | | | | | Otherwise the child will receive SIGTRAP if the parent exits first. Notes: svn path=/head/; revision=336782
* Take the mapping's segment offset into account when resolving symbols.Mark Johnston2018-07-211-2/+4
| | | | | | | | Reported by: Jenkins, via asomers MFC after: 2 weeks Notes: svn path=/head/; revision=336592
* Disable optimization of the libproc test program.Mark Johnston2018-07-211-0/+1
| | | | | | | | | | Dead code elimination may remove symbols that are required by the tests. Reported by: Jenkins, via asomers MFC after: 1 week Notes: svn path=/head/; revision=336591
* Use a global extern declaration to appease gcc.Mark Johnston2017-12-061-1/+2
| | | | | | | | Reported by: gjb X-MFC with: r326498 Notes: svn path=/head/; revision=326626
* Add an envp argument to proc_create().Mark Johnston2017-12-034-17/+17
| | | | | | | | | This is needed to support dtrace's -x setenv option. MFC after: 2 weeks Notes: svn path=/head/; revision=326498
* Eliminate the last user of basename_r() in the base system.Ed Schouten2017-12-011-2/+4
| | | | | | | In this case it's fairly easy to make use of basename(). Notes: svn path=/head/; revision=326423
* lib: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-268-0/+16
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326219
* Refine symtab sorting in libproc.Mark Johnston2017-11-213-30/+194
| | | | | | | | | | | | Add some rules to more closely match what illumos does when an address resolves to multiple symbols: - prefer non-local symbols - prefer symbols with fewer leading underscores and no leading '$' Add some regression tests to verify these rules. Notes: svn path=/head/; revision=326064
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-312-2/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Avoid keeping a dangling pointer when the mappings array is resized.Mark Johnston2017-09-063-3/+4
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=323227
* Add supporting changes for `Add limited sandbox capability to "make check"`Enji Cooper2017-08-141-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Non-tests/... changes: - Add HAS_TESTS= to Makefiles with libraries and programs to enable iteration and propagate the appropriate environment down to *.test.mk. tests/... changes: - Add appropriate support Makefile.inc's to set HAS_TESTS in a minimal manner, since tests/... is a special subdirectory tree compared to the others. MFC after: 2 months MFC with: r322511 Reviewed by: arch (silence), testing (silence) Differential Revision: D12014 Notes: svn path=/head/; revision=322515
| * Add HAS_TESTS to all Makefiles that are currently using theEnji Cooper2017-08-021-0/+1
| | | | | | | | | | | | | | | | | | `SUBDIR.${MK_TESTS}+= tests` idiom. This is a follow up to r321912. Notes: svn path=/projects/make-check-sandbox/; revision=321914
* | o Replace __riscv__ with __riscvRuslan Bukin2017-08-072-5/+5
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Replace __riscv64 with (__riscv && __riscv_xlen == 64) This is required to support new GCC 7.1 compiler. This is compatible with current GCC 6.1 compiler. RISC-V is extensible ISA and the idea here is to have built-in define per each extension, so together with __riscv we will have some subset of these as well (depending on -march string passed to compiler): __riscv_compressed __riscv_atomic __riscv_mul __riscv_div __riscv_muldiv __riscv_fdiv __riscv_fsqrt __riscv_float_abi_soft __riscv_float_abi_single __riscv_float_abi_double __riscv_cmodel_medlow __riscv_cmodel_medany __riscv_cmodel_pic __riscv_xlen Reviewed by: ngie Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D11901 Notes: svn path=/head/; revision=322168
* Convert traditional ${MK_TESTS} conditional idiom for including testEnji Cooper2017-08-021-3/+1
| | | | | | | | | | | | | | directories to SUBDIR.${MK_TESTS} idiom This is being done to pave the way for future work (and homogenity) in ^/projects/make-check-sandbox . No functional change intended. MFC after: 1 weeks Notes: svn path=/head/; revision=321912
* Ensure that the mappings table is populated in proc_objname().Mark Johnston2017-05-221-0/+3
| | | | | | | | MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318687
* Add initializations missed in r315728.Mark Johnston2017-03-221-0/+3
| | | | | | | X-MFC With: r315728 Notes: svn path=/head/; revision=315729
* Avoid accessing an uninitialized variable when vfork() fails.Mark Johnston2017-03-221-9/+9
| | | | | | | | | Reported by: Miles Ohlrich <miles.ohlrich@isilon.com> MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=315728
* Increase WARNS for libproc testsAlan Somers2017-03-111-0/+1
| | | | | | | | | | | | ATF tests have a default WARNS of 0, unlike other usermode programs. Reviewed by: ngie, julian MFC after: 3 weeks Sponsored by: Spectra Logic Corporation Differential Revision: https://reviews.freebsd.org/D9933 Notes: svn path=/head/; revision=315038
* Use SRCTOP-relative paths to other directories instead of .CURDIR-relative onesEnji Cooper2017-01-201-3/+3
| | | | | | | | | | This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=312488
* Add a reasonable bound on the symbol table index size.Mark Johnston2017-01-051-2/+4
| | | | Notes: svn path=/head/; revision=311348
* Bump the libproc library version.Mark Johnston2016-12-061-1/+1
| | | | Notes: svn path=/head/; revision=309598
* libproc: Add support for some proc_attach() flags.Mark Johnston2016-12-063-22/+36
| | | | | | | | | | This change adds some handling for the equivalent of Solaris' PGRAB_* flags. In particular, support for PGRAB_RDONLY is needed to avoid a nasty deadlock: dtrace(1) may otherwise stop the master process for its pseudo-terminal and end up blocking while writing to standard output. Notes: svn path=/head/; revision=309597
* libproc: Cache symbol tables for mapped objects upon access.Mark Johnston2016-12-063-168/+161
| | | | | | | | | | | Extend the file handle cache entries to include symbol tables as well. An index is used to implement binary search by symbol value. Lookups by name are comparatively rare and are thus still implemented with a linear search, but support for a binary search by name would be straightforward to add if needed. Notes: svn path=/head/; revision=309596
* libproc: Match prefixes when looking up mapped object by name.Mark Johnston2016-12-063-56/+33
| | | | | | | | | | | | | | | | | When looking up an object by name, allow prefix matches if no direct match is found. This allows one to, for example, match libc entry probes with: # dtrace -n 'pid$target:libc.so::entry' -c ./foo instead of requiring "libc.so.7" or a glob. Also remove proc_obj2map() as it currently just duplicates the functionality of proc_name2map(). It's supposed to take a Solaris link-map ID as a paramter, but support for this isn't implemented and isn't required to support DTrace's pid provider. Notes: svn path=/head/; revision=309595
* libproc: Cache ELF handles for loaded objects.Mark Johnston2016-12-065-221/+233
| | | | | | | | | | libproc previously created a new handle for each symbol lookup, which gives rather egregious performance for DTrace's ustack() action. With this change libproc will cache the libelf descriptor upon access, making lookups much faster in the common case. Notes: svn path=/head/; revision=309594
* libproc: Improve .gnu_debuglink support.Mark Johnston2016-12-064-54/+277
| | | | | | | | | | | | | | As of r278658 libproc looks for debug files under /usr/lib/debug and will use them if available. This change fleshes out that support a bit further: - Check for a .gnu_debuglink section and use the file name specified there if one is present. - Validate external debug files with the CRC in the .gnu_debuglink section so as to avoid using stale or corrupt debug files. - Search for debug files in the directory containing the referencing object or in the .debug subdirectory, as GDB does. Notes: svn path=/head/; revision=309593
* libproc: Make proc_getpid() an accessor for struct proc_handle.Mark Johnston2016-12-065-25/+23
| | | | | | | | | This allows librtld_db to fetch the PID from a handle without calling into libproc. Together with r303531, this means that librtld_db no longer references symbols from libproc. Notes: svn path=/head/; revision=309592
* Fix style bugs and remove trailing whitespace in libproc and librtld_db.Mark Johnston2016-12-067-98/+110
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=309591
* Use uint32_t instead of u_long as a storage for breakpoint instructionRuslan Bukin2016-10-261-9/+19
| | | | | | | | | | | | | | | to copy. All the platforms breakpoints fits this fine. This fixes operation on big-endian MIPS64 where we were coping zeroes instead of real instruction. Reviewed by: rpaulo Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D8250 Notes: svn path=/head/; revision=307964
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2016-08-312-0/+3
| | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=305146
* proc_init: Fix a few memory leaks of 'phdl'Conrad Meyer2016-08-021-5/+5
| | | | | | | | | | | | | | | | In the normal case and correct failure cases, the 'phdl' pointer is passed to callers to use or clean up as needed. However, some failure cases returned early, failing to export the phdl pointer. This was introduced in the restructuring of r303533. Reported by: Coverity CID: 1361070 Reviewed by: markj Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303669
* libproc: Add proc_getmodel().Mark Johnston2016-07-306-43/+108
| | | | | | | | | | | This is used by libdtrace to determine the data model of target processes. This allows for the creation of pid provider probes in 32-bit processes on amd64. MFC after: 1 month Notes: svn path=/head/; revision=303533
* Add descriptions for fields in struct proc_handle.Mark Johnston2016-07-301-9/+6
| | | | | | | | | Remove the unused kq field and some unnecessary includes. MFC after: 1 month Notes: svn path=/head/; revision=303532
* Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedEnji Cooper2016-05-041-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after r298107 Summary of changes: - Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that namespacing is kept with FILES appropriately, and that this shouldn't need to be repeated if the namespace changes -- only the definition of PACKAGE needs to be changed - Allow PACKAGE to be overridden by callers instead of forcing it to always be `tests`. In the event we get to the point where things can be split up enough in the base system, it would make more sense to group the tests with the blocks they're a part of, e.g. byacc with byacc-tests, etc - Remove PACKAGE definitions where possible, i.e. where FILES wasn't used previously. - Remove unnecessary TESTSPACKAGE definitions; this has been elided into bsd.tests.mk - Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES; ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk. - Fix installation of files under data/ subdirectories in lib/libc/tests/hash and lib/libc/tests/net/getaddrinfo - Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup) Document the proposed changes in share/examples/tests/tests/... via examples so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of replacing FILES. share/mk/bsd.README didn't seem like the appropriate method of communicating that info. MFC after: never probably X-MFC with: r298107 PR: 209114 Relnotes: yes Tested with: buildworld, installworld, checkworld; buildworld, packageworld Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=299094
* MFHGlen Barber2016-03-101-0/+26
|\ | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=296625
| * DIRDEPS_BUILD: Connect MK_TESTS.Bryan Drewery2016-03-091-0/+26
| | | | | | | | | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=296587
* | MFHGlen Barber2016-03-022-2/+3
|\| | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=296318
| * Remove WARNS inherited fine by ../Makefile.inc.Bryan Drewery2016-02-262-2/+3
| | | | | | | | | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=296129