aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris
Commit message (Collapse)AuthorAgeFilesLines
* Add a missing format string argument.Mark Johnston2015-03-151-1/+1
| | | | | | | | PR: 197391 MFC after: 3 days Notes: svn path=/head/; revision=280125
* 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
* 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
* Use the -shared option to create a shared library.Mark Johnston2015-02-285-8/+8
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=279417
* Remove a leading tab that causes a make(1) error when running the test.Mark Johnston2015-02-281-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=279416
* Only kill sleep processes that were forked from the test script.Mark Johnston2015-02-281-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=279415
* Stop hard-coding an incorrect path to rm(1).Mark Johnston2015-02-285-5/+5
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=279414
* Set altroot if the user have specified it via -o altroot.Xin LI2015-02-271-0/+2
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=279366
* Remove drti.o's dependency on libelf. This makes it possible to add DTraceMark Johnston2015-02-185-72/+86
| | | | | | | | | | | | | | | | | | | | | | probes to userland programs and libraries without also needing to link libelf. dtrace -G places the __SUNW_dof symbol at the beginning of the DOF (DTrace probe and provider metdata) section in the generated object file; drti.o now just uses this symbol to locate the section. A complication occurs when multiple dtrace-generated object files are linked together, since the __SUNW_dof symbol defined in each file is global. This is handled by using objcopy(1) to convert __SUNW_dof to a local symbol once drti.o has been linked with the generated object file. Upstream, this is done using a linker feature not present in GNU ld. Differential Revision: https://reviews.freebsd.org/D1757 Reviewed by: rpaulo MFC after: 1 month Relnotes: yes Notes: svn path=/head/; revision=278934
* Tweak the fds test program so that it actually compiles. Also use 0 insteadMark Johnston2015-02-142-7/+8
| | | | | | | | | | of -1 for the bogus ioctl command so that dmesg doesn't get spammed with sign extension warnings when the test program runs. MFC after: 1 week Notes: svn path=/head/; revision=278738
* Initial version of DTrace on ARM32.George V. Neville-Neil2015-02-102-2/+192
| | | | | | | | Submitted by: Howard Su based on work by Oleksandr Tymoshenko Reviewed by: ian, andrew, rpaulo, markj Notes: svn path=/head/; revision=278529
* Avoid hard-coding a path to ksh in scripts that are executed directly byMark Johnston2015-02-0311-11/+11
| | | | | | | | | | | the test harness. This is a problem in many of the *.ksh test scripts as well, but those scripts are executed using a shell whose path is specified in dtest.pl, so there's no need to modify them. MFC after: 1 week Notes: svn path=/head/; revision=278139
* Let the standard deviation of the empty set be 0. This is consistent withMark Johnston2015-02-021-0/+3
| | | | | | | | | | | | | the behaviour for averages, and fixes a crash that can occur when attempting to print a stddev aggregation containing no elements: dtrace:::BEGIN { @ = stddev(0); clear(@); printa("%@d", @); } PR: 197260 MFC after: 2 week Notes: svn path=/head/; revision=278114
* Fix mktemp(1) usage.Mark Johnston2015-01-311-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=278012
* Use syscall::exit instead of the nonexistent syscall::rexit.Mark Johnston2015-01-311-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=278011
* Remove hard-coded invocations of gcc; use cc(1) instead.Mark Johnston2015-01-314-13/+7
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=278009
* Remove a makefile that isn't present upstream.Mark Johnston2015-01-311-13/+0
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=278008
* Fix a number of DTrace scripting tests:Mark Johnston2015-01-3111-27/+27
| | | | | | | | | | | * Avoid hard-coding program paths. * Use -x when searching for oneself in ps(1) output. * Use the correct keyword (egid instead of pgid) in tst.egid.ksh. MFC after: 1 week Notes: svn path=/head/; revision=278007
* Fix some proc provider tests:Mark Johnston2015-01-313-12/+14
| | | | | | | | | | | | | * Avoid hard-coding program paths, except when it's necessary in order to override the use of a shell builtin. * Translate struct proc through psinfo_t so that we can access process arguments via the pr_psargs field of psinfo_t. * Replace uses of pstop and prun with kill(1). MFC after: 1 week Notes: svn path=/head/; revision=278006
* pause() isn't a system call on FreeBSD; use sigsuspend(2) instead.Mark Johnston2015-01-301-2/+5
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=277916
* The DTrace harness (dtest.pl) executes DTrace scripts with the -C flag,Mark Johnston2015-01-303-3/+9
| | | | | | | | | | | which causes dtrace(1) to run the C preprocessor on input scripts before executing them. Suppress some warnings emitted by the preprocessor which are confusing the DTrace lexer tests. MFC after: 1 week Notes: svn path=/head/; revision=277913
* Include required headers in DTrace test programs.Mark Johnston2015-01-3010-0/+15
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=277912
* Replace Solaris identifiers and types with their FreeBSD equivalents.Mark Johnston2015-01-3012-16/+16
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=277911
* Use the correct field when reading the PID out of a struct proc.Mark Johnston2015-01-304-4/+4
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=277910
* When searching for an accompanying test program, look in the directoryMark Johnston2015-01-301-1/+1
| | | | | | | | | | containing the test script rather than the current directory. This is needed in order to run the DTrace tests under Kyua. MFC after: 1 week Notes: svn path=/head/; revision=277909
* Follow up to r277449 by fixing the remaining NSEC_TO_TICK macro to have the sameEnji Cooper2015-01-211-1/+1
| | | | | | | | | named parameters Reported by: Ben Perrault <ben.perrault@gmail.com>, Willem Jan Withagen <wjw@digiware.nl> Notes: svn path=/head/; revision=277484
* MFV r277432:Xin LI2015-01-202-33/+47
| | | | | | | | | | | | Plug various memory leaks in libzfs import implementation. Illumos issue: 5518 Memory leaks in libzfs import implementation MFC after: 2 weeks Notes: svn path=/head/; revision=277433
* Mechanically convert cddl sun #ifdef's to illumosSteven Hartland2015-01-1755-331/+325
| | | | | | | | | | | | | | | 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
* Eliminate illumos whole disk special case when searching for a ZFS vdevSteven Hartland2015-01-161-0/+6
| | | | | | | | | | | | | This special case prevented locating vdevs which start with c[0-9] e.g. gptid/c6cde092-504b-11e4-ba52-c45444453598 hence it was impossible to online a vdev via its path. Submitted by: Peter Xu <xzpeter@gmail.com> MFC after: 2 weeks Sponsored by: Multiplay Notes: svn path=/head/; revision=277239
* 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
* Use the correct state name for unavailable pools in zpool listSteven Hartland2014-12-311-1/+2
| | | | | | | | | | | This corrects inconsitencies between zpool list and zpool status which are both described as displaying the pool <state> however zpool list would use this hardcoded FAULTED instead of the correct UNAVAIL. MFC after: 1 month Notes: svn path=/head/; revision=276446
* mdoc: remove EOL whitespace.Joel Dahl2014-12-291-1/+1
| | | | Notes: svn path=/head/; revision=276360
* Add PowerPC64 function descriptor support for dt_link.cJustin Hibbits2014-12-281-14/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: PowerPC64 uses function descriptors in a section .opd, exporting the descriptors to the symbol table. This adds support for these into dt_link.c so that dtrace USDT probes can be compiled. Test Plan: Tested only on powerpc64. No regression testing has been performed, so I want someone with x86 hardware to regression test this. Tested on amd64 by markj Reviewers: #dtrace, markj Reviewed By: #dtrace, markj Subscribers: markj Differential Revision: https://reviews.freebsd.org/D1267 MFC after: 3 weeks Notes: svn path=/head/; revision=276326
* DOF tables are aligned according to the DOF section's alignment constraint,Mark Johnston2014-12-261-1/+4
| | | | | | | | | | | so take this into account when iterating over DOF tables. PR: 195555 Submitted by: Fedor Indutny <fedor@indutny.com> (original version) MFC after: 1 week Notes: svn path=/head/; revision=276250
* Enhancements to zpool upgrade processingSteven Hartland2014-12-261-21/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a seperate phase to list all unavailable pools when listing pools to upgrade. This avoids confusing output when displaying older and disabled feature pools. These existing phases now silently skip unavailable pools. Introduce cb_unavail to upgrade_cbdata_t which enables the final output for zpool list to correctly detail if all pools or only all available pools where up-to-date on version / features. Correct the type of upgrade_cbdata_t.cb_first from int -> boolean_t. Change the pool iteration when upgrading named pools to include unavailable pools and update upgrade_one so it doesn't try to upgrade unavailable pools but warns about them. This allows the correct error to be displayed as well as upgrades with available and unavailable pools intermixed to partially complete. Also correct some missing trailing \n's from output in upgrade_one. MFC after: 1 month X-MFC-With: r276194 Notes: svn path=/head/; revision=276226
* Prevent zpool upgrade failing due to unavailable poolsSteven Hartland2014-12-251-0/+15
| | | | | | | | | | | | | Prior to this fix "zpool upgrade" and "zpool upgrade -a" would fail due to an assert when operating on unavailable pools. We now print a warning to stderr but allow the processing of other pools to procesed. MFC after: 1 month Notes: svn path=/head/; revision=276194
* We can stop iterating once we've found the DOF section.Mark Johnston2014-12-231-0/+1
| | | | | | | Submitted by: Fedor Indutny <fedor@indutny.com> Notes: svn path=/head/; revision=276144
* Initialize an argument to NULL instead of expecting dlinfo() to do it.Will Andrews2014-12-171-1/+1
| | | | | | | | | | | | | dlinfo() is a weak reference that may not be initialized at the time of execution. The default implementation (in lib/libc/gen/dlfcn.c) neither modifies the address pointed to by the third argument nor returns an error. Differential Revision: https://reviews.freebsd.org/D1326 Reviewed by: markj MFC after: 1 week Notes: svn path=/head/; revision=275845
* MFV r275784:Xin LI2014-12-151-4/+1
| | | | | | | | | | | | | | Plug a memory leak in libzfs. In zfs_iter_bookmarks, an nvlist is allocated before calling lzc_get_bookmarks, which allocates the nvlist again (and overwrites the pointer to previously allocated list). Illumos issue: 5427 memory leak in libzfs when doing rollback MFC after: 2 weeks Notes: svn path=/head/; revision=275812
* MFV r275783:Xin LI2014-12-151-1/+1
| | | | | | | | | | | | | | | | | | Convert ARC flags to use enum. Previously, public flags are defined in arc.h and private flags are defined in arc.c which can lead to confusion and programming errors. Consistently use 'hdr' (when referencing arc_buf_hdr_t) instead of 'buf' or 'ab' because arc_buf_t are often named 'buf' as well. Illumos issue: 5369 arc flags should be an enum 5370 consistent arc_buf_hdr_t naming scheme MFC after: 2 weeks Notes: svn path=/head/; revision=275811
* MFV r275551:Xin LI2014-12-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove "dbuf phys" db->db_data pointer aliases. Use function accessors that cast db->db_data to the appropriate "phys" type, removing the need for clients of the dmu buf user API to keep properly typed pointer aliases to db->db_data in order to conveniently access their data. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c: In zap_leaf() and zap_leaf_byteswap, now that the pointer alias field l_phys has been removed, use the db_data field in an on stack dmu_buf_t to point to the leaf's phys data. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c: Remove the db_user_data_ptr_ptr field from dbuf and all logic to maintain it. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c: Modify the DMU buf user API to remove the ability to specify a db_data aliasing pointer (db_user_data_ptr_ptr). cddl/contrib/opensolaris/cmd/zdb/zdb.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_bookmark.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_impl.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_leaf.h: Create and use the new "phys data" accessor functions dsl_dir_phys(), dsl_dataset_phys(), zap_m_phys(), zap_f_phys(), and zap_leaf_phys(). sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_impl.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_leaf.h: Remove now unused "phys pointer" aliases to db->db_data from clients of the DMU buf user API. Illumos issue: 5314 Remove "dbuf phys" db->db_data pointer aliases in ZFS MFC after: 2 weeks Notes: svn path=/head/; revision=275782
* MFV r275547:Xin LI2014-12-131-32/+23
| | | | | | | | | | | | | Port Illumos 'zfs allow' examples update. While I'm there also fix a typo. Illumos issue: 4181 zfs(1m): 'zfs allow' examples in the man page are outdated MFC after: 2 weeks Notes: svn path=/head/; revision=275739
* MFV r272851:Mark Johnston2014-12-081-0/+1140
| | | | | | | | | 5202 want ctf(4) illumos/illumos-gate@fe2e029eea29fd49d0d9058dbd5b79a252667e6b Notes: svn path=/head/; revision=275592
* MFV r275537:Xin LI2014-12-072-19/+48
| | | | | | | | | | | | | Illumos issue: 5316 allow smbadm join to use RPC (Due to our lack of smbsrv this is mostly no-op on FreeBSD) MFC after: 2 weeks Notes: svn path=/head/; revision=275579
* 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
* MFV r260710 + 275532:Xin LI2014-12-062-0/+405
| | | | | | | | | Add a new method, nvlist_print_json to allow libnvpair to emit JSON. MFC after: 1 month Notes: svn path=/head/; revision=275552
* Adjust some checks missed in r274637, now that pi_rname can be NULL.Mark Johnston2014-11-251-2/+3
| | | | | | | | | | | Additionally fix a misparenthesization in the same check, noticed while fixing the first bug. This bug only appears to cause problems if the same USDT probe appears twice within a static function. X-MFC-With: r274637 Notes: svn path=/head/; revision=275012
* The module load address always needs to be included when setting the dm_*_vaMark Johnston2014-11-251-3/+3
| | | | | | | | | | | | | | | 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. Reported by: Shrikanth Kamath <shrikanth07@gmail.com> Tested by: Shrikanth Kamath Discussed with: avg MFC after: 2 weeks Notes: svn path=/head/; revision=275011