summaryrefslogtreecommitdiffstats
path: root/cddl/contrib/opensolaris/lib/libdtrace/common
Commit message (Collapse)AuthorAgeFilesLines
* Add DT_VERS_1_13 to libdtrace to unbreak the build.markj2018-02-141-2/+4
| | | | | | This is a direct commit to stable/11. PR: 225889
* MFC r327888, r327972, r327973:markj2018-02-131-2/+6
| | | | Add "jid" and "jailname" variables to DTrace.
* MFC r326177:markj2017-12-041-1/+1
| | | | Fix the type signature for sx(9) DTrace subroutines.
* MFC r326046: dt_modtext: return error on archs lacking an implementationemaste2017-11-281-4/+4
| | | | | | Reported by: mmel Reviewed by: markj Sponsored by: The FreeBSD Foundation
* MFC r325042: libdtrace: replace "DOODAD" with more descriptive stringemaste2017-11-282-9/+18
| | | | | | | | Previously some unimplemented libdtrace routines printed the function, file and line number, followed by "DOODAD." That is not particularly informative, so replace it with a message reporting the actual issue. Sponsored by: The FreeBSD Foundation
* MFC r324373:markj2017-10-132-2/+2
| | | | Avoid adding an extra "0x" prefix before pointer formats.
* MFC r323498:markj2017-09-151-1/+1
| | | | Add a O_CLOEXEC use missed in r323166.
* MFC r323166:markj2017-09-121-6/+3
| | | | Use O_CLOEXEC when opening persistent handles in libdtrace.
* MFC r322773-r322775:markj2017-08-301-2/+2
| | | | Fix an off-by-two in the llquantize() action parameter validation.
* MFC r316853: dtrace: fix normalization of stddev aggregationavg2017-05-241-0/+2
| | | | Sponsored by: Panzura
* MFC r314153, r314154:markj2017-03-102-3/+9
| | | | Fix some memory leaks in CDDL code.
* MFC r310316:markj2017-02-031-1/+1
| | | | Consistently print D variable indices in decimal when disassembling.
* MFC r310332:markj2017-02-031-5/+8
| | | | Avoid modifying the object string table when patching USDT probes.
* Corrected non-portable reuse of va_list in dt_printf()gnn2016-10-281-5/+16
| | | | | Submitted by: Graeme Jenkinson Reviewed by: markj
* Add initial DTrace support for RISC-V.br2016-05-242-2/+16
| | | | | Sponsored by: DARPA, AFRL Sponsored by: HEIF5
* Rename dprintf into dbg_printf to avoid collision with dprintf(3)bapt2016-05-101-11/+11
| | | | | When dprintf(3) in 2009 was added a _WITH_DPRINTF guard has also been added. This rename is made in preparation for the removal of this guard
* libdtrace: Add a missing unlock to an error handler.markj2016-04-111-0/+1
| | | | | Submitted by: Jihyun Yu <yjh0502@gmail.com> MFC after: 3 days
* libdtrace: use calloc(3) instead of malloc(3) when it makes sense.pfg2016-03-143-14/+14
| | | | | | | | | calloc(3) is faster and occasionally safer than malloc(3) + bzero(3). In one case, pointed out by Mark[1], this also cleans up a calculation. Reviewed by: markj [1] MFC after: 1 week
* Modify DTRACEHIOC_ADDDOF to copy the DOF section from the target process.markj2015-12-071-46/+4
| | | | | | | | | | | r281257 added support for lazyload mode by allowing dtrace(1) to register a DOF section on behalf of a traced process. This was implemented by having libdtrace copy the DOF section into a heap-allocated buffer and passing its address to the ioctl handler. However, DTrace uses the DOF section address as a lookup key in certain cases, so the ioctl handler should be given the target process' DOF section address instead. This change modifies the ADDDOF handler to copy the DOF section in from the target process, rather than from dtrace(1).
* Perform bounds checking when constructing a format string.markj2015-08-021-5/+17
| | | | | | | | This was detected by the FORTIFY_SOURCE build. PR: 201657 Reported by: pfg MFC after: 2 weeks
* First cut of DTrace for AArch64.br2015-07-011-3/+17
| | | | | | Reviewed by: andrew, emaste Sponsored by: ARM Limited Differential Revision: https://reviews.freebsd.org/D2738
* libdtrace: allow D libraries to declare dependencies on kernel modulesmarkj2015-06-065-0/+100
| | | | | | | | | | | | The "depends_on module" pragma can be used to declare a dependency on a DTrace module, which for kernel probes corresponds to a KLD. Such dependencies cannot be checked if the KLD is compiled into the kernel. Therefore, allow a module dependency to be satisfied if either a kernel module or a KLD with the specified name is loaded. Differential Revision: https://reviews.freebsd.org/D2653 Reviewed by: gnn, rpaulo Reported by: gnn
* Fix a typo that snuck in with r283024, and remove the EXFAIL annotation frommarkj2015-05-171-1/+1
| | | | a test which now passes as a result of that change.
* Respect the libdir option when linking drti.o, rather than hardcoding themarkj2015-05-172-16/+14
| | | | | | default path of /usr/lib(32)/dtrace. MFC after: 3 weeks
* As dtrace(1) processes D libraries under /usr/lib/dtrace, the compiler maymarkj2015-05-171-0/+1
| | | | | | | | | | | return an error if one of the depends_on directives in a library is not satisfied. In this case, libdtrace is supposed to ignore the library and carry on. However, the remainder of the library may still be buffered by the lexer, causing libdtrace to erroneously continue processing it on the next call to yyparse(). Fix this by explicitly flushing the input buffer each time the compiler state is reset. MFC after: 3 weeks
* When in lazyload mode, write the DOF to a temporary file and rename itmarkj2015-05-171-13/+16
| | | | | | rather than writing directly to the output file. CID: 1147172
* libdtrace: add support for lazyload mode.markj2015-04-083-17/+79
| | | | | | | | | | | Passing "-x lazyload" to dtrace -G during compilation causes dtrace(1) to not link drti.o into the output object file, so the USDT probes are not created during process startup. Instead, dtrace(1) will automatically discover and create probes on the process' behalf when attaching. Differential Revision: https://reviews.freebsd.org/D2203 Reviewed by: rpaulo MFC after: 1 month
* Fix a misparenthesization that could cause a crash if TERM is not set.markj2015-03-311-2/+2
| | | | | | Reported by: Coverity (internal) MFC after: 3 days Sponsored by: EMC / Isilon Storage Division
* Remove drti.o's dependency on libelf. This makes it possible to add DTracemarkj2015-02-185-72/+86
| | | | | | | | | | | | | | | | | | | probes to userland programs and libraries without also needing to link libelf. dtrace -G places the __SUNW_dof symbol at the beginning of the DOF (DTrace probe and provider metdata) section in the generated object file; drti.o now just uses this symbol to locate the section. A complication occurs when multiple dtrace-generated object files are linked together, since the __SUNW_dof symbol defined in each file is global. This is handled by using objcopy(1) to convert __SUNW_dof to a local symbol once drti.o has been linked with the generated object file. Upstream, this is done using a linker feature not present in GNU ld. Differential Revision: https://reviews.freebsd.org/D1757 Reviewed by: rpaulo MFC after: 1 month Relnotes: yes
* Let the standard deviation of the empty set be 0. This is consistent withmarkj2015-02-021-0/+3
| | | | | | | | | | the behaviour for averages, and fixes a crash that can occur when attempting to print a stddev aggregation containing no elements: dtrace:::BEGIN { @ = stddev(0); clear(@); printa("%@d", @); } PR: 197260 MFC after: 2 week
* Mechanically convert cddl sun #ifdef's to illumossmh2015-01-1725-174/+173
| | | | | | | | | | | | Since the upstream for cddl code is now illumos not sun, mechanically convert all sun #ifdef's to illumos #ifdef's which have been used in all newer code for some time. Also do a manual pass to correct the use if #ifdef comments as per style(9) as well as few uses of #if defined(__FreeBSD__) vs #ifndef illumos. MFC after: 1 month Sponsored by: Multiplay
* Add PowerPC64 function descriptor support for dt_link.cjhibbits2014-12-281-14/+27
| | | | | | | | | | | | | | | | | | | | | | | Summary: PowerPC64 uses function descriptors in a section .opd, exporting the descriptors to the symbol table. This adds support for these into dt_link.c so that dtrace USDT probes can be compiled. Test Plan: Tested only on powerpc64. No regression testing has been performed, so I want someone with x86 hardware to regression test this. Tested on amd64 by markj Reviewers: #dtrace, markj Reviewed By: #dtrace, markj Subscribers: markj Differential Revision: https://reviews.freebsd.org/D1267 MFC after: 3 weeks
* DOF tables are aligned according to the DOF section's alignment constraint,markj2014-12-261-1/+4
| | | | | | | | so take this into account when iterating over DOF tables. PR: 195555 Submitted by: Fedor Indutny <fedor@indutny.com> (original version) MFC after: 1 week
* We can stop iterating once we've found the DOF section.markj2014-12-231-0/+1
| | | | Submitted by: Fedor Indutny <fedor@indutny.com>
* Initialize an argument to NULL instead of expecting dlinfo() to do it.will2014-12-171-1/+1
| | | | | | | | | | dlinfo() is a weak reference that may not be initialized at the time of execution. The default implementation (in lib/libc/gen/dlfcn.c) neither modifies the address pointed to by the third argument nor returns an error. Differential Revision: https://reviews.freebsd.org/D1326 Reviewed by: markj MFC after: 1 week
* Adjust some checks missed in r274637, now that pi_rname can be NULL.markj2014-11-251-2/+3
| | | | | | | | Additionally fix a misparenthesization in the same check, noticed while fixing the first bug. This bug only appears to cause problems if the same USDT probe appears twice within a static function. X-MFC-With: r274637
* The module load address always needs to be included when setting the dm_*_vamarkj2014-11-251-3/+3
| | | | | | | | | | | | fields of dt_module_t. Previously, this was only done on architectures where kernel modules have type ET_REL; this change fixes that. As a result, symbol name resolution in the stack() action now works properly for kernel modules on i386. Reported by: Shrikanth Kamath <shrikanth07@gmail.com> Tested by: Shrikanth Kamath Discussed with: avg MFC after: 2 weeks
* DTrace imposes a 128-byte limit on the length of the function component ofmarkj2014-11-173-22/+21
| | | | | | | | | | | | | | | | | a probe name. When dtrace -G builds up a DOF section for the specified provider(s), the probe function names are truncated to fit in this limit. The DOF is later used to build the symbol table for the generated object file, so the table can end up with truncated references, causing link errors. Instead of potentially truncating symbol table entries, write the full function name to the DOF string table and allow the kernel to enforce the 128-byte function name limit when a process attempts to load its DOF. PR: 194757 Differential Revision: https://reviews.freebsd.org/D1175 Reviewed by: rpaulo MFC after: 2 weeks
* Treat D keywords as identifiers in certain postfix expressions. This allowsmarkj2014-10-061-0/+23
| | | | | | | | | | one to, for example, access the "provider" field of a struct g_consumer, even though "provider" is a D keyword. PR: 169657 MFC after: 2 months Discussed with: Bryan Cantrill Sponsored by: EMC / Isilon Storage Division
* Hook up support for userland CTF support in DTrace. This required somemarkj2014-10-031-19/+1
| | | | | | | | | | | | | | | | | | modifications to libproc to support fetching the CTF info for a given file. With this change, dtrace(1) is able to resolve type info for function and USDT probe arguments, and function return values. In particular, the args[n] syntax should now work for referencing arguments of userland probes, provided that the requisite CTF info is available. The uctf tests pass if the test programs are compiled with CTF info. The current infrastructure around the DTrace test suite doesn't support this yet. Differential Revision: https://reviews.freebsd.org/D891 MFC after: 1 month Relnotes: yes Sponsored by: EMC / Isilon Storage Division
* Remove an incorrect close(2) call that was added in r271413.markj2014-09-221-1/+0
| | | | | | Reported by: Coverity CID: 1238923 X-MFC-With: r271413
* Remove some variables that are no longer used as of r271413.markj2014-09-221-10/+4
| | | | | | Reported by: Coverity CID: 1238924 X-MFC-With: r271413
* Fix some incorrect endianness checks.markj2014-09-171-2/+2
| | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* Use the linker to perform relocations in the SUNW_dof section rather thanmarkj2014-09-112-212/+23
| | | | | | | | | | | doing them in drti during startup. This fixes a number of problems with using USDT probes in stripped executables and shared libraries, and with USDT probes in static functions. Reviewed by: rpaulo MFC after: 1 month Sponsored by: EMC / Isilon Storage Division Phabric: D751
* Make DTrace stuff compile with C99 standard.delphij2014-08-223-0/+11
|
* Remove the BROKEN_LIBELF section.rpaulo2014-08-101-52/+0
| | | | | | This problem was fixed by Kai Wang in 2011. MFC after: 3 days
* Preserve the errno value of an ioctl before calling free(3). Previously,markj2014-08-043-11/+14
| | | | | | | errno was very occasionally being clobbered, resulting in a bogus error from dt_consume() and thus an error from dtrace(1). MFC after: 2 weeks
* Remove ia64.marcel2014-07-071-22/+2
| | | | | | | | | | | | | | | | | This includes: o All directories named *ia64* o All files named *ia64* o All ia64-specific code guarded by __ia64__ o All ia64-specific makefile logic o Mention of ia64 in comments and documentation This excludes: o Everything under contrib/ o Everything under crypto/ o sys/xen/interface o sys/sys/elf_common.h Discussed at: BSDcan
* MFV illumosrpaulo2014-06-266-38/+724
| | | | | | | | 4471 DTrace count() with histogram 4472 DTrace full width distribution histograms 4473 DTrace frequency trails MFC after: 2 weeks
* MFV illumosrpaulo2014-06-2622-116/+724
| | | | | | | | | | 4474 DTrace Userland CTF Support 4475 DTrace userland Keyword 4476 DTrace tests should be better citizens 4479 pid provider types 4480 dof emulation is missing checks MFC after: 2 weeks
OpenPOWER on IntegriCloud