aboutsummaryrefslogtreecommitdiff
path: root/cddl/lib/libdtrace
Commit message (Collapse)AuthorAgeFilesLines
* dtrace: Fix effective GID shown by 'curpsinfo'Olivier Certner2025-09-171-1/+1
| | | | | | | | | Reviewed by: emaste Fixes: be1f7435ef218b1d ("kern: start tracking cr_gid outside of cr_groups[]") MFC after: 5 days MFC to: stable/15 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52274
* tcp: cleanup of nits after use of accessor tcp_get_flagsRichard Scheffenegger2024-12-191-2/+2
| | | | | | | | | | | | Remove unneeded th_x2 initalization, use named constants instead of magic numbers (fixing one oversight) and add some line breaks. Expand one man page slightly. No functional change intended. Reviewed By: tuexen, cc Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D48065
* 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
* dtrace: allow NULL interface pointer for ifinfo_t translatorMichael Tuexen2024-02-161-2/+2
| | | | | | | | | | This is similar to other translators and will be used in static probes where the interface is not known. Reviewed by: markj MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D43728
* dtrace: Add the 'oformat' libdtrace optionDomagoj Stolfa2024-01-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This option can be used to specify a format to use in DTrace output. The following formats are supported: - json - xml - html - none (default DTrace output) This is implemented using libxo and integrated into libdtrace. Client code only works with the following API: - dtrace_oformat_setup(dtrace_hdl_t *) -- to be called when output is starting. - dtrace_oformat_teardown(dtrace_hdl_t *) -- to be called when output is finished - dtrace_oformat(dtrace_hdl_t *) -- check if oformat is enabled. - dtrace_set_outfp(FILE *) -- sets the output file for oformat. - Ensure that oformat is correctly checked in the drop handler and record processing callbacks. This commit also adds tests which check if the generated output is valid (JSON, XML) and extends the dtrace(1) describing the structured output. Reviewed by: markj Discussed with: phil MFC after: 2 months Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D41745
* libdtrace: Fix TCP data offset handling in the tcpinfo_t translatorMark Johnston2024-01-011-2/+2
| | | | | | | | | | The header gives an offset in 32-bit words, and the translator is supposed to convert that to a byte count. But, the conversion was incorrect. Reviewed by: tuexen, rscheff MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43264
* libdtrace: decode all tcp header flags and addRichard Scheffenegger2023-12-311-16/+19
| | | | | | | | | | decoding capability of TH_AE to dtrace, including the example provided with tcpdebug. MFC after: 1 week Reviewed By: markj, mav Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D43243
* Fix typo in previous d282baddb0b02, breaking DTrace.Alexander Motin2023-11-171-1/+1
|
* Add interface NVME to devstatAlexander Motin2023-11-161-0/+3
| | | | | This allows to list only NVMe devices in systat, iostat, vmstat, etc. Previously those were counted as OTHER.
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-1618-36/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* dtrace: Add WITH_DTRACE_ASANDomagoj Stolfa2023-08-021-0/+10
| | | | | See commit 4ae6991228105eb34989c870194ae7b0a1e23be4. This version of the commit avoids inadvertently changing SHLIBDIR for libdtrace.so.
* dtrace: do not overload libproc flagsEric van Gyzen2023-08-011-2/+0
| | | | | | | | | | | | | | | | | dtrace stored its PR_RLC and PR_KLC flags in the proc_handle's flags, where they collided with PATTACH_FORCE and PATTACH_RDONLY, respectively. Thus, Psetflags(PR_KLC) effectively also set the PATTACH_RDONLY flag. Since the flags are private to dtrace (at least on FreeBSD), store them in dtrace's own dt_proc structure instead. On FreeBSD, either PR_RLC or PR_KLC was always set, so remove code that would handle the case where neither was set. Reviewed by: markj MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D41121
* dtrace: Revert the addition of WITH_DTRACE_ASANMark Johnston2023-08-011-11/+0
| | | | | The follow-up fix triggers a lib32 build failure, revert everything until the problem is addressed.
* libdtrace: Explicitly set SHLIBDIR and SHLIB_MAJORMark Johnston2023-08-011-0/+4
| | | | | | | | | They were previously being defined by cddl/lib/Makefile.inc, and as of commit 4ae699122810 were being overridden by defaults in bsd.own.mk, which changed SHLIBDIR to /usr/lib. Reported by: Domagoj Stolfa <ds815@cam.ac.uk> Fixes: 4ae699122810 ("dtrace: Add WITH_DTRACE_ASAN")
* dtrace: Add WITH_DTRACE_ASANDomagoj Stolfa2023-07-271-0/+7
| | | | | | | | | | | | | | | | This option is a blanket for all the DTrace-related software. The option when enabled passes in -fsanitize=address -fsanitize=undeifned, enabling ASAN and UBSAN in the following components: - libdtrace - dtrace(1) - lockstat(1) - plockstat(1) The option defaults to "no" and is intended as a developer aid. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D41157
* dtrace: improve siftr probeMichael Tuexen2023-07-021-8/+19
| | | | | | | | | | | | | | | Improve consistency of the field names with tcpsinfo_t: * Use mss instead of max_seg_size. * Use lport and rport instead of tcp_localport and tcp_foreignport. Use t_flags instead of flags to improve consistency with t_flags2. Add laddr and raddr, since the addresses were missing when compared to the output of siftr. Reviewed by: cc Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D40834
* dtrace: third update to the siftr probeMichael Tuexen2023-07-011-2/+0
| | | | | | | | | | | This adds the changes corresponding to https://cgit.freebsd.org/src/commit/?id=60167184abd54ca12c6bf7ab60f2a08b41342f84 to the siftr probe. This concludes the series up updates. Reviewed by: rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D40825
* dtrace: another update of the siftr probeMichael Tuexen2023-07-011-4/+4
| | | | | | | | | | This adds the changes corresponding to https://cgit.freebsd.org/src/commit/?id=d090464ecd4af5cd400ef5cbbfe8409d019eac34 to the siftr probe. Reviewed by: rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D40824
* dtrace: update siftr probeMichael Tuexen2023-07-011-6/+6
| | | | | | | | | | This adds the changes corresponding to https://cgit.freebsd.org/src/commit/?id=1241e8e7aed5d709a6cf62024e9ae750981c03ae to the siftr probe. Reviewed by: rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D40823
* dtrace: fix constants used by the siftr probeMichael Tuexen2023-06-301-2/+2
| | | | | | | | | | | The constants used in the C code were changed in https://svnweb.freebsd.org/changeset/base/343646 but changing them also in the dtrace translator was missed. Reviewed by: cc, rscheff MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D40805
* dtrace: add register bindings for arm64Christos Margiolis2023-05-232-0/+75
| | | | | | | Reviewed by: mhorne, markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39956
* dtrace: implement dtrace_instr_size() for arm64Christos Margiolis2023-05-231-0/+4
| | | | | | | Reviewed by: markj Approved by; markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39955
* dtrace: add register bindings for RISC-VChristos Margiolis2023-04-202-0/+75
| | | | | | | Reviewed by: mhorne, markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39611
* dtrace: expose dtrace_instr_size() to userland and implement it for riscvChristos Margiolis2023-04-201-1/+5
| | | | | | | | | | dtrace_instr_size() is needed by the forthcoming RISC-V port of kinst, as well as by libdtrace in D38825 for both amd64 and RISC-V. Reviewed by: markj, mhorne MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39489
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-1/+2
|
* tcp: embed inpcb into tcpcbGleb Smirnoff2022-12-071-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the TCP protocol inpcb storage specify allocation size that would provide space to most of the data a TCP connection needs, embedding into struct tcpcb several structures, that previously were allocated separately. The most import one is the inpcb itself. With embedding we can provide strong guarantee that with a valid TCP inpcb the tcpcb is always valid and vice versa. Also we reduce number of allocs/frees per connection. The embedded inpcb is placed in the beginning of the struct tcpcb, since in_pcballoc() requires that. However, later we may want to move it around for cache line efficiency, and this can be done with a little effort. The new intotcpcb() macro is ready for such move. The congestion algorithm data, the TCP timers and osd(9) data are also embedded into tcpcb, and temprorary struct tcpcb_mem goes away. There was no extra allocation here, but we went through extra pointer every time we accessed this data. One interesting side effect is that now TCP data is allocated from SMR-protected zone. Potentially this allows the TCP stacks or other TCP related modules to utilize that for their own synchronization. Large part of the change was done with sed script: s/tp->ccv->/tp->t_ccv./g s/tp->ccv/\&tp->t_ccv/g s/tp->cc_algo/tp->t_cc/g s/tp->t_timers->tt_/tp->tt_/g s/CCV\(ccv, osd\)/\&CCV(ccv, t_osd)/g Dependency side effect is that code that needs to know struct tcpcb should also know struct inpcb, that added several <netinet/in_pcb.h>. Differential revision: https://reviews.freebsd.org/D37127
* libdtrace: Fix some CPU register number definitions to match the kernelMark Johnston2022-10-121-3/+3
| | | | MFC after: 1 week
* libdtrace: Add kinst supportChristos Margiolis2022-10-111-0/+1
| | | | | | | | | | | | kinst does not instantiate its probes automatically, it only does so on demand via an ioctl interface implemented by /dev/kinst. This change modifies libdtrace to perform that work when the script references the kinst provider, similar to the way pid provider probes are implemented. Reviewed by: markj MFC after: 3 months Sponsored by: Google, Inc. (GSoC 2022) Differential Revision: https://reviews.freebsd.org/D36852
* dtrace: Remove local mips supportBrooks Davis2022-07-011-4/+0
| | | | | | | | Remove the stub pid probe and all the build glue. Reviewed by: imp, jhb Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D35541
* ctf: Import ctf.h from OpenBSDMark Johnston2022-03-071-1/+0
| | | | | | | | | | | | | | | | | Use it instead of the existing ctf.h from OpenSolaris. This makes it easier to use CTF in the core kernel, and to extend the CTF format to support wider type IDs. The imported ctf.h is modified to depend only on _types.h, and also to provide macros which use the "parent" bit of a type ID to refer to types in a parent CTF container. No functional change intended. Reviewed by: Domagoj Stolfa, emaste MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34358
* pkgbase: Put dtrace in its own packageEmmanuel Vadot2021-06-191-0/+1
| | | | | | | While dtrace is usefull some people might not want it. Differential Revision: https://reviews.freebsd.org/D30752 Sponsored by: Diablotin Systems
* libdtrace: Stop relying on lex compatibilityMark Johnston2021-02-171-2/+0
| | | | | | | | | | It does not appear to be required, and as of commit 6b7e592c215f ("lex: Do not let input() return 0 when end-of-file is reached") it causes input to return 0 instead of EOF when end-of-input is reached. PR: 253440 MFC after: 3 days Sponsored by: The FreeBSD Foundation
* Install dtrace.h and dependenciesAlex Richardson2021-01-071-0/+7
| | | | | | | | | | | | | This makes the minimum amount of changes to allow inclusion of dtrace.h without all the solaris compatibility headers. Installing dtrace.h allows compiling consumers of libdtrace (e.g. https://github.com/tmetsch/python-dtrace) without requiring a copy of the source tree. For python-dtrace I worked around this in https://github.com/tmetsch/python-dtrace/commit/58019c9a12022203a9ffda286dd8b41f1a5ace42 but being able to build the library without installed sources would be extremely useful. Reviewed By: gnn Differential Revision: https://reviews.freebsd.org/D27884
* 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
* Correct the D definition for EINTEGRITY.Mark Johnston2020-09-011-1/+1
| | | | | | | | | MFC after: 1 week Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Notes: svn path=/head/; revision=365047
* Merge OpenZFS support in to HEAD.Matt Macy2020-08-251-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* - Cleanups related to sparc64 removal.Yoshihiro Takahashi2020-07-281-3/+0
| | | | | | | | | | - Remove remains of sparc64 files. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D25831 Notes: svn path=/head/; revision=363644
* sack_newdata and snd_recover hold the same value. Therefore, use onlyMichael Tuexen2020-02-131-1/+1
| | | | | | | | | | a single instance: use snd_recover also where sack_newdata was used. Submitted by: Richard Scheffenegger Differential Revision: https://reviews.freebsd.org/D18811 Notes: svn path=/head/; revision=357858
* Create new EINTEGRITY error with message "Integrity check failed".Kirk McKusick2019-01-171-1/+4
| | | | | | | | | | | | | | | | | | | | | | An integrity check such as a check-hash or a cross-correlation failed. The integrity error falls between EINVAL that identifies errors in parameters to a system call and EIO that identifies errors with the underlying storage media. EINTEGRITY is typically raised by intermediate kernel layers such as a filesystem or an in-kernel GEOM subsystem when they detect inconsistencies. Uses include allowing the mount(8) command to return a different exit value to automate the running of fsck(8) during a system boot. These changes make no use of the new error, they just add it. Later commits will be made for the use of the new error number and it will be added to additional manual pages as appropriate. Reviewed by: gnn, dim, brueffer, imp Discussed with: kib, cem, emaste, ed, jilles Differential Revision: https://reviews.freebsd.org/D18765 Notes: svn path=/head/; revision=343111
* Add support for send, receive and state-change DTrace providers forMichael Tuexen2018-08-222-0/+172
| | | | | | | | | | | | SCTP. They are based on what is specified in the Solaris DTrace manual for Solaris 11.4. Reviewed by: 0mp, dteske, markj Relnotes: yes Differential Revision: https://reviews.freebsd.org/D16839 Notes: svn path=/head/; revision=338213
* Add a dtrace provider for UDP-Lite.Michael Tuexen2018-07-313-0/+81
| | | | | | | | | | | | | | The dtrace provider for UDP-Lite is modeled after the UDP provider. This fixes the bug that UDP-Lite packets were triggering the UDP provider. Thanks to dteske@ for providing the dwatch module. Reviewed by: dteske@, markj@, rrs@ Relnotes: yes Differential Revision: https://reviews.freebsd.org/D16377 Notes: svn path=/head/; revision=337018
* Add support for TCP state names used by Solaris.Michael Tuexen2018-07-141-0/+26
| | | | | | | | | | | | | For compatibility, add the TCP state names used by Solaris and given in the Dtrace Guide available at https://docs.oracle.com/cd/E37838_01/html/E61035/glhgu.html#OSDTGglhmv Reviewed by: markj@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D16269 Notes: svn path=/head/; revision=336285
* The IP, TCP, and UDP provider report IP addresses as strings.Michael Tuexen2018-06-183-8/+8
| | | | | | | | | | | | | | | | In some cases, the required information is not available and the UDP provider reported an empty string in this case and the IP and TCP provider reported a NULL pointer. This patch changes the value provided in this case to the string "<unknown>". This make the behaviour consistent and in-line with the behaviour of Solaris. Reviewed by: markj@, dteske@, gnn@ Differential Revision: https://reviews.freebsd.org/D15855 Notes: svn path=/head/; revision=335325
* Unbreak dtrace runtime for udp after svn r334719 SO_REUSEPORT commit.Sean Bruno2018-06-071-4/+4
| | | | | | | | Submitted by: Johannes Lundberg <johalun0@gmail.com> Sponsored by: Limeligght Networks Notes: svn path=/head/; revision=334788
* Load balance sockets with new SO_REUSEPORT_LB option.Sean Bruno2018-06-061-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new socket option, SO_REUSEPORT_LB, which allow multiple programs or threads to bind to the same port and incoming connections will be load balanced using a hash function. Most of the code was copied from a similar patch for DragonflyBSD. However, in DragonflyBSD, load balancing is a global on/off setting and can not be set per socket. This patch allows for simultaneous use of both the current SO_REUSEPORT and the new SO_REUSEPORT_LB options on the same system. Required changes to structures: Globally change so_options from 16 to 32 bit value to allow for more options. Add hashtable in pcbinfo to hold all SO_REUSEPORT_LB sockets. Limitations: As DragonflyBSD, a load balance group is limited to 256 pcbs (256 programs or threads sharing the same socket). This is a substantially different contribution as compared to its original incarnation at svn r332894 and reverted at svn r332967. Thanks to rwatson@ for the substantive feedback that is included in this commit. Submitted by: Johannes Lundberg <johalun0@gmail.com> Obtained from: DragonflyBSD Relnotes: Yes Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D11003 Notes: svn path=/head/; revision=334719
* Revert r332894 at the request of the submitter.Sean Bruno2018-04-241-4/+4
| | | | | | | | Submitted by: Johannes Lundberg <johalun0_gmail.com> Sponsored by: Limelight Networks Notes: svn path=/head/; revision=332967
* Load balance sockets with new SO_REUSEPORT_LB optionSean Bruno2018-04-231-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new socket option, SO_REUSEPORT_LB, which allow multiple programs or threads to bind to the same port and incoming connections will be load balanced using a hash function. Most of the code was copied from a similar patch for DragonflyBSD. However, in DragonflyBSD, load balancing is a global on/off setting and can not be set per socket. This patch allows for simultaneous use of both the current SO_REUSEPORT and the new SO_REUSEPORT_LB options on the same system. Required changes to structures Globally change so_options from 16 to 32 bit value to allow for more options. Add hashtable in pcbinfo to hold all SO_REUSEPORT_LB sockets. Limitations As DragonflyBSD, a load balance group is limited to 256 pcbs (256 programs or threads sharing the same socket). Submitted by: Johannes Lundberg <johanlun0@gmail.com> Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D11003 Notes: svn path=/head/; revision=332894
* Consistent casing for fallback SIGCHLD (s/Unknown/unknown/)Devin Teske2018-02-261-1/+1
| | | | Notes: svn path=/head/; revision=329996
* Updates and enhancements to signal.d to aid DTrace scriptingDevin Teske2018-02-251-0/+52
| | | | | | | | | | | | | + Add missing signals SIGTHR (32) and SIGLIBRT (33) + Add inline for converting SIG* int to string + Add inline for converting CLD_* int to string Reviewed by: markj Sponsored by: Smule, Inc. Differential Revision: https://reviews.freebsd.org/D14497 Notes: svn path=/head/; revision=329995