aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/common
Commit message (Collapse)AuthorAgeFilesLines
* When copying types from one CTF container to another, ensure that weJonathan T. Looney2020-11-201-2/+2
| | | | | | | | | | | | | | | | | | | | encode 0-length (i.e. "") structure and union member names as offset 0. This ensures that we don't confuse other parts of the CTF code which expect this encoding. This resolves a Dtrace error resolving members of anonymous structs/unions within the (struct mbuf) type which some users were seeing after r366908. While here, update the code in ctf_add_generic() to encode 0-length type names as offset 0. Reviewed by: markj MFC after: 2 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D27246 Notes: svn path=/head/; revision=367905
* When copying types from one CTF container to another, ensure that weJonathan T. Looney2020-11-171-1/+22
| | | | | | | | | | | | | | | | | | | | always copy intrinsic data types before copying bitfields which are based on those types. This ensures the type ordering in the destination CTF container matches the assumption made elsewhere in the CTF code that instrinsic data types will always appear before bitfields based on those types. This resolves the following error message some users have seen after r366908: "/usr/lib/dtrace/ipfw.d", line 121: failed to copy type of 'ip6p': Conflicting type is already defined Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D27213 Notes: svn path=/head/; revision=367763
* libctf: Don't construct pointers to out of bounds array offsetsConrad Meyer2018-03-261-3/+5
| | | | | | | | | | | | Just attempting to do the pointer arithmetic is undefined behavior. No functional change intended. Reported by: Coverity Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=331595
* Recursively enumerate anonymous structs and unions in ctf_member_info().Mark Johnston2016-08-301-7/+24
| | | | | | | | | | | | Previously, ctf_member_info() would ignore members belonging to an anonymous struct or union. This made it impossible to, for example, trace the m_next field of an mbuf using DTrace. Reported and tested by: gallatin MFC after: 2 weeks Notes: svn path=/head/; revision=305055
* remove an extra copy of avl.c from illumos contrib codeAndriy Gapon2015-09-281-1059/+0
| | | | | | | MFC after: 20 days Notes: svn path=/head/; revision=288337
* ctf_add_type(): when looking up an integer or floating point type in theMark Johnston2015-05-101-4/+17
| | | | | | | | | | | | | | | | | | list of pending dynamic type definitions, a match on the type name is not sufficient - we need to compare the type encodings as well. For example, bitfields have their own distinct type definitions which share the name of the underlying integer type, and these types aren't generally interchangeable. This bug was causing the following libdtrace error when attempting to trace the th_flags member of a struct tcphdr: cg: bad field: off 104 type <32877> bits 539620016 Reported by: rwatson MFC after: 3 weeks Notes: svn path=/head/; revision=282739
* When copying a type from a source CTF container to a destination container,Mark Johnston2015-03-111-4/+7
| | | | | | | | | | | | | | | | | | | | | ctf_add_type() first performs a by-name lookup of the type in the destination container. If this lookup returns a forward declaration for an enum, struct, or union, reset dst_type back to CTF_ERR, indicating that the source type is not in fact present in the destination container. This ensures that ctf_add_type() will also search the destination container's dynamic type list for the source type. Without this change, a pair of mutually recursive struct definitions could cause infinite recursion in ctf_add_type() if the destination container only contained forward declarations for the struct types: ctf_add_type() recursively calls itself on each struct member's type, and the forward declarations meant that the dynamic type list search would be skipped. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=279869
* CTF containers use the ctf_dtoldid field as a threshold type index whichMark Johnston2015-03-101-2/+2
| | | | | | | | | | | | | | | | | | | | indicates the range of type indices which have been committed to the container by ctf_update(). However, the top bit of the dtd_type field is not part of the type index; rather, it is a flag used to indicate that the corresponding CTF container is a parent. This is why the maximum CTF type index is 2^15 - 1 rather than 2^16 - 1. Therefore, this flag must be masked off (using the CTF_TYPE_TO_INDEX macro) when comparing a type index with the ctf_dtoldid field of a container. This bug was causing libctf to erroneously free committed type definitions in ctf_discard(). libdtrace holds some references to such types, resulting in a use-after-free. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=279864
* ctf_discard(): fetch the next list element before restarting the loop. IfMark Johnston2015-03-101-1/+1
| | | | | | | | | | | | | we end up skipping a dynamic type because it has already been committed to the container, we would previously either set the loop variable to an uninitialized local variable, or set it to itself, resulting in an infinite loop. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=279862
* Mechanically convert cddl sun #ifdef's to illumosSteven Hartland2015-01-171-1/+1
| | | | | | | | | | | | | | | 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
* MFV r269223:Xin LI2014-07-291-5/+34
| | | | | | | | | | | | Change dn->dn_dbufs from linked list to AVL tree. Illumos issues: 4873 zvol unmap calls can take a very long time for larger datasets MFC after: 2 weeks Notes: svn path=/head/; revision=269229
* MFV illumosRui Paulo2014-06-262-9/+120
| | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=267941
* MFV illumosRui Paulo2014-06-261-0/+79
| | | | | | | | | 4477 DTrace should speak JSON MFC after: 2 weeks Notes: svn path=/head/; revision=267937
* Quiesce warning assigning to void * from const ctf_header_t * by explicity ↵Sean Bruno2013-11-041-1/+1
| | | | | | | | | | | casting to void * before assignment. Submitted as Illumos issue 4287 Notes: svn path=/head/; revision=257657
* MFV r254422:Xin LI2013-08-234-16/+204
| | | | | | | | | | | Illumos DTrace issues: 3089 want ::typedef 3094 libctf should support removing a dynamic type 3095 libctf does not validate arrays correctly 3096 libctf does not validate function types correctly Notes: svn path=/head/; revision=254744
* MFV OpenSolaris DTrace userland bits.Rui Paulo2010-08-021-5/+66
| | | | Notes: svn path=/head/; revision=210767
* This commit was generated by cvs2svn to compensate for changes in r178525,John Birrell2008-04-2511-0/+5547
which included commits to RCS files with non-trunk default branches. Notes: svn path=/head/; revision=178526