summaryrefslogtreecommitdiffstats
path: root/cddl/contrib/opensolaris/lib/libdtrace/common
Commit message (Collapse)AuthorAgeFilesLines
* 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-1719-1138/+387
| | | | | | | | | | | | | | | | | | | | | | 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-1119-387/+1138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* 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
* Implement the D "cpu" variable, which returns curcpu. I have chosen notrstone2012-04-261-0/+6
| | | | | | | | | | | to follow the example of OpenSolaris and its descendants, which implemented cpu as an inline that took a value out of curthread. At certain points in the FreeBSD scheduler curthread->td_oncpu will no longer be valid (in particukar, just before the thread gets descheduled) so instead I have implemented this as its own built-in variable. Sponsored by: Sandvine Inc. MFC after: 1 week
* Change SIGUSR1 to SIGTHR to properly wake up a process that is beinggnn2012-04-131-1/+1
| | | | | | | traced. The use of SIGUSR1 caused traced processes (those attached to with dtrace -p) to exit when dtrace exited. MFC in: 1 week
* In cddl/contrib/opensolaris/lib/libdtrace/common/dt_handle.c, somedim2011-12-161-2/+4
| | | | | | | | uint64_t values are snprintf'd using %llx. On amd64, uint64_t is typedef'd as unsigned long, so cast the values to u_longlong_t, as is done similarly in the rest of the file. MFC after: 1 week
* In cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c, somedim2011-12-161-3/+4
| | | | | | | | uint64_t values are snprintf'd using %llx. On amd64, uint64_t is typedef'd as unsigned long, so cast the values to u_longlong_t, as is done similarly in the rest of the file. MFC after: 1 week
* In cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c, thedim2011-12-151-0/+1
| | | | | | | | | | dt_popc() function assumes that either _ILP32 or _LP64 is defined, otherwise it has no suitable implementation. However, the _ILP32 and _LP64 macros come from isa_defs.h, which is not included in this file. Add the include now, to get the macros defined. MFC after: 1 week
* In cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c, use thedim2011-12-151-1/+1
| | | | | | correct printf format for a key_t (aka long). MFC after: 1 week
* Cast away a clang alignment warning in drti.c's fixsymbol() function.dim2011-12-151-1/+1
| | | | | | | This code only runs on i386 and amd64, so there should be no problems if buf + sec->dofs_offset is not aligned (which is unlikely anyway). MFC after: 1 week
* Do not use #warning to warn about missing implementation of dt_popc(),simon2011-06-191-1/+1
| | | | | | | | | | | but just have a comment that this is broken. This is just a bandaid until somebody can fix this correctly. The code is just a broken as it was before r223262 - now buildworld just doesn't fail. Tested by: i386 + amd64 buildworld With hat: benl co-mentor
* Fix clang warnings.benl2011-06-181-7/+9
| | | | Approved by: philip (mentor)
* Give a chance to the target binary to run the ctors by waiting until itrpaulo2010-09-121-1/+1
| | | | | | has reached main(). This allows plockstat to work. Sponsored by: The FreeBSD Foundation
* Disable debug by default.rpaulo2010-09-111-1/+1
| | | | Sponsored by: The FreeBSD Foundation
* Don't try to map the USDT probes. This is necessary because there is norpaulo2010-09-101-1/+3
| | | | | | __SUNW_dof symbol present in FreeBSD binaries. Sponsored by: The FreeBSD Foundation
* Don't clobber an existing target object file when doing the DTracerpaulo2010-09-091-0/+12
| | | | | | | | | linking process. This is needed because we change the source object files and the second this dtrace -G is run, no probes will be found. This hack allows us to build postgres with DTrace probes enabled. I'll try to find a way to fix this without needing this hack. Sponsored by: The FreeBSD Foundation
* Include <sys/sdt.h> on a generated header.rpaulo2010-09-011-0/+4
| | | | Sponsored by: The FreeBSD Foundation
* Add libdtrace support for tracing userland programs.rpaulo2010-08-2110-212/+451
| | | | | | | | | | | | | | | | | | Summary of changes: * Implement a compatibility shim between Solaris libproc and our libproc and remove several ifdefs because of this. * Port the drti to FreeBSD. * Implement the missing DOODAD sections * Link with libproc and librtld_db * Support for ustack, jstack and uregs (by sson@) * Misc bugfixing When writing the SUWN_dof section, we had to resort to building the ELF file layout by "hand". This is the job of libelf, but our libelf doesn't support this yet. When libelf is fixed, we can remove the code under #ifdef BROKEN_LIBELF. Sponsored by: The FreeBSD Foundation
* Fix another mismerge: bring back the definition of DT_MUTEX_HELD().rpaulo2010-08-021-0/+8
|
* Fix the result of a mismerge. MUTEX_HELD should be DT_MUTEX_HELD() andrpaulo2010-08-022-9/+11
| | | | Plmid() is not supposed to be called.
* MFV OpenSolaris DTrace userland bits.rpaulo2010-08-0217-117/+275
|
* proc_wait() was replaced by proc_wstatus(). Right now this call isrpaulo2010-07-311-1/+1
| | | | | | | useless because userland support is not working on HEAD, but this makes libdtrace compile again. Sponsored by: The FreeBSD Foundation
* Update to the new proc_detach() function.rpaulo2010-07-311-2/+2
| | | | Sponsored by: The FreeBSD Foundation
* dtrace: correctly map sections to addresses in elf object modules (amd64)avg2010-07-232-6/+70
| | | | | | | | | | | | | | | | | | | | | | Unlike for modules with dso type, in elf object modules all the sections have virtual address of zero. So, it is insufficient to add module base address to section virtual address (as recorded in section header) to get section address in kernel memory. Instead, we should apply the same calculations that are performed by kernel loaders (in boot code and in kernel) when they lay out sections in memory. Also, unlike OpenSolaris, the sections are not collapsed into just .text, .data and .bss by module loaders, so we need to take additional care about other sections. Note that in-kernel symbol-to-address mapping worked just fine, e.g. fbt provider could correctly find the functions, etc. It's only in userland that the mapping in both direction worked incorrectly, e.g. in stack() output addresses of functions in kernel modules were not translated to their names. Reviewed by: rpaulo MFC after: 3 weeks
* Unbreak platforms with char unsigned by default. Oddly enough, GCC isn'tmarcel2010-06-201-2/+6
| | | | | satisfied with a simple cast to int in the check against EOF, so the fix is a bit involved by actually having to go through a temporary variable.
* Do not allow EOF token to be put back into input buffer.kan2010-06-181-3/+11
| | | | | | This reimplements previous change from r20930 in more generic way. MFC after: 1 week
* In dtrace lexer, do not unput token if it is EOF.kan2010-06-111-1/+2
| | | | | | | | This is harmless with OpenSolaris fex and yacc, but with FreeBSD causes '\xff' symbol to be physically put into input buffer, causing subsequent syntax error. MFC after: 1 week
* Correct the sense of the "use32" terenary operator so that it usesjhb2009-01-161-5/+1
| | | | | | | | 'lib32' for 32-bit binaries on amd64 and 'lib' for 64-bit binaries. Remove an #ifdef __i386__ that defined use32 to the wrong value on i386 to workaround the bug in the terenary operator. MFC after: 1 month
* Merge latest DTrace changes from Perforce.rodrigc2008-11-056-25/+61
| | | | Approved by: jb
* Mips doesn't have a long double that's different in size from double.imp2008-09-181-1/+1
|
OpenPOWER on IntegriCloud