aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/tools/ctf
Commit message (Collapse)AuthorAgeFilesLines
* ctfmerge: demote "No ctf sections found" to a warningEd Maste2024-02-141-8/+2
| | | | | | | | | | | | | | | | | | | | If there are no CTF sections then ctfmerge just has nothing to do; it should not be an error. Note that ctfmerge has an option to require CTF: -t Make sure that all object files have a CTF section. Before this change, this option explicitly exited without error if none of the object files have CTF sections, with the comment: If we're verifying that C files have CTF, it's safe to assume that in this case, we're building only from assembly inputs. PR: 276930 Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D43878
* ctfmerge: Remove function cast of strcompare() for qsort()Minsoo Choo2024-02-031-1/+1
| | | | | | Reviewed by: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43715
* ctfconvert: Handle DW_AT_data_bit_offsetMark Johnston2024-01-021-1/+3
| | | | | | | | | This attribute is new in DWARF 4 and supersedes DW_AT_bit_offset. PR: 276059 Reported by: rscheff Tested by: rscheff MFC after: 1 week
* ctfconvert: Integer encoding types are unsignedMark Johnston2023-06-281-3/+3
| | | | | | | | Before this change, encodings in the user-defined range were being sign-extended. MFC after: 1 week Sponsored by: Innovate UK
* ctf: Remove unused function prototype for getpname()Zhenlei Huang2023-02-261-2/+0
| | | | | | | | This function prototype should have been removed along with the implementation. Fixes: 3dd552426409 ctfdump: Use getprogname() MFC after: 1 day
* ctfdump: Use getprogname()Zhenlei Huang2023-02-232-25/+1
| | | | | | | | Also remove no longer used function `getpname()`. Reviewed by: markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D38740
* ctfconvert: Actually use the asprintf() helperMark Johnston2022-08-031-1/+1
| | | | Fixes: 1165fc9a5266 ("ctfconvert: Give bitfield types names distinct from the base type")
* ctfconvert: Give bitfield types names distinct from the base typeMark Johnston2022-08-033-3/+19
| | | | | | | | | | | | | | | | | | CTF integers have an explicit width and so can be used to represent bitfields. Bitfield types emitted by ctfconvert(1) share the name of the base integer type, so a struct field with type "unsigned int : 15" will have a type named "unsigned int". To avoid ambiguity when looking up types by name, add a suffix to names of bitfield types to distinguish them from the base type. Then, if ctfmerge happens to order bitfield types before the corresponding base type in a CTF file, a name lookup will return the base type, which is always going to be the desired behaviour. PR: 265403 Reported by: cy MFC after: 1 week Sponsored by: The FreeBSD Foundation
* ctfdump: Remove definitions of warn() and vwarn()Mark Johnston2022-04-213-31/+2
| | | | | | | | | | | The presence of the latter causes a link error when building a statically linked ctfdump(1) because libc defines the same symbol. libc's warn() is defined as a weak symbol and so does not cause the same problem, but let's just use libc's version. Reported by: stephane rochoy <stephane.rochoy@stormshield.eu> MFC after: 1 week Sponsored by: The FreeBSD Foundation
* zfs: merge openzfs/zfs@a86e08941 (master) into mainMartin Matuska2022-03-081-2/+2
| | | | | | | | | | | | | | | | | | | | Notable upstream pull request merges: #9078: log xattr=sa create/remove/update to ZIL #11919: Cross-platform xattr user namespace compatibility #13014: Report dnodes with faulty bonuslen #13016: FreeBSD: Fix zvol_cdev_open locking #13019: spl: Don't check FreeBSD rwlocks for double initialization #13027: Fix clearing set-uid and set-gid bits on a file when replying a write #13031: Add enumerated vdev names to 'zpool iostat -v' and 'zpool list -v' #13074: Enable encrypted raw sending to pools with greater ashift #13076: Receive checks should allow unencrypted child datasets #13098: Avoid dirtying the final TXGs when exporting a pool #13172: Fix ENOSPC when unlinking multiple files from full pool Obtained from: OpenZFS OpenZFS commit: a86e089415679cf1b98eb424a159bb36aa2c19e3
* ctf: Avoid passing a caddr_t to roundup2()Mark Johnston2022-03-071-1/+1
| | | | | | | For some reason I can't reproduce this locally, but Jenkins complains. Reported by: Jenkins Fixes: bdf290cd3e1a ("ctf: Add v3 support to CTF tools, ctf{convert,dump,merge}")
* ctf: Fix a -Wunused-but-set-variable warningMark Johnston2022-03-071-2/+0
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* ctf: Add v3 support to CTF tools, ctf{convert,dump,merge}Mark Johnston2022-03-073-271/+472
| | | | | | | | | ctfdump handles v2 and v3. ctfconvert now emits only CTFv3, whereas ctfmerge can merge v2 and v3 containers into v3 containers. MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34364
* ctf: Import ctf.h from OpenBSDMark Johnston2022-03-071-1/+1
| | | | | | | | | | | | | | | | | Use it instead of the existing ctf.h from OpenSolaris. This makes it easier to use CTF in the core kernel, and to extend the CTF format to support wider type IDs. The imported ctf.h is modified to depend only on _types.h, and also to provide macros which use the "parent" bit of a type ID to refer to types in a parent CTF container. No functional change intended. Reviewed by: Domagoj Stolfa, emaste MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34358
* ctfconvert: Rip out STABS supportMark Johnston2022-02-106-1825/+0
| | | | | | | | | It is unused on FreeBSD and complicates some efforts to modify the CTF format to permit wider type IDs, so remove it. No functional change intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation
* ctfconvert: Handle arrays of empty structsMark Johnston2021-12-311-2/+10
| | | | | | | | | | | Members with such a type will legitimately have a size of zero, so don't emit a warning. PR: 260818 Reviewed by: bz MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33700
* Merge OpenZFS support in to HEAD.Matt Macy2020-08-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The primary benefit is maintaining a completely shared code base with the community allowing FreeBSD to receive new features sooner and with less effort. I would advise against doing 'zpool upgrade' or creating indispensable pools using new features until this change has had a month+ to soak. Work on merging FreeBSD support in to what was at the time "ZFS on Linux" began in August 2018. I first publicly proposed transitioning FreeBSD to (new) OpenZFS on December 18th, 2018. FreeBSD support in OpenZFS was finally completed in December 2019. A CFT for downstreaming OpenZFS support in to FreeBSD was first issued on July 8th. All issues that were reported have been addressed or, for a couple of less critical matters there are pull requests in progress with OpenZFS. iXsystems has tested and dogfooded extensively internally. The TrueNAS 12 release is based on OpenZFS with some additional features that have not yet made it upstream. Improvements include: project quotas, encrypted datasets, allocation classes, vectorized raidz, vectorized checksums, various command line improvements, zstd compression. Thanks to those who have helped along the way: Ryan Moeller, Allan Jude, Zack Welch, and many others. Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D25872 Notes: svn path=/head/; revision=364746
* Fix cddl tools bootstrapping on macOS and LinuxAlex Richardson2020-08-071-0/+10
| | | | | | | | Reviewed By: brooks Differential Revision: https://reviews.freebsd.org/D25979 Notes: svn path=/head/; revision=364022
* ctfmerge: Fix missing pthread_cond_init()Alex Richardson2020-08-061-0/+1
| | | | | | | | | | | | | This does not appear to matter on FreeBSD or Linux, but when building an amd64 kernel on macOS I was seeing infinite loops in ctfmerge. It turns out the loop in wip_save_work() was looping forever due to pthread_cond_wait() always returning -EINVAL. Reviewed By: markj, brooks Differential Revision: https://reviews.freebsd.org/D25973 Notes: svn path=/head/; revision=363991
* Fix a Wvoid-pointer-to-enum-cast warning missed in r359978.Brooks Davis2020-07-061-1/+1
| | | | | | | | | | | | | | | This pattern is used in callbacks with void * data arguments and seems both relatively uncommon and relatively harmless. Silence the warning by casting through uintptr_t. This warning is on by default in Clang 11. MFC after: 3 days Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24425 Notes: svn path=/head/; revision=362979
* Revert r360445Bryan Drewery2020-04-282-8/+10
| | | | | | | | I did not intend to commit this yet as more work is needed for non-amd64 kernels. Notes: svn path=/head/; revision=360448
* ctfmerge: Assert that there is enough room for types.Bryan Drewery2020-04-282-10/+8
| | | | | | | | Sponsord by: Dell EMC Differential Revision: https://reviews.freebsd.org/D24537 Notes: svn path=/head/; revision=360445
* Increase ctfconvert buffer sizeLeandro Lupori2019-02-251-1/+1
| | | | | | | | Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D19353 Notes: svn path=/head/; revision=344534
* Process CUs with a language attribute of DW_LANG_Mips_Assembler.Mark Johnston2018-06-111-1/+2
| | | | | | | | | | | At the moment ctfconvert(1) does not do much with such CUs, but that may not be true in the future, and we run ctfconvert on several assembly files during the build. X-MFC with: r334883 Notes: svn path=/head/; revision=334961
* Don't process DWARF generated from non-C/C++ code.Mark Johnston2018-06-091-3/+22
| | | | | | | | | | | | ctfconvert(1) is not designed to handle DWARF generated from such code, and will generally fail in non-obvious ways. Use an explicit check to help catch such potential failures. Reported by: Johannes Lundberg <johalun0@gmail.com> MFC after: 2 weeks Notes: svn path=/head/; revision=334883
* ctf dwarf: don't report "no dwarf entry" as if it were an errorMatt Macy2018-05-191-3/+6
| | | | Notes: svn path=/head/; revision=333885
* ctfconvert: silence useless enum has too many values warningMatt Macy2018-05-191-2/+0
| | | | Notes: svn path=/head/; revision=333872
* ctfconvert: Fix minor memory leaks in STABS parserConrad Meyer2018-03-271-1/+5
| | | | | | | | | | | In an error case, free leaked objects. Does anything use STABS anymore? Probably not. Reported by: Coverity Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=331656
* ctfconvert/ctfmerge: Fix a memory leak enumerating DWARF filesConrad Meyer2018-03-261-0/+1
| | | | | | | | Reported by: Coverity Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=331600
* Revert r253678, r253661:Pedro F. Giffuni2016-12-034-55/+6
| | | | | | | | | | | | | | | | Fix a segfault in ctfmerge(1) due to a bug in GCC. The change was correct and the bug real, but upstream didn't adopt it and we want to remain in sync. When/if upstream does something about it we can bring their version. The bug in question was fixed in GCC 4.9 which is now the default in FreeBSD's ports. Our native gcc-4.2, which is still in use in some Tier-2 platforms also has a workaround so no end-user should be harmed by the revert. Notes: svn path=/head/; revision=309490
* Fix handling of forward enum declarations in the CTF tools.Mark Johnston2016-08-132-1/+7
| | | | | | | | Reported by: mmacy MFC after: 2 weeks Notes: svn path=/head/; revision=304055
* Remove a dead local variable, missed in r274565.Mark Johnston2016-01-141-2/+0
| | | | | | | | MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=293861
* DWARF emitted by clang 3.7 encodes array sizes using the DW_AT_countMark Johnston2015-10-241-0/+4
| | | | | | | | | | | attribute rather than DW_AT_upper_bound. Teach ctfconvert about this so that array type sizes are encoded correctly. PR: 203772 MFC after: 1 week Notes: svn path=/head/; revision=289866
* Re-apply r274569. It was reverted in r276848 since that appeared to fixMark Johnston2015-08-281-1/+1
| | | | | | | | | | | | | | | | | | some ctfmerge crashes that started to occur on i386 weeks after r274569 was committed. Some later investigation indicated that the crashes were caused by malformed CTF info that led to a stack overflow. The issue with CTF info in i386 kernels seems to have been resolved by r261246, which updated libdwarf and libelf. r274569 fixes a bug which caused duplicate types to appear in the kernel's CTF info. This duplication generally does not cause problems when using DTrace, but makes it easier to hit the limit of 2^15 - 1 distinct type definitions in a CTF container. MFC after: 2 weeks Notes: svn path=/head/; revision=287234
* Add a missing format string argument.Mark Johnston2015-03-151-1/+1
| | | | | | | | PR: 197391 MFC after: 3 days Notes: svn path=/head/; revision=280125
* MFV r279822:Mark Johnston2015-03-101-2/+0
| | | | | | | | | | | | | | This merge is effectively a no-op since parts of it are already present in FreeBSD, and the rest is incorrect since gelf_newehdr(3) and gelf_newphdr(3) return pointers on FreeBSD rather than integers. Illumos issue: 5589 improper use of NULL in tools/ctf MFC after: 3 days Notes: svn path=/head/; revision=279861
* Initial version of DTrace on ARM32.George V. Neville-Neil2015-02-101-2/+2
| | | | | | | | Submitted by: Howard Su based on work by Oleksandr Tymoshenko Reviewed by: ian, andrew, rpaulo, markj Notes: svn path=/head/; revision=278529
* Mechanically convert cddl sun #ifdef's to illumosSteven Hartland2015-01-178-20/+20
| | | | | | | | | | | | | | | 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
* Revert r274569. It seems to be causing a crash when merging CTF data forMark Johnston2015-01-081-1/+1
| | | | | | | | | recent i386 GENERIC kernels. Reported by: David Wolfskill Notes: svn path=/head/; revision=276848
* MFV r275536:Xin LI2014-12-061-4/+4
| | | | | | | | | | Illumos issue: 3363 Mark non-returning functions in ctftools MFC after: 2 weeks Notes: svn path=/head/; revision=275563
* Only compare visitation counters if they've both been set for the currentMark Johnston2014-11-161-1/+1
| | | | | | | | | | | type graph walk. Reviewed by: Robert Mustacchi <rm@joyent.com> MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=274569
* Remove an incorrect optimization. The type IDs of each member of a struct orMark Johnston2014-11-161-11/+3
| | | | | | | | | | | | union must be checked when determine whether two types are equivalent. This bug could cause ctfmerge(1) to incorrectly merge distinct types. Reviewed by: Robert Mustacchi <rm@joyent.com> MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=274565
* Fix a couple of bugs around the handling of structs and unions of size zero.Mark Johnston2014-11-161-2/+8
| | | | | | | | | | | | These would cause ctfconvert(1) to return an error when attempting to resolve valid C types. Reviewed by: Robert Mustacchi <rm@joyent.com> MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=274564
* Only declare `bysz' variable under little endian archs.Kai Wang2014-01-291-1/+4
| | | | Notes: svn path=/head/; revision=261259
* Simplify DWARF version check.Kai Wang2014-01-251-8/+2
| | | | | | | Submitted by: emaste Notes: svn path=/projects/elftoolchain/; revision=261154
* Let ctfconvert accept DWARF version 3 and 4.Kai Wang2014-01-221-3/+6
| | | | Notes: svn path=/projects/elftoolchain/; revision=261025
* Clang 3.4 will sometimes emit DIE for struct/union member beforeKai Wang2014-01-201-3/+21
| | | | | | | | | | | | | | | | | | emitting the DIE for the type of that member. ctfconvert can not handle this properly and will calculate a wrong member bit offset. Same struct/union type from different .o file will be treated as different types when their member bit offsets are different, and gets added/merged multiple times. This will in turn cause many other structs/pointers/typedefs that refer to the duplicated struct/union gets added/merged multiple times and eventually causes numerous duplicated CTF types in the kernel.debug file. The simple workaround here is to make use of DW_AT_byte_size attribute of the member DIE to calculate the bits occupied by the member's type, without actually resolving the type. Notes: svn path=/projects/elftoolchain/; revision=260897
* * Make die_mem_offset() be able to handle DW_AT_data_member_locationKai Wang2014-01-191-9/+57
| | | | | | | | | | attributes generated by Clang 3.4. * Document how different compilers generate DW_AT_data_member_location attributes differently. * Document the quirks about DW_FORM_data[48]. Notes: svn path=/projects/elftoolchain/; revision=260880
* We should not set the unnamed DIE's name to "__anon__" since that willKai Wang2014-01-171-1/+1
| | | | | | | | | | bring back a known issue with DTrace regarding type name comparison. Instead, we can set the name to an empty string. Pointed out by: avg Notes: svn path=/projects/elftoolchain/; revision=260809
* If function die_name() finds a DIE without a name, set its name toKai Wang2014-01-161-0/+2
| | | | | | | | | | | "__anon__". This hack is used to workaround a issue that compilers like GCC could generate DW_TAG_base_type DIE without a name. Note that we didn't need this before because the old libdwarf internally set all the unnamed DIE's name to "__anon__". Notes: svn path=/projects/elftoolchain/; revision=260797