aboutsummaryrefslogtreecommitdiff
path: root/sys/cddl/dev/dtrace/dtrace_ioctl.c
Commit message (Collapse)AuthorAgeFilesLines
* Don't use pcpu_find() to determine if a CPU ID is valid.Mark Johnston2017-11-271-8/+2
| | | | | | | | | This addresses assertion failures after r326218. MFC after: 1 week Notes: svn path=/head/; revision=326286
* Use PC-relative relocations for USDT probe sites on i386 and amd64.Mark Johnston2017-02-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | When recording probe site addresses in the output DOF file, dtrace -G needs to emit relocations for the .SUNW_dof section in order to obtain the addresses of functions containing probe sites. DTrace expects the addresses to be relative to the base address of the final ELF file, and the amd64 USDT implementation was relying on some unspecified and incorrect behaviour in the base system GNU ld to achieve this. This change reimplements the probe site relocation handling to allow USDT to be used with lld and newer GNU binutils. Specifically, it makes use of R_X86_64_PC64/R_386_PC32 relocations to obtain the probe site address relative to the DOF file address, and adds and uses a new DOF relocation type which computes the final probe site address using these relative offsets. Reported by and discussed with: Rafael EspĂ­ndola MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D9374 Notes: svn path=/head/; revision=313262
* Fix initialization of "p" after r312658.Mark Johnston2017-01-251-1/+1
| | | | | | | CID: 1369410 Notes: svn path=/head/; revision=312763
* Remove the DTRACEHIOC_ADD ioctl.Mark Johnston2017-01-231-8/+3
| | | | | | | | | | | | | | This ioctl has been considered legacy by upstream since the DTrace code was first imported, and is unused. The removal also allows some simplification of dtrace_helper_slurp(). Also remove a bogus copyout in the DTRACEHIOC_ADDDOF handler. Due to a bug, it would overwrite an in-memory copy of the DOF header rather than the passed-in DOF helper. Moreover, DTRACEHIOC_ADDDOF already copies the helper back out automatically since its argument has the IOC_OUT attribute. Notes: svn path=/head/; revision=312658
* Fix a couple of silly mistakes in r291962.Mark Johnston2016-03-081-2/+2
| | | | | | | | | | - Handle the case where no DOF helper is provided. This occurs with the currently-unused DTRACEHIOC_ADD ioctl. - Fix some checks that prevented the loading DOF in the (non-default) lazyload mode. Notes: svn path=/head/; revision=296480
* Modify DTRACEHIOC_ADDDOF to copy the DOF section from the target process.Mark Johnston2015-12-071-16/+38
| | | | | | | | | | | | | | 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). Notes: svn path=/head/; revision=291962
* libdtrace: add support for lazyload mode.Mark Johnston2015-04-081-3/+4
| | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=281257
* Mechanically convert cddl sun #ifdef's to illumosSteven Hartland2015-01-171-5/+5
| | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=277300
* Continue the crusade towards a dev_clone()-free kernel, removing itsDavide Italiano2014-06-251-4/+1
| | | | | | | | | | | | usage from dtrace. The dtrace code already uses cdevpriv(9) since FreeBSD 8, so this change should be quite harmless. Reviewed by: markj Approved by: markj MFC after: never Notes: svn path=/head/; revision=267851
* Expose a few DTrace parameters as sysctls under kern.dtrace and addMark Johnston2014-03-011-1/+2
| | | | | | | | | | | descriptions for several existing sysctls. PR: 187027 Submitted by: Fedor Indutny <fedor@indutny.com> (original version) MFC after: 2 weeks Notes: svn path=/head/; revision=262665
* Hide references to mod_lock. In FreeBSD it is always acquired with theMark Johnston2013-07-051-0/+8
| | | | | | | provider lock held, so its use has no effect. Notes: svn path=/head/; revision=252850
* Bring back part of r249367 by adding DTrace's temporal option, which allowsMark Johnston2013-05-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | users to guarantee that the output of DTrace scripts will be time-ordered. This option is enabled by adding the line #pragma D option temporal to the beginning of a script, or by adding '-x temporal' to the arguments of dtrace(1). This change fixes a bug in the original port of the temporal option. This bug was causing some assertions to fail, so they had been disabled; in this revision the assertions are working properly and are enabled. The DTrace version number has been bumped from 1.9.0 to 1.9.1 to reflect the language change that's being introduced. This change corresponds to part of illumos-gate commit e5803b76927480: 3021 option for time-ordered output from dtrace(1M) Reviewed by: pfg Obtained from: illumos MFC after: 1 month Notes: svn path=/head/; revision=250574
* Fix warning: comparison of unsigned expression < 0 is always false.Sergey Kandaurov2013-02-081-1/+1
| | | | | | | Reported by: clang Notes: svn path=/head/; revision=246538
* Properly cast 64-bit dofhp_dof to pointer.Oleksandr Tymoshenko2012-03-261-5/+1
| | | | | | | | For i386 this change is no-op. For AMD64 it was tested with DTrace test suite: results are the same from the test run before the change and after Notes: svn path=/head/; revision=233521
* Kernel DTrace support for:Rui Paulo2010-08-221-0/+49
| | | | | | | | | | | | o uregs (sson@) o ustack (sson@) o /dev/dtrace/helper device (needed for USDT probes) The work done by me was: Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=211608
* Merge latest DTrace changes from Perforce.Craig Rodrigues2008-11-051-0/+5
| | | | Notes: svn path=/head/; revision=184698
* Custom DTrace kernel module files plus FreeBSD-specific DTrace providers.John Birrell2008-05-231-0/+777
Notes: svn path=/head/; revision=179237