summaryrefslogtreecommitdiffstats
path: root/cddl/contrib/opensolaris/lib/libdtrace
Commit message (Collapse)AuthorAgeFilesLines
* MFC r286169:markj2015-08-271-5/+17
| | | | | | Perform bounds checking when constructing a format string. PR: 201657
* MFC r283025:markj2015-06-071-0/+1
| | | | | | | | | | As dtrace(1) processes D libraries under /usr/lib/dtrace, the compiler may 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 r280882:markj2015-04-121-2/+2
| | | | Fix a misparenthesization that could cause a crash if TERM is not set.
* MFC r278114:markj2015-04-121-0/+3
| | | | | | libdtrace: Let the standard deviation of the empty set be 0. PR: 197260
* MFC r276250:markj2015-01-061-1/+4
| | | | | | | DOF tables are aligned according to the DOF section's alignment constraint, so take this into account when iterating over DOF tables. PR: 195555
* MFC r272671:markj2014-12-261-0/+23
| | | | | | | | Treat D keywords as identifiers in certain postfix expressions. This allows one to, for example, access the "provider" field of a struct g_consumer, even though "provider" is a D keyword. PR: 169657
* MFC r275011:markj2014-12-261-3/+3
| | | | | | | | The module load address always needs to be included when setting the dm_*_va 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.
* MFC r271695:markj2014-12-051-2/+2
| | | | Fix some incorrect endianness checks.
* MFC r258902:markj2014-10-241-8/+0
| | | | | The uaddr, ufunc, umod and usym functions all seem to work as expected on FreeBSD, so stop hiding them behind a "#if defined(sun)".
* MFC r269524:markj2014-08-203-11/+14
| | | | | | Preserve the errno value of an ioctl before calling free(3). Previously, errno was very occasionally being clobbered, resulting in a bogus error from dt_consume() and thus an error from dtrace(1).
* MFC r267875:pfg2014-08-161-2/+7
| | | | | | | | | | | | 4251 libdtrace leaks open file handles Illumos commit: 93ed8d0d4b068b95d0bb50d57bb854df462a8485 (partial) Reference: https://www.illumos.org/issues/4251 Discussed with: Robert Mustacchi Obtained from: Illumos
* MFC r257877:markj2014-08-141-3/+1
| | | | | | | | | | | | | Don't try to use the 32-bit drti.o unless the data model is explicitly set to ILP32. Otherwise dtrace -G will attempt to use it on amd64 if it can't determine which data model to use, which happens when -64 is omitted and no object files are provided, e.g. with # dtrace -G -n BEGIN This would result in a linker error, but now works properly. Also remove an unnecessary #ifdef.
* MFC r269776rpaulo2014-08-131-52/+0
| | | | Remove the BROKEN_LIBELF section.
* MFC r265631:markj2014-08-081-1/+1
| | | | | | | | | | Re-apply r248644. This fixes an annoying problem which caused dtrace -c to fail to attach to stripped binaries. With the _r_debug_postinit symbol, dtrace(1) can now set a breakpoint in the victim process after it has registered its DOF table(s) with the kernel. r_debug_state cannot be used for this purpose since it is called before DOF is made available, in which case dtrace(1) cannot create USDT probes before the program begins execution.
* MFC r256571:markj2014-08-041-0/+4
| | | | | | | | | | | | | | | | | | | | | | | Add a function, memstr, which can be used to convert a buffer of null-separated strings to a single string. This can be used to print the full arguments of a process using execsnoop (from the DTrace toolkit) or with the following one-liner: dtrace -n 'syscall::execve:return {trace(curpsinfo->pr_psargs);}' Note that this relies on the process arguments being cached via the struct proc, which means that it will not work for argvs longer than kern.ps_arg_cache_limit. However, the following rather non-portable script can be used to extract any argv at exec time: fbt::kern_execve:entry { printf("%s", memstr(args[1]->begin_argv, ' ', args[1]->begin_envv - args[1]->begin_argv)); } The debug.dtrace.memstr_max sysctl limits the maximum argument size to memstr().
* MFC r264486:markj2014-07-291-0/+5
| | | | | Use the correct format specifiers for wide characters and strings of wide characters.
* MFC r262669:markj2014-07-291-30/+58
| | | | | | | | | | When our linker merges .SUNW_dof sections from multiple files, it simply concatenates the DOF tables into one section. Previously, the USDT init code in drti.o would only look at the first table in the DOF section; with this change, it iterates over all the tables, passing each DOF table to the kernel. PR: 186821
* MFC 267929, 267937, 267939, 267940, 267941, 267942, 267987, 268006:rpaulo2014-07-1225-152/+1456
| | | | | | | | | | | | | | | | 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 4477 DTrace should speak JSON Add stubs for CTF functions which are not yet implemented. 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 4471 DTrace count() with histogram 4472 DTrace full width distribution histograms 4473 DTrace frequency trails
* MFC r262329:markj2014-05-251-27/+0
| | | | | | | | | | Define the KM_NORMALPRI flag for kmem_alloc(), as it is used in some upstream DTrace code. MFC r262330: 1452 DTrace buffer autoscaling should be less violent illumos/illumos-gate@6fb4854bed54ce82bd8610896b64ddebcd4af706
* MFC r264040:pfg2014-05-023-8/+23
| | | | | | | | | | | | | 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: 4a20ab41aadcb81c53e72fc65886e964e9add59 Reference: https://www.illumos.org/issues/4248 https://www.illumos.org/issues/4249 Obtained from: Illumos
* MFC r261122: dtrace: remove unexplained 16MB limitation from dt_alloc/dt_zallocavg2014-02-171-10/+0
|
* MFC r260051:markj2014-02-171-4/+11
| | | | | | When clearing relocations to __dtrace* symbols, handle both SHT_REL and SHT_RELA sections properly instead of assuming that the relocation section is of type SHT_REL.
* MFC r256543,r259245,r259421,r259668,r259674jhibbits2014-01-152-12/+215
| | | | | | | | | | | | | | | | | | | r256543: Add fasttrap for PowerPC. This is the last piece of the DTrace/ppc puzzle. It's incomplete, it doesn't contain full instruction emulation, but it should be sufficient for most cases. r259245,r259421: (FBT) FBT now does work fully on PowerPC. Save r3 before using it for the trap check, else we end up saving the new r3, containing the trap instruction encoding (0x7c810808), and restoring it back with the frame on return. This caused it to panic on my ppc32 machine. r259668,r259674: Fix a typo in the FBT code.
* Load the dtraceall module if /dev/dtrace/dtrace doesn't exist.rpaulo2013-08-101-1/+11
| | | | MFC after: 3 days
* DTrace: re-apply r249426 now that the underlying issues have been solved.pfg2013-07-283-5/+9
| | | | | | | | | | | | | | | | | | | | 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-2810-125/+304
| | | | | | | | | | | | | | | | | | | | | | | 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
* Remove a block of code that was not intended to be part of the previousmarkj2013-05-201-7/+0
| | | | | | revision. X-MFC with: r250812
* Re-introduce another part of r249367. This commit fixes a register leak inmarkj2013-05-196-97/+157
| | | | | | | | | | | | 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
* Bring back part of r249367 by adding DTrace's temporal option, which allowsmarkj2013-05-126-152/+619
| | | | | | | | | | | | | | | | | | | | | | | | 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
* revert r248644 because of the regression for usdt probesavg2013-04-251-1/+1
| | | | | | | | | | | | | | | USDT probes are advertised to kernel by initialization code with atrribute((constructor))). It seems that on Solaris the .init-ish code of the main object is executed before RD_PREINIT point is hit. On FreeBSD that is not the case. And because on FreeBSD there is no other well-defined point between RD_PREINIT and main() we have to parse a DTrace script when main is hit, for time being. A footnote: currently we actually post RD_POSTINIT event, but that's a bug because the event is triggered by hitting r_debug_state which happens before any init code is executed. Reported by: markj
* DTrace: Revert r249426pfg2013-04-173-9/+5
| | | | | | This change actually depends on r249367 which had to be reverted Pointy Hat: pfg
* DTrace: Revert r249367pfg2013-04-1720-1144/+388
| | | | | | | | | | | | | | | | | | | | | | 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-161-4/+47
| | | | | | | | | | | | | | | | 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-123-5/+9
| | | | | | | | | | | | | | | | | | | | 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-1120-388/+1144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Commit a patch that fixes a problem in the #pragma statement when searchinggnn2013-03-281-3/+27
| | | | | | | | | for and loading dependent modules. This addresses a bug seen with io.d where it was being doubly included. PR: 171678 Submitted by: Mark Johnston MFC after: 2 weeks
* Dtrace: Add SUN MDB-like type-aware print() action.pfg2013-03-2510-70/+889
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-251-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | 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-10/+62
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* dtrace: ensure that we can always catch a process (e.g. when -c is used)avg2013-03-231-1/+1
| | | | | | | | | It is not guaranteed that a program has a symbol table entry for main and thus that it would be possible to set a breakpoint on it. Reviewed by: rpaulo Discussed with: rpaulo MFC after: 13 days
* Implement DTrace for PowerPC. This includes both 32-bit and 64-bit.jhibbits2012-11-071-0/+75
| | | | | | | | | | | 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
* Make sure that each va_start has one and only one matching va_end,kevlo2012-09-281-0/+1
| | | | especially in error cases.
* When we return with an error we cannot unlock the mutex, becausegnn2012-08-011-1/+2
| | | | | | | it's been freed. Protect against that, hopefully unlikely, case. Reviewed by: rpaulo MFC after: 2 weeks
* Dtrace: improve handling of library paths.pfg2012-07-172-22/+102
| | | | | | | | | | | | | | | | | | | | | 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
* Use libc's strndup() instead of Dtrace's reimplementation.pfg2012-07-152-24/+3
| | | | | | | | Corresponds partially to OpenSolaris change: PSARC 2010/299 GNU/Linux/BSD compatibility functions 6901783 strndup would be nice MFC after: 2 weeks
* Merge illumos commit 13455:7205f7794835pfg2012-07-141-1/+8
| | | | | | | | | | 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
* Fix clang warning, introduced in the recent dtrace import.dim2012-07-031-1/+1
| | | | MFC after: 3 days
* Safer fix for building with Clang.pfg2012-06-281-1/+1
| | | | | | | error: format specifies type 'long long' but the argument has type 'int64_t' (aka 'long') Reported by: Ed Maste
* Fix build with Clang.pfg2012-06-281-1/+1
| | | | | | | error: format specifies type 'long long' but the argument has type 'int64_t' (aka 'long') Reported by: Ed Maste
* Bring llquantize support into Dtrace.pfg2012-06-278-5/+398
| | | | | | | | | | | | | | | | | | 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