aboutsummaryrefslogtreecommitdiff
path: root/cddl/usr.sbin/dtrace/tests
Commit message (Collapse)AuthorAgeFilesLines
* libdtrace: Permit taking the address of an identifier without type infoMark Johnston2025-07-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Symbols defined using assembler directives lack type info, but in this case one ought to be able to cast a pointer to the symbol and dereference the pointer to get a value. Without this change, D disallows this trick since it requires all identifiers to have a type. Relax the rules slightly and allow an identifier to have type "void" if we know we're just taking its address. As a result, the following dtrace invocation works: dtrace -n 'tick-1s {printf("%d", *(int *)&`ticks);}' In particular, since commit b2b974f7ef4c ("clock: Simplify subr_ticks and rename"), "ticks" does not have any type info associated with it, so its value couldn't be printed. This trick provides a workaround and is probably generally useful. Add a regression test which exercises this functionality. PR: 287752 Reviewed by: avg MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D51417
* dtrace tests: Fix the ATF config variable nameMark Johnston2025-01-231-1/+1
| | | | | Fixes: 6e6a67e98652 ("dtrace tests: Avoid hard-coding paths to required programs") Sponsored by: Innovate UK
* dtrace tests: Avoid hard-coding paths to required programsMark Johnston2025-01-221-1/+1
| | | | | MFC after: 1 week Sponsored by: Innovate UK
* dtrace tests: Add a test case which validates FBT probe argumentsMark Johnston2024-09-191-0/+2
| | | | | | Reviewed by: avg MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D46674
* Remove residual blank line at start of MakefileWarner Losh2024-07-154-4/+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 tests: Regenerate makefiles after commit d0b2dbfa0ecfMark Johnston2024-06-0189-89/+0
|
* dtrace tests: Fix loading of the test kernel moduleMark Johnston2024-06-011-1/+1
| | | | | | | | The old way is racy and can cause two instances, running in parallel, to attempt to load dtrace_test, and only one will succeed. This caused errors when running dtrace tests in parallel. MFC after: 1 week
* dtrace tests: Diff expected and actual output upon a miscompareMark Johnston2024-01-101-0/+4
| | | | | | This makes quick diagnosis of test failures easier. MFC after: 1 week
* dtrace tests: Require perlMark Johnston2024-01-101-1/+1
| | | | | | | A number of tests use it, so just require it globally as we do with other tools. MFC after: 1 week
* dtrace tests: Run ksh with -pMark Johnston2024-01-101-2/+2
| | | | | | | | In particular, avoid loading the user's .profile file, since that can have undesirable side effects. Most tests were already careful to do this. MFC after: 1 week
* dtrace: Add the 'oformat' libdtrace optionDomagoj Stolfa2024-01-103-1/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* dtrace: Remove $FreeBSD$ from genmakefiles.sh.Domagoj Stolfa2023-08-251-2/+0
| | | | | | | $FreeBSD$ is gone in head, so this should be removed as well. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D41595
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-16180-181/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* dtrace: move kinst tests to commonChristos Margiolis2023-07-043-2/+2
| | | | | | | Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40414
* kinst: Add a rudimentary regression test caseMark Johnston2022-10-112-1/+21
| | | | | | | The test instruments a number of large, frequently called kernel functions while generating load in the background. MFC after: 3 months
* DTrace test: skip flakey common.misc.t_dtrace_contrib.tst_dynopt_d in CILi-Wen Hsu2022-03-241-0/+3
| | | | | PR: 237641 Sponsored by: The FreeBSD Foundation
* DTrace test: Add a new keyword SKIPCI to gentest.shLi-Wen Hsu2022-03-242-4/+8
| | | | | | | | | This is for marking a test case is flakey and should not be executed in the CI environment. Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34635
* Enable creation of static userspace probes in incremental builds.Mark Johnston2020-08-201-4/+0
| | | | | | | | | | | | | | | | | | To define USDT probes, dtrace -G makes use of relocations for undefined symbols: the target address is overwritten with NOPs and the location is recorded in the DOF section of the output object file. To avoid link errors, the original relocation is destroyed. However, this means that the same input object file cannot be processed multiple times, as happens during incremental rebuilds. Instead, only set the relocation type to NONE, so that all information required to reconstruct USDT probes is preserved. Reported by: bdrewery MFC after: 3 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=364438
* dtrace tests: Support globbing for excludesBryan Drewery2020-04-292-3/+20
| | | | | | | | | | | Downstream this makes skipping tests like common/ip/tst.*sctp*.ksh simpler. Reviewed by: vangyzen, cem, markj Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D24608 Notes: svn path=/head/; revision=360476
* DTrace: add a top level makefile to the new test suitMariusz Zaborski2019-06-091-0/+9
| | | | | | | Pointed out by: markj Notes: svn path=/head/; revision=348841
* DTrace: create an amd64 test suitMariusz Zaborski2019-06-053-1/+25
| | | | | | | | | | | | | Create two tests checking if we can read urgs registers and if the rax register returns a correct number. Reviewed by: markj Discussed with: lwhsu MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20364 Notes: svn path=/head/; revision=348706
* Hook up the existing i386 DTrace tests to the build.Mark Johnston2019-05-226-0/+106
| | | | | | | | | | Now that it's relatively easy to do so, we might as well. MFC after: 1 week Event: Waterloo Hackathon 2019 Notes: svn path=/head/; revision=348081
* Make it possible to generate makefiles for arch-dependent DTrace tests.Mark Johnston2019-05-221-8/+10
| | | | | | | | MFC after: 1 week Event: Waterloo Hackathon 2019 Notes: svn path=/head/; revision=348080
* Add support for send, receive and state-change DTrace providers forMichael Tuexen2018-08-222-0/+10
| | | | | | | | | | | | 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-312-0/+5
| | | | | | | | | | | | | | 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
* Improve TCP related tests for dtrace.Michael Tuexen2018-07-221-3/+0
| | | | | | | | | | | | | | Ensure that the TCP connections are terminated gracefully as expected by the test. Use appropriate numbers for sent/received packets. In addition, enable tst.localtcpstate.ksh, which should pass, but doesn't until https://reviews.freebsd.org/D16369 is committed. Reviewed by: markj@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D16288 Notes: svn path=/head/; revision=336597
* Fix the UDP tests for dtrace.Michael Tuexen2018-07-151-1/+0
| | | | | | | | | | | | | | | | | The code imported from opensolaris was depending on ping supporting UDP for sending probes. Since this is not supported by ping on FreeBSD use a perl script instead. The remote test requires the usage of ksh93, so state that in the sheband. Enable the local test, but keep the remote test disabled, since it requires a remote machine on the LAN. Reviewed by: markj@, gnn@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D16268 Notes: svn path=/head/; revision=336315
* Remove tst.zonename.d from the list of expected failures.Mark Johnston2018-01-141-1/+0
| | | | | | | X-MFC with: r327888 Notes: svn path=/head/; revision=327973
* Add "jid" and "jailname" variables to DTrace.Mark Johnston2018-01-121-0/+2
| | | | | | | | | | | | | | | | | These return the jail ID and jail name for the traced process, respectively, and are analogous to "zonename" on Solaris/illumos. "zonename" is now aliased to "jailname". Also add some stress tests for the new variables. Submitted by: Domagoj Stolfa <domagoj.stolfa@gmail.com> Reviewed by: dteske (previous version) MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D13877 Notes: svn path=/head/; revision=327888
* Add a regression test for r327794.Mark Johnston2018-01-101-0/+2
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=327795
* Mark uctf/err.user64mode.ksh as EXFAIL for now.Mark Johnston2017-12-151-0/+3
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=326878
* Actually add the -x setenv test Makefile, missed in r326499.Mark Johnston2017-12-081-0/+30
| | | | | | | X-MFC with: r326499 Notes: svn path=/head/; revision=326705
* Complete support for dtrace's -x setenv option.Mark Johnston2017-12-033-2/+1
| | | | | | | | | | | | | | This allows one to override the environment for processes created with dtrace -c. By default, the environment is inherited. This support was originally merged from illumos in r249367 but was lost when the commit was later reverted and then brought back piecemeal. Reported by: Samuel Lepetit <slepetit@apple.com> MFC after: 2 weeks Notes: svn path=/head/; revision=326499
* Revert r326181 for now.Mark Johnston2017-11-274-4/+2
| | | | | | | | | We can't link an executable using -m32 until the lib32 phase of a buildworld, though the build works fine when executing make from cddl/usr.sbin/dtrace/tests. Some other solution will need to be found. Notes: svn path=/head/; revision=326285
* Compile one of the uctf test programs with -m32.Mark Johnston2017-11-244-2/+4
| | | | | | | | | The err.user64mode.ksh test expects it to run as a 32-bit process. MFC after: 1 week Notes: svn path=/head/; revision=326181
* Annotate pragma/err.invalidlibdep.ksh as EXFAIL.Mark Johnston2017-11-221-0/+5
| | | | | | | | | | | | | | The test creates a D library with a "depends_on library" pragma referencing a non-existent library, and expects compilation to fail. However, as far as I can tell, libdtrace is supposed simply abort compilation of the library in this case, and continue. This behaviour is desirable when adding libraries which depend on optional KLDs, for example. MFC after: 1 week Notes: svn path=/head/; revision=326096
* Annotate usdt/tst.eliminate.ksh as EXFAIL.Mark Johnston2017-11-211-0/+3
| | | | | | | | | It appears to depend on some behaviour specific to the Sun link editor. MFC after: 1 week Notes: svn path=/head/; revision=326063
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-3114-13/+5
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* DIRDEPS_BUILD: Connect new directories.Bryan Drewery2017-10-311-0/+11
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325187
* Add a regression test for r322773.Mark Johnston2017-08-211-0/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=322774
* The test case common.funcs.t_dtrace_contrib.tst_basename_d generates aLi-Wen Hsu2017-07-251-0/+8
| | | | | | | | | | | | verifying script which needs being run to complete the test. While here, add missing shebang. Reviewed by: gnn, markj, ngie Differential Revision: https://reviews.freebsd.org/D11716 Notes: svn path=/head/; revision=321472
* Add a simple script which calls open(2) and others to generate events forLi-Wen Hsu2017-07-251-0/+1
| | | | | | | | | | | | | testing. This test times-out on a quiet system because there is nobody triggers syscall::open:entry or syscall::: probe while test execution. Reviewed by: gnn, markj (earlier version) Differential Revision: https://reviews.freebsd.org/D11671 Notes: svn path=/head/; revision=321465
* Add a simple program which calls sigtimedwait(2) to generate events for testingLi-Wen Hsu2017-07-251-0/+1
| | | | | | | | | | | This test timeout on a quiet system because there is nobody triggers 'syscall::*wait*:entry' probe while test execution. Reviewed by: gnn, markj, ngie Differential Revision: https://reviews.freebsd.org/D11668 Notes: svn path=/head/; revision=321464
* Override the locale so that file lists get a consistent sort order.Mark Johnston2017-06-101-0/+2
| | | | | | | | Reported by: avg MFC after: 1 week Notes: svn path=/head/; revision=319792
* follow up to r319746: add the new test files to the make fileAndriy Gapon2017-06-101-0/+2
| | | | | | | | | Reported by: markj MFC after: 2 days X-MFC with: r319746 Notes: svn path=/head/; revision=319769
* Add a little helper program for tst.exitcore.ksh.Mark Johnston2017-05-221-0/+1
| | | | | | | | | | | sleep(1) is capsicumized, which means that we cannot rely on it to dump core as required by the test. MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318680
* Remove the EXFAIL annotation for tests which pass as of r309596.Mark Johnston2017-05-191-5/+0
| | | | | | | | Reported by: bdrewery Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318508
* Skip a ustack test that triggers an assertion on INVARIANTS kernels.Mark Johnston2016-12-141-0/+3
| | | | | | | | | Reported by: ngie Sponsored by: Dell EMC Isilon X-MFC-With: r309698 Notes: svn path=/head/; revision=310085
* err.D_PROC_CREATEFAIL.many.d passes, so remove the EFAIL annotation.Mark Johnston2016-12-081-3/+0
| | | | | | | | MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=309718
* Run DTrace test scripts with "tst" set to the test script file name.Mark Johnston2016-12-071-1/+1
| | | | | | | | MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=309698