summaryrefslogtreecommitdiffstats
path: root/cddl/contrib/opensolaris/cmd/dtrace
Commit message (Collapse)AuthorAgeFilesLines
* The DTrace harness (dtest.pl) executes DTrace scripts with the -C flag,markj2015-01-303-3/+9
| | | | | | | | which causes dtrace(1) to run the C preprocessor on input scripts before executing them. Suppress some warnings emitted by the preprocessor which are confusing the DTrace lexer tests. MFC after: 1 week
* Include required headers in DTrace test programs.markj2015-01-3010-0/+15
| | | | MFC after: 1 week
* Replace Solaris identifiers and types with their FreeBSD equivalents.markj2015-01-3012-16/+16
| | | | MFC after: 1 week
* Use the correct field when reading the PID out of a struct proc.markj2015-01-304-4/+4
| | | | MFC after: 1 week
* When searching for an accompanying test program, look in the directorymarkj2015-01-301-1/+1
| | | | | | | containing the test script rather than the current directory. This is needed in order to run the DTrace tests under Kyua. MFC after: 1 week
* Mechanically convert cddl sun #ifdef's to illumossmh2015-01-171-16/+16
| | | | | | | | | | | | 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
* Remove a build artifact of the USDT tests.markj2014-10-151-11/+0
| | | | MFC after: 3 days
* Hook up support for userland CTF support in DTrace. This required somemarkj2014-10-031-1/+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
* Have dtrace(1) handle SIGPIPE by cleaning up and exiting. Additionally,markj2014-10-021-15/+30
| | | | | | | | | | | | | | | | install signal handlers when running in list mode (-l), and acknowledge interrupts by cleaning up and exiting. This ensures that a command like $ dtrace -l -P 'pid$target' -p <target PID> | less won't cause the ptrace(2)d target process to be killed if less(1) exits before all dtrace output is consumed. Reported by: Anton Yuzhaninov <citrin+bsd@citrin.ru> Differential Revision: https://reviews.freebsd.org/D880 Reviewed by: rpaulo MFC after: 1 month Sponsored by: EMC / Isilon Storage Division
* Fix the description of the -h option.markj2014-09-261-14/+13
| | | | | Reported by: swills MFC after: 3 days
* Implement a workaround to allow this test program to be compiled with clang.markj2014-09-171-2/+2
| | | | | | | | | It seems that if a pragma is used to define a weak alias for a local function, the pragma must appear after the function is defined. PR: 193056 MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* Fix a number of typos and programming errors in the userland CTF tests. Itmarkj2014-09-174-5/+9
| | | | | | | | seems that they would only pass by chance on illumos; on FreeBSD, they still fail since userland CTF is not yet supported. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* Fix elfdump(1) usage in the userland CTF tests.markj2014-09-1610-10/+10
| | | | | | PR: 193110 MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* MFV illumosrpaulo2014-06-2612-0/+1554
| | | | | | | | 4471 DTrace count() with histogram 4472 DTrace full width distribution histograms 4473 DTrace frequency trails MFC after: 2 weeks
* MFV illumosrpaulo2014-06-2625-1/+1125
| | | | | | | | | | 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
* MFV illumosrpaulo2014-06-2614-2/+790
| | | | | | 4477 DTrace should speak JSON MFC after: 2 weeks
* MFV illumos r266986:rpaulo2014-06-265-0/+454
| | | | | | | | 2915 DTrace in a zone should see "cpu", "curpsinfo", et al 2916 DTrace in a zone should be able to access fds[] 2917 DTrace in a zone should have limited provider access MFC after: 2 weeks
* Revert r267898.rpaulo2014-06-2612-1552/+0
|
* Bring the following change from the illumos-joyent repository:rpaulo2014-06-2612-0/+1552
| | | | | | | | | | | | commit 78e24ab6803bbe11ba37642624e1498ede5b239d Author: Bryan Cantrill <bryan@joyent.com> Date: Thu Oct 31 01:20:54 2013 OS-1688 DTrace count() with histogram OS-2360 DTrace full width distribution histograms OS-2361 DTrace frequency trails MFC after: 2 weeks
* MFV r266988:pfg2014-06-153-0/+168
| | | | | | | | | | | Merge from r258379 missed the tests. 4248 dtrace(1M) should never create DOF with empty probes section 4249 Only probes from the first DTrace object file will be included Illumos Revision: 54a20ab41aadcb81c53e72fc65886e964e9add59 MFC after: 5 days
* Fix tst.ZeroModuleProbes.d.ksh, which was incorrectly modified in r178534.markj2014-05-191-1/+1
| | | | | | Since "BEGIN" is not the name of a module, the test would just hang. MFC after: 3 days
* Replace a few Solarisisms with their corresponding FreeBSDisms to make a fewmarkj2014-04-156-6/+6
| | | | printf tests pass.
* 4478 dtrace_dof_maxsize is far too smallmarkj2014-02-281-0/+97
| | | | | | | illumos/illumos-gate@d339a29bb4765c4b6883a935cf69b669cd05bca0 PR: 187027 MFC after: 1 week
* 1452 DTrace buffer autoscaling should be less violentmarkj2014-02-222-16/+0
| | | | | | | | | | | illumos/illumos-gate@6fb4854bed54ce82bd8610896b64ddebcd4af706 This fixes the tst.resize1.d and tst.resize2.d DTrace tests, which have been failing since r261122 since they were causing dtrace(1) to attempt to allocate and use large amounts of memory, and get killed by the OOM killer as a result. MFC after: 1 month
* Enable some previously-disabled DTrace tests for umod, ufunc and usym. Theymarkj2013-12-043-3/+3
| | | | | | expect the installed ksh binary to be named "ksh", which is not the case when it's installed on FreeBSD via the shells/ksh93 port. Allow for it to be "ksh93" as well so that the tests can actually pass.
* Convert the dtrace(1) man page to mdoc and fix up some aspects of it thatmarkj2013-10-101-645/+652
| | | | | | | | | | | | | | | | don't make sense on FreeBSD. In particular, - remove the ATTRIBUTES section, - remove references to the Solaris Dynamic Tracing Guide, except in the SEE ALSO section, - update the description of the -A option for FreeBSD's implementation, - remove references to Solaris-specific programs and configuration files, and replace them with FreeBSD equivalents where possible. The content has not changed aside from this. Approved by: re (joel) MFC after: 1 week
* DTrace: re-apply r249426 now that the underlying issues have been solved.pfg2013-07-2814-18/+151
| | | | | | | | | | | | | | | | | | | | Merge change from illumos: 3519 DTrace fails to resolve const types from fbt 3520 dtrace internal error -- token type 316 is not a valid D compilation token 3521 clean up dtrace unit tests Illumos Revision: e98f46c Reference: https://www.illumos.org/issues/3519 https://www.illumos.org/issues/3520 https://www.illumos.org/issues/3521 Tested by: Fabian Keil Obtained from: Illumos MFC after: 1 month
* DTrace: re-merge remainder of r249367 (original from Illumos).pfg2013-07-2824-149/+509
| | | | | | | | | | | | | | | | | | | | | | | Bring back some important fixes from Illumos: 3022 DTrace: keys should not affect the sort order when sorting by value 3023 it should be possible to dereference dynamic variables 3024 D integer narrowing needs some work We particularly avoid the LD_NOLAZYLOAD changes that Illumos made as those don't apply to FreeBSD and were causing problems in interactive mode. Illumos Revision: 13758:23432da34147 Reference: https://www.illumos.org/issues/3022 https://www.illumos.org/issues/3023 https://www.illumos.org/issues/3024 MFC after: 1 month Tested by: markj
* Use kern_ioctl() rather than ioctl() for testing the FBT provider, since themarkj2013-07-277-12/+12
| | | | latter doesn't exist in FreeBSD. All the tests under fbtprovider pass now.
* Port the SDT test now that it's possible to create SDT probes that takemarkj2013-06-022-13/+11
| | | | | | | | | | | | seven arguments. The original test uses Solaris' uadmin system call to trigger the test probe; this change adds a sysctl to the dtrace_test module and gets the test program to trigger the test probe via the sysctl handler. The test is currently failing on amd64 because of some bugs in the way that probe arguments beyond the first five are obtained - these bugs will be fixed in a separate change.
* Re-introduce another part of r249367. This commit fixes a register leak inmarkj2013-05-192-0/+85
| | | | | | | | | | | | dt_cg_ptrsize() and generally cleans up some of the error handling around register allocation. This change corresponds to part of illumos-gate commit e5803b76927480: 3025 register leak in D code generation Reviewed by: pfg Obtained from: illumos MFC after: 1 month
* Convert a couple of helper scripts used to test the ip provider to work onmarkj2013-05-152-11/+20
| | | | | | | | FreeBSD. In the IPv6 case, try each interface before returning an error; each IPv6-enabled interface will have a link-local address even if the link isn't up. MFC after: 1 week
* head -n doesn't take negative arguments on FreeBSD, so instead use sed '$d'markj2013-05-122-4/+4
| | | | to remove the last line of a file.
* Bring back part of r249367 by adding DTrace's temporal option, which allowsmarkj2013-05-126-18/+275
| | | | | | | | | | | | | | | | | | | | | | | | 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
* DTrace: Revert r249426pfg2013-04-1714-151/+18
| | | | | | This change actually depends on r249367 which had to be reverted Pointy Hat: pfg
* DTrace: Revert r249367pfg2013-04-1738-951/+382
| | | | | | | | | | | | | | | | | | | | | | The following change from illumos brought caused DTrace to pause in an interactive environment: 3026 libdtrace should set LD_NOLAZYLOAD=1 to help the pid provider This was not detected during testing because it doesn't affect scripts. We shouldn't be changing the environment, especially since the LD_NOLAZYLOAD option doesn't apply to our (GNU) ld. Unfortunately the change from upstream was made in such a way that it is very difficult to separate this change from the others so, at least for now, it's better to just revert everything. Reference: https://www.illumos.org/issues/3026 Reported by: Navdeep Parhar and Mark Johnston
* DTrace: print() should try to resolve function pointerspfg2013-04-162-0/+37
| | | | | | | | | | | | | | | | Merge changes from illumos: 3675 DTrace print() should try to resolve function pointers 3676 dt_print_enum hardcodes a value of zero Illumos Revision: b1fa6326238973aeaf12c34fcda75985b6c06be1 Reference: https://www.illumos.org/issues/3675 https://www.illumos.org/issues/3676 Obtained from: Illumos MFC after: 1 month
* Dtrace: resolve const types from fbt and other fixes.pfg2013-04-1214-18/+151
| | | | | | | | | | | | | | | | | | | | Merge change from illumos: 3519 DTrace fails to resolve const types from fbt 3520 dtrace internal error -- token type 316 is not a valid D compilation token 3521 clean up dtrace unit tests Illumos Revision: e98f46c Reference: https://www.illumos.org/issues/3519 https://www.illumos.org/issues/3520 https://www.illumos.org/issues/3521 Tested by: Fabian Keil Obtained from: Illumos MFC after: 1 month
* DTrace: option for time-ordered outputpfg2013-04-1138-382/+951
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge changes from illumos: 3021 option for time-ordered output from dtrace(1M) 3022 DTrace: keys should not affect the sort order when sorting by value 3023 it should be possible to dereference dynamic variables 3024 D integer narrowing needs some work 3025 register leak in D code generation 3026 libdtrace should set LD_NOLAZYLOAD=1 to help the pid provider This brings yet another feature implemented in upstream DTrace. A complete description is available here: http://dtrace.org/blogs/ahl/2012/07/28/my-new-dtrace-favorite/ This change bumps the DT_VERS_* number to 1.9.1 in accordance to what is done in illumos. This change was somewhat complicated because upstream is mixed many changes in an individual commit and some of the tests don't really apply to us. There are also appear to be differences in timestamping with Solaris so we had to workaround some assertions making sure no regression happened. Special thanks to Fabian Keil for changes and testing. Illumos Revisions: 13758:23432da34147 Reference: https://www.illumos.org/issues/3021 https://www.illumos.org/issues/3022 https://www.illumos.org/issues/3023 https://www.illumos.org/issues/3024 https://www.illumos.org/issues/3025 https://www.illumos.org/issues/1694 Tested by: Fabian Keil Obtained from: Illumos MFC after: 1 months
* Dtrace: enablings on defunct providers prevent providers from unregisteringpfg2013-04-014-2/+371
| | | | | | | | | | | | | | | | | | | | | | Merge change from illumos: 1368 enablings on defunct providers prevent providers from unregistering We try to address some underlying differences between the Solaris and FreeBSD implementations: dtrace_attach() / dtrace_detach() are currently unimplemented in FreeBSD but the new code from illumos makes use of taskq so some adaptations were made to dtrace_open() and dtrace_close() to handle them appropriately. Illumos Revision: r13430:8e6add739e38 Reference: https://www.illumos.org/issues/1368 Reviewed by: gnn Tested by: Fabian Keil Obtained from: Illumos MFC after: 3 weeks
* Dtrace: dtrace.c erroneously checks for memory alignment on amd64.pfg2013-03-261-20/+29
| | | | | | | | | | | | | | Merge change from illumos: 3511 dtrace.c erroneously checks for memory alignment on amd64 Illumos Revision: c93cc65 Reference: https://www.illumos.org/issues/3511 Obtained from: Illumos MFC after: 3 weeks
* Dtrace: Add SUN MDB-like type-aware print() action.pfg2013-03-2511-0/+354
| | | | | | | | | | | | | | | | | | | | | | | | | | | Merge change from illumos: 1694 Add type-aware print() action This is a very nice feature implemented in upstream Dtrace. A complete description is available here: http://dtrace.org/blogs/eschrock/2011/10/26/your-mdb-fell-into-my-dtrace/ This change bumps the DT_VERS_* number to 1.9.0 in accordance to what is done in illumos. While here also include some minor cleanups to ease further merging and appease clang with a fix by Fabian Keil. Illumos Revisions: 13501:c3a7090dbc16 13483:f413e6c5d297 Reference: https://www.illumos.org/issues/1560 https://www.illumos.org/issues/1694 Tested by: Fabian Keil Obtained from: Illumos MFC after: 1 month
* Dtrace: add toupper()/tolower() and enhancements to lltostr().pfg2013-03-2510-0/+694
| | | | | | | | | | | | | | | | | | | | | | | | | Merge changes from illumos: 1451 DTrace needs toupper()/tolower() subroutines 1457 lltostr() D subroutine should take an optional base This change bumps the DT_VERS_* number to 1.8.1 in accordance to what is done in illumos. The test suite we currently include is outdated and doesnt support some updates in tst.subr.d which had to be left out for now. Illumos Revisions: r13458 5e394d8db762 r13459 c3454574dd1a Reference: https://www.illumos.org/issues/1451 https://www.illumos.org/issues/1457 Tested by: Fabian Keil Obtained from: Illumos MFC after: 1 month
* Dtrace: add optional size argument to tracemem().pfg2013-03-244-11/+1389
| | | | | | | | | | | | | | | | | | | | | | | | | Merge change from illumos: 1455 DTrace tracemem() should take an optional size argument Our local enhancements to dt_print_bytes were equivalent to those in illumos but we made it match the illumos version to ease further code merges. For now leave out tst.smallsize.d and tst.smallsize.d.out since those don't seem to work cleanly on FreeBSD. This change bumps the DT_VERS_* number to 1.7.1 in accordance to what is done in illumos. Illumos Revision: 13457:571b0355c2e3 Reference: https://www.illumos.org/issues/1455 Tested by: Fabian Keil Obtained from: Illumos MFC after: 1 month
* Orphaned processes that are being traced are killed by thegibbs2013-02-201-0/+7
| | | | | | | | | | | | | | | | | kernel. Properly restore, continue, and detach from processes being DTraced when DTrace exits with an error so the program being inspected is not terminated. cddl/contrib/opensolaris/cmd/dtrace/dtrace.c: In fatal(), the generic error handler, close the DTrace handle as is done in the "probe/script" error handler dfatal(). fatal() can be invoked after DTrace attaches to processes (e.g. a script specified by command line argument can't be found) and closing the handle will release them. Submitted by: Spectra Logic Corporation Reviewed by: rpaulo, gnn
* Revert previous commit. The bug was actually caused by an issuegnn2012-07-251-3/+1
| | | | | | | in pre 1.8.5 versions of sudo which were sending too many SIGINTs to processes when the user hit Ctrl-C. Pointed out by: avg@, rpaulo@, sbruno@
* Fix a bug in interrupt handling so that we're only consideredgnn2012-07-241-1/+3
| | | | | | | | impatient if we sent more than 2 INT signals. This fixes a bug where we wouldn't see aggregations print on the command line if we Ctrl-C'd a dtrace script or command line invocation. MFC after: 2 weeks
* Dtrace: improve handling of library paths.pfg2012-07-172-0/+152
| | | | | | | | | | | | | | | | | | | | | Merge changes from illumos 906 dtrace depends_on pragma should search all library paths, not just the current one 949 dtrace should only include the first instance of a library found on its library path Illumos Revisions: 13353:936a1e45726c 13354:2b2c36a81512 Reference: https://www.illumos.org/issues/906 https://www.illumos.org/issues/949 Tested by: Fabian Keil Obtained from: Illumos MFC after: 3 weeks
* Merge illumos commit 13455:7205f7794835pfg2012-07-141-0/+30
| | | | | | | | | | 1458 D compiler fails to generate error on sizeof() an undefined struct Reference: https://www.illumos.org/issues/1458 Tested by: Fabian Keil MFC after: 3 weeks
* Bring llquantize support into Dtrace.pfg2012-06-2734-0/+3390
| | | | | | | | | | | | | | | | | | Bryan Cantrill implemented the equivalent of semi-log graph paper for Dtrace so llquantize will use one logarithmic and one linear scale. Special thanks to Mark Peek for providing fix to an assertion and to Fabian Keill for testing the port. Illumos Revision: 13355:15b74a2a9a9d Reference: https://www.illumos/issues/905 Obtained from: Illumos Tested by: Fabian Keill, mp MFC after: 4 days
OpenPOWER on IntegriCloud