aboutsummaryrefslogtreecommitdiff
path: root/sys/modules/dtrace/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* sdt: Enable on 32-bit powerpc and powerpc64leMark Johnston2026-02-041-3/+1
| | | | | | Reviewed by: jhibbits, adrian MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D54814
* dtrace: Build systrace_freebsd32 only if COMPAT_FREEBSD32 is configuredMark Johnston2025-01-221-0/+2
| | | | | MFC after: 1 week Sponsored by: Innovate UK
* 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
* sdt: Implement SDT probes using hot-patchingMark Johnston2024-06-191-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea here is to avoid a memory access and conditional branch per probe site. Instead, the probe is represented by an "unreachable" unconditional function call. asm goto is used to store the address of the probe site (represented by a no-op sled) and the address of the function call into a tracepoint record. Each SDT probe carries a list of tracepoints. When the probe is enabled, the no-op sled corresponding to each tracepoint is overwritten with a jmp to the corresponding label. The implementation uses smp_rendezvous() to park all other CPUs while the instruction is being overwritten, as this can't be done atomically in general. The compiler moves argument marshalling code and the sdt_probe() function call out-of-line, i.e., to the end of the function. Per gallatin@ in D43504, this approach has less overhead when probes are disabled. To make the implementation a bit simpler, I removed support for probes with 7 arguments; nothing makes use of this except a regression test case. It could be re-added later if need be. The approach taken in this patch enables some more improvements: 1. We can now automatically fill out the "function" field of SDT probe names. The SDT macros let the programmer specify the function and module names, but this is really a bug and shouldn't have been allowed. The intent was to be able to have the same probe in multiple functions and to let the user restrict which probes actually get enabled by specifying a function name or glob. 2. We can avoid branching on SDT_PROBES_ENABLED() by adding the ability to include blocks of code in the out-of-line path. For example: if (SDT_PROBES_ENABLED()) { int reason = CLD_EXITED; if (WCOREDUMP(signo)) reason = CLD_DUMPED; else if (WIFSIGNALED(signo)) reason = CLD_KILLED; SDT_PROBE1(proc, , , exit, reason); } could be written SDT_PROBE1_EXT(proc, , , exit, reason, int reason; reason = CLD_EXITED; if (WCOREDUMP(signo)) reason = CLD_DUMPED; else if (WIFSIGNALED(signo)) reason = CLD_KILLED; ); In the future I would like to use this mechanism more generally, e.g., to remove branches and marshalling code used by hwpmc, and generally to make it easier to add new tracepoint consumers without having to add more conditional branches to hot code paths. Reviewed by: Domagoj Stolfa, avg MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D44483
* sys: Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* kinst: port to arm64Christos Margiolis2023-07-191-1/+1
| | | | | | | Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40337
* kinst: port to riscvChristos Margiolis2023-07-041-0/+3
| | | | | | | Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39884
* dtrace: include fbt module unconditionallyMitchell Horne2023-01-121-7/+3
| | | | | | | | It is supported on all platforms. Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37658
* dtrace: Add pid provider to the build for powerpcJustin Hibbits2022-10-301-1/+3
| | | | | | | | The fasttrap pid provider has been in place for a long time, but stopped getting built by efe88d92da in preparation for 64-bit atomics. 32-bit emulation of 64-bit atomics was added in 9aafc7c05. MFC after: 3 weeks
* kinst: Initial revisionChristos Margiolis2022-10-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a new DTrace provider which allows arbitrary kernel instructions to be traced. Currently it is implemented only for amd64. kinst probes are created on demand by libdtrace, and there is a probe for each kernel instruction. Probes are named kinst:<module>:<function>:<offset>, where "offset" is the offset of the target instruction relative to the beginning of the function. Omitting "offset" causes all instructions in the function to be traced. kinst works similarly to FBT in that it places a breakpoint on the target instruction and hooks into the kernel breakpoint handler. Because kinst has to be able to trace arbitrary instructions, it does not emulate most of them in software but rather causes the traced thread to execute a copy of the instruction before returning to the original code. The provider is quite low-level and as-is will be useful mostly only to kernel developers. However, it provides a great deal of visibility into kernel code execution and could be used as a building block for higher-level tooling which can in some sense translate between C sources and generated machine code. In particular, the "regs" variable recently added to D allows the CPU's register file to be accessed from kinst probes. kinst is experimental and should not be used on production systems for now. In collaboration with: markj Sponsored by: Google, Inc. (GSoC 2022) MFC after: 3 months Differential Revision: https://reviews.freebsd.org/D36851
* mips: Remove dtrace build supportWarner Losh2021-12-311-2/+0
| | | | Sponsored by: Netflix
* Disconnect fasttrap from the 32-bit powerpc build.Mark Johnston2019-02-211-3/+2
| | | | | | | | | | | | | An upcoming bug fix requires 64-bit atomics, which aren't implemented on powerpc. The powerpc port of fasttrap is incomplete anyway and doesn't get loaded by dtraceall.ko on powerpc because of a missing dependency; it's presumed that it's effectively unused. Discussed with: jhibbits MFC after: 2 weeks Notes: svn path=/head/; revision=344450
* Build systrace_freebsd32 on arm64.Michael Tuexen2018-01-111-0/+1
| | | | | | | | | | | Since r326501 which added COMPAT_FREEBSD32 to the GENERIC config for arm64, we need to build systrace_freebsd32, since dtraceall depends on it. Reviewed by: ed, gnn Differential Revision: https://reviews.freebsd.org/D13670 Notes: svn path=/head/; revision=327846
* Enable dtrace support for mips64 and the ERL kernel configKurt Lidl2017-09-061-1/+4
| | | | | | | | | | | | | | Turn on the required options in the ERL config file, and ensure that the fbt module is listed as a dependency for mips in the modules/dtrace/dtraceall/dtraceall.c file. PR: 220346 Reviewed by: gnn, markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D12227 Notes: svn path=/head/; revision=323206
* Add an experimental DTrace audit provider, which allows users of DTrace toRobert Watson2017-03-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instrument security event auditing rather than relying on conventional BSM trail files or audit pipes: - Add a set of per-event 'commit' probes, which provide access to particular auditable events at the time of commit in system-call return. These probes gain access to audit data via the in-kernel audit_record data structure, providing convenient access to system-call arguments and return values in a single probe. - Add a set of per-event 'bsm' probes, which provide access to particular auditable events at the time of BSM record generation in the audit worker thread. These probes have access to the in-kernel audit_record data structure and BSM representation as would be written to a trail file or audit pipe -- i.e., asynchronously in the audit worker thread. DTrace probe arguments consist of the name of the audit event (to support future mechanisms of instrumenting multiple events via a single probe -- e.g., using classes), a pointer to the in-kernel audit record, and an optional pointer to the BSM data and its length. For human convenience, upper-case audit event names (AUE_...) are converted to lower case in DTrace. DTrace scripts can now cause additional audit-based data to be collected on system calls, and inspect internal and BSM representations of the data. They do not affect data captured in the audit trail or audit pipes configured in the system. auditd(8) must be configured and running in order to provide a database of event information, as well as other audit configuration parameters (e.g., to capture command-line arguments or environmental variables) for the provider to operate. Reviewed by: gnn, jonathan, markj Sponsored by: DARPA, AFRL MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D10149 Notes: svn path=/head/; revision=316176
* Include FBT to modules build on RISC-V.Ruslan Bukin2016-07-291-1/+3
| | | | Notes: svn path=/head/; revision=303480
* Rename remaining linux32 symbols such as linux_sysent[] andJohn Baldwin2015-10-221-1/+4
| | | | | | | | | | | | | | | | | | | | linux_syscallnames[] from linux_* to linux32_* to avoid conflicts with linux64.ko. While here, add support for linux64 binaries to systrace. - Update NOPROTO entries in amd64/linux/syscalls.master to match the main table to fix systrace build. - Add a special case for union l_semun arguments to the systrace generation. - The systrace_linux32 module now only builds the systrace_linux32.ko. module on amd64. - Add a new systrace_linux module that builds on both i386 and amd64. For i386 it builds the existing systrace_linux.ko. For amd64 it builds a systrace_linux.ko for 64-bit binaries. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D3954 Notes: svn path=/head/; revision=289769
* Implement the lockstat provider using SDT(9) instead of the custom providerMark Johnston2015-07-191-1/+0
| | | | | | | | | | | in lockstat.ko. This means that lockstat probes now have typed arguments and will utilize SDT probe hot-patching support when it arrives. Reviewed by: gnn Differential Revision: https://reviews.freebsd.org/D2993 Notes: svn path=/head/; revision=285703
* First cut of DTrace for AArch64.Ruslan Bukin2015-07-011-1/+1
| | | | | | | | | Reviewed by: andrew, emaste Sponsored by: ARM Limited Differential Revision: https://reviews.freebsd.org/D2738 Notes: svn path=/head/; revision=285009
* Initial version of DTrace on ARM32.George V. Neville-Neil2015-02-101-1/+3
| | | | | | | | Submitted by: Howard Su based on work by Oleksandr Tymoshenko Reviewed by: ian, andrew, rpaulo, markj Notes: svn path=/head/; revision=278529
* Remove the old NFS client and server from head,Rick Macklem2014-12-231-1/+0
| | | | | | | | | | | | | | | which means that the NFSCLIENT and NFSSERVER kernel options will no longer work. This commit only removes the kernel components. Removal of unused code in the user utilities will be done later. This commit does not include an addition to UPDATING, but that will be committed in a few minutes. Discussed on: freebsd-fs Notes: svn path=/head/; revision=276096
* Remove unnecessary inclusions of bsd.own.mk.Warner Losh2014-08-041-1/+0
| | | | Notes: svn path=/head/; revision=269538
* Redefine the io provider using the SDT(9) macros instead of doing everythingMark Johnston2013-10-241-1/+0
| | | | | | | | | manually. This change has no functional impact. Discussed with: gnn Notes: svn path=/head/; revision=257037
* Add fasttrap for PowerPC. This is the last piece of the dtrace/ppc puzzle.Justin Hibbits2013-10-151-1/+1
| | | | | | | | | | It's incomplete, it doesn't contain full instruction emulation, but it should be sufficient for most cases. MFC after: 1 month Notes: svn path=/head/; revision=256543
* Fix some ppc64 dtrace bugs, and enable systrace_freebsd32 for ppc64.Justin Hibbits2013-08-191-1/+1
| | | | Notes: svn path=/head/; revision=254509
* Add FBT for PowerPC DTrace. Also, clean up the DTrace assembly code,Justin Hibbits2013-03-181-0/+3
| | | | | | | | | | | | | | much of which is not necessary for PowerPC. The FBT module can likely be factored into 3 separate files: common, intel, and powerpc, rather than duplicating most of the code between the x86 and PowerPC flavors. All DTrace modules for PowerPC will be MFC'd together once Fasttrap is completed. Notes: svn path=/head/; revision=248457
* Implement DTrace for PowerPC. This includes both 32-bit and 64-bit.Justin Hibbits2012-11-071-1/+3
| | | | | | | | | | | | | | There is one known issue: Some probes will display an error message along the lines of: "Invalid address (0)" I tested this with both a simple dtrace probe and dtruss on a few different binaries on 32-bit. I only compiled 64-bit, did not run it, but I don't expect problems without the modules loaded. Volunteers are welcome. MFC after: 1 month Notes: svn path=/head/; revision=242723
* Initial commit of an I/O provider for DTrace on FreeBSD.George V. Neville-Neil2012-07-111-0/+1
| | | | | | | | | | | | | | | These probes are most useful when looking into the structures they provide, which are listed in io.d. For example: dtrace -n 'io:genunix::start { printf("%d\n", args[0]->bio_bcount); }' Note that the I/O systems in FreeBSD and Solaris/Illumos are sufficiently different that there is not a 1:1 mapping from scripts that work with one to the other. MFC after: 1 month Notes: svn path=/head/; revision=238366
* Make lockstat and profile modules x86-onlyOleksandr Tymoshenko2012-03-241-3/+1
| | | | Notes: svn path=/head/; revision=233410
* Add DTrace support to the new NFS client. This is essentiallyRick Macklem2011-06-181-0/+1
| | | | | | | | | | cloned from the old NFS client, plus additions for NFSv4. A review of this code is in progress, however it was felt by the reviewer that it could go in now, before code slush. Any changes required by the review can be committed as bug fixes later. Notes: svn path=/head/; revision=223280
* add DTrace systrace support for linux32 and freebsd32 on amd64 syscallsAndriy Gapon2011-03-121-1/+4
| | | | | | | | | | | | | | | | | | | | | | Add systrace_linux32 and systrace_freebsd32 modules which provide support for tracing compat system calls in addition to native system call tracing provided by systrace module. Provided that all the systrace modules are loaded now you can select what syscalls to trace in the following manner: syscall::xxx:yyy - work on all system calls that match the specification syscall:freebsd:xxx:yyy - only native system calls syscall:linux32:xxx:yyy - linux32 compat system calls syscall:freebsd32:xxx:yyy - freebsd32 compat system calls on amd64 PR: kern/152822 Submitted by: Artem Belevich <fbsdlist@src.cx> Reviewed by: jhb (earlier version) MFC after: 3 weeks Notes: svn path=/head/; revision=219561
* Enable fasttrap and make dtraceall depend on fasttrap when building i386Rui Paulo2010-08-241-1/+1
| | | | | | | | | or amd64. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=211753
* MFtbemd:Warner Losh2010-08-231-1/+1
| | | | | | | | | | | | Use MACHINE_CPUARCH in preference to MACHINE_ARCH. The former is the source code location of the machine, the latter the binary output. In general, we want to use MACHINE_CPUARCH instead of MACHINE_ARCH unless we're tesitng for a specific target. The isn't even moot for i386/amd64 where there's momemntum towards a MACHINE_CPUARCH == x86, although a specific cleanup for that likely would be needed... Notes: svn path=/head/; revision=211690
* Remove an elif and add an or-clause.Rui Paulo2010-08-221-3/+1
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=211615
* Add the OpenSolaris dtrace lockstat provider. The lockstat providerStacey Son2009-05-261-0/+1
| | | | | | | | | | | | | adds probes for mutexes, reader/writer and shared/exclusive locks to gather contention statistics and other locking information for dtrace scripts, the lockstat(1M) command and other potential consumers. Reviewed by: attilio jhb jb Approved by: gnn (mentor) Notes: svn path=/head/; revision=192853
* Add dtnfsclient, a first cut at an NFSv2/v3 client reuest DTraceRobert Watson2009-03-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | provider. The NFS client exposes 'start' and 'done' probes for NFSv2 and NFSv3 RPCs when using the new RPC implementation, passing in the vnode, mbuf chain, credential, and NFSv2 or NFSv3 procedure number. For 'done' probes, the error number is also available. Probes are named in the following way: ... nfsclient:nfs2:write:start nfsclient:nfs2:write:done ... nfsclient:nfs3:access:start nfsclient:nfs3:access:done ... Access to the unmarshalled arguments is not easily available at this point in the stack, but the passed probe arguments are sufficient to to a lot of interesting things in practice. Technically, these probes may cover multiple RPC retransmits, and even transactions if the transaction ID change as a result of authentication failure or a jukebox error from the server, but usefully capture the intent of a single NFS request, such as access, getattr, write, etc. Typical use might involve profiling RPC latency by system call, number of RPCs, how often a getattr leads to a call to access, when failed access control checks occur, etc. More detailed RPC information might best be provided by adding a krpc provider. It would also be useful to add NFS client probes for events such as the access cache or attribute cache satisfying requests without an RPC. Sponsored by: Google, Inc. MFC after: 1 month Notes: svn path=/head/; revision=190293
* Add the DTrace test kernel module so that people can run the tests.John Birrell2008-05-311-0/+1
| | | | Notes: svn path=/head/; revision=179452
* Remove 'fasttrap' module for amd64 for now as the code is not thereBjoern A. Zeeb2008-05-241-2/+1
| | | | | | | in sys/cddl/dev/fasttrap. Notes: svn path=/head/; revision=179294
* Leave out a couple of DTrace modules for now.John Birrell2008-05-241-2/+0
| | | | Notes: svn path=/head/; revision=179274
* Add the DTrace kernel module makefiles.John Birrell2008-05-171-0/+23
Notes: svn path=/head/; revision=179065