Commit Graph

179 Commits

Author SHA1 Message Date
Pawel Jakub Dawidek
adea29ab75 Fix ztest when it is executed by just 'ztest' and not by full path
'/usr/bin/ztest'.
2010-11-01 10:42:14 +00:00
Pawel Jakub Dawidek
1cc1967893 1. Remove invalid assertion.
2. Properly recalculate delta in case pthread_cond_timedwait() is interrupted.
3. Style fix.

Reported by:	[1] App Deb <appdebgr@gmail.com>
2010-11-01 10:41:05 +00:00
Rui Paulo
8399e5f307 Use ${PICFLAG} instead of -fpic. 2010-10-27 18:46:56 +00:00
Martin Matuska
aa007a9f0e Properly handle IO with B_FAILFAST
Retry IO once with ZIO_FLAG_TRYHARD before declaring a pool faulted

OpenSolaris revision and Bug IDs:

9725:0bf7402e8022
6843014 ZFS B_FAILFAST handling is broken

Approved by:	delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6843014)
MFC after:	3 weeks
2010-09-27 09:42:31 +00:00
Martin Matuska
96a1a6a568 Enable offlining of log devices.
OpenSolaris revision and Bug IDs:

9701:cc5b64682e64
6803605	should be able to offline log devices
6726045	vdev_deflate_ratio is not set when offlining a log device
6599442	zpool import has faults in the display

Approved by:	delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6803605, 6726045, 6599442)
MFC after:	3 weeks
2010-09-27 09:05:51 +00:00
Christian Brueffer
bed6f18493 Minor grammar fixes. 2010-09-21 21:07:46 +00:00
Martin Matuska
5ab44ccaf2 Remove duplicate include of <strings.h>
Approved by:	delphij (mentor)
MFC after:	3 days
2010-09-17 14:15:03 +00:00
Rui Paulo
8518caf2a7 Add a man page for plockstat.
Sponsored by:	The FreeBSD Foundation
2010-09-15 10:18:18 +00:00
Rui Paulo
7879263397 Give a chance to the target binary to run the ctors by waiting until it
has reached main(). This allows plockstat to work.

Sponsored by:	The FreeBSD Foundation
2010-09-12 15:59:14 +00:00
Rui Paulo
dba0ac63fb Disable debug by default.
Sponsored by:	The FreeBSD Foundation
2010-09-11 10:16:15 +00:00
Rui Paulo
acac60bbfe Don't try to map the USDT probes. This is necessary because there is no
__SUNW_dof symbol present in FreeBSD binaries.

Sponsored by:	The FreeBSD Foundation
2010-09-10 12:16:24 +00:00
Rui Paulo
37c380fbb5 Don't clobber an existing target object file when doing the DTrace
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
2010-09-09 11:10:15 +00:00
Rui Paulo
8f7264f0e3 Include <sys/sdt.h> on a generated header.
Sponsored by:	The FreeBSD Foundation
2010-09-01 11:27:09 +00:00
Pawel Jakub Dawidek
81bbc7f749 Eliminate confusing while () loop. In the first version of the code it was
there to avoid gotos, but in the current version it serves no purpose.

MFC after:	2 weeks
2010-08-31 19:01:46 +00:00
Pawel Jakub Dawidek
0b88730662 When upgrading a pool which contain root file system, give user a hint that
he should update boot code.

MFC after:	2 weeks
2010-08-31 10:41:53 +00:00
Pawel Jakub Dawidek
d448e183aa Give user a hint what to do when /usr/lib/zfs/pyzfs.py is missing.
MFC after:	2 weeks
2010-08-29 20:25:25 +00:00
Pawel Jakub Dawidek
083b49f0dc Print errors on stderr.
MFC after:	2 weeks
2010-08-29 20:21:10 +00:00
Pawel Jakub Dawidek
4f1f4356f3 Fix 'zfs allow' (maybe not only) returning:
cannot access dataset system/usr/home: Operation not supported

by including libzfs_impl.h. What libzfs_impl.h does is to redefine ioctl() to
be compatible with OpenSolaris. More specifically OpenSolaris returns ENOMEM
when buffer is too small and sets field zc_nvlist_dst_size to the size that
will be big enough for the data. In FreeBSD case ioctl() doesn't copy data
structure back in case of a failure. We work-around it in kernel and libzfs by
returning 0 from ioctl() and always checking if zc_nvlist_dst_size hasn't
changed. For this work-around to work in pyzfs we need this compatible ioctl()
which is implemented in libzfs_impl.h.

MFC after:	2 weeks
2010-08-29 20:18:06 +00:00
Martin Matuska
abe5837f7c Update ZFS metaslab code from OpenSolaris.
This provides a noticeable write speedup, especially on pools with
less than 30% of free space.

Detailed information (OpenSolaris onnv changesets and Bug IDs):

11146:7e58f40bcb1c
6826241	Sync write IOPS drops dramatically during TXG sync
6869229	zfs should switch to shiny new metaslabs more frequently

11728:59fdb3b856f6
6918420	zdb -m has issues printing metaslab statistics

12047:7c1fcc8419ca
6917066	zfs block picking can be improved

Approved by:	delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6826241, 6869229, 6918420, 6917066)
MFC after:	2 weeks
2010-08-28 08:59:55 +00:00
Rui Paulo
e48ccbb261 Install dtruss.
Sponsored by:	The FreeBSD Foundation
2010-08-26 11:46:38 +00:00
Rui Paulo
568e709958 Add a man page for dtruss.
Sponsored by:	The FreeBSD Foundation
2010-08-26 11:45:39 +00:00
Rui Paulo
482c9aa14d Port dtruss to FreeBSD.
Sponsored by:	The FreeBSD Foundation
2010-08-24 23:24:43 +00:00
Rui Paulo
025f9d5b15 Merge dtracetoolkit/dtruss from the vendor.
Sponsored by:	The FreeBSD Foundation
2010-08-24 23:17:30 +00:00
Warner Losh
25faff346c MFtbemd:
Prefer MACHNE_CPUARCH to MACHINE_ARCH in most contexts where you want
to test of all the CPUs of a given family conform.
2010-08-23 22:24:11 +00:00
Marius Strobl
222447d5e0 Use real atomic operations for sparc64.
MFC after:	1 week
2010-08-23 22:04:30 +00:00
Nathan Whitehorn
de563149f5 Add powerpc64 to the list of architectures with real atomic operations.
Submitted by:	imp
2010-08-23 16:47:29 +00:00
Rui Paulo
029a737371 Don't link drti.o with libelf_pic.a. This means that all software with
userland SDT probes must be linked with libelf explicitly.

Requested by:	kib
Sponsored by:	The FreeBSD Foundation
2010-08-21 17:29:59 +00:00
Rui Paulo
013abb0056 Use double quotes when checking the value of MACHINE_ARCH.
Sponsored by:	The FreeBSD Foundation
2010-08-21 14:02:04 +00:00
Rui Paulo
7672c57a48 Add a Makefile for dtruss.
Sponsored by:	The FreeBSD Foundation
2010-08-21 13:56:29 +00:00
Rui Paulo
6544c91941 Port plockstat to FreeBSD. This will be connected to the build later.
Sponsored by:	The FreeBSD Foundation
2010-08-21 13:54:33 +00:00
Rui Paulo
513bdf9ac0 Link drti.o with a PIC version of libelf. This is needed because
drti.o depends on libelf and this avoids linking every other drti.o
program (namely programs with USDT probes) with libelf.

Sponsored by:	The FreeBSD Foundation
2010-08-21 13:48:04 +00:00
Rui Paulo
0f2bd1e89d Add libdtrace support for tracing userland programs.
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
2010-08-21 11:50:53 +00:00
Rui Paulo
d6f390f2f1 Use double quotes when checking the value of MACHINE_ARCH.
Sponsored by:	The FreeBSD Foundation
2010-08-21 11:14:50 +00:00
Rui Paulo
0c0b3feeed The DTrace instrumentation object is going to be i386/amd64 only.
Sponsored by:	The FreeBSD Foundation
2010-08-21 11:09:03 +00:00
Rui Paulo
b2db760808 Port most of the DTrace tests to FreeBSD.
Sponsored by:	The FreeBSD Foundation
2010-08-21 11:04:38 +00:00
Rui Paulo
8be96e101f Add man pages for the CTF tools.
Sponsored by:	The FreeBSD Foundation
2010-08-11 18:00:45 +00:00
Rui Paulo
afba0b6e9e Fix another mismerge: bring back the definition of DT_MUTEX_HELD(). 2010-08-02 17:31:48 +00:00
Rui Paulo
31a396ad47 Fix the result of a mismerge. MUTEX_HELD should be DT_MUTEX_HELD() and
Plmid() is not supposed to be called.
2010-08-02 17:20:59 +00:00
Rui Paulo
1670a1c2a4 MFV OpenSolaris DTrace userland bits. 2010-08-02 13:40:53 +00:00
Rui Paulo
e285f763bd lockstat(1) now depends on libutil and librtld_db.
Sponsored by:	The FreeBSD Foundation
2010-07-31 17:58:44 +00:00
Rui Paulo
1e634b7b65 proc_wait() was replaced by proc_wstatus(). Right now this call is
useless because userland support is not working on HEAD, but this makes
libdtrace compile again.

Sponsored by:	The FreeBSD Foundation
2010-07-31 17:23:37 +00:00
Rui Paulo
fd14f3b4a9 libdtrace, dtrace(1) and lockstat(1) are for i386 and amd64 only right
now.

Sponsored by:	The FreeBSD Foundation
2010-07-31 17:13:14 +00:00
Rui Paulo
f28bde1aea Update to the new proc_detach() function.
Sponsored by:	The FreeBSD Foundation
2010-07-31 17:10:55 +00:00
Rui Paulo
545d9c7007 dtrace(1) now depends on libutil and librtld_db.
Sponsored by:	The FreeBSD Foundation
2010-07-31 17:09:37 +00:00
Navdeep Parhar
96d1cd1879 Catch up with r210324. d_buf will be NULL for SHT_NOBITS sections, do not
attempt to copy from it in that case.

MFC after:	1 month
2010-07-23 22:24:25 +00:00
Andriy Gapon
556cb98d95 dtrace: correctly map sections to addresses in elf object modules (amd64)
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
2010-07-23 17:32:47 +00:00
Martin Matuska
2bacd082bd Enable fake resolving of SMB RIDs by using nulldomain and UID_NOBODY
- fixes panics when Solaris/OpenSolaris pools that contain files
uploaded with the SMB protocol are accessed

Enable seting/unsetting the sharesmb property (dummy action)
- allows users who import pools from Solaris/Opensolaris to unset
the sharesmb property and get rid of annoying messages

PR:		kern/145778, kern/148709
Approved by:	pjd, delphij (mentor)
MFC after:	7 weeks
2010-07-22 23:30:24 +00:00
Rui Paulo
2cd5e41a9c MFV:
OpenSolaris' plockstat utility.

Sponsored by:	The FreeBSD Foundation
2010-07-19 14:59:23 +00:00
Rui Paulo
7aa3838467 Merge from vendor: libdtrace MD parts needed by fasttrap.
Sponsored by:	The FreeBSD Foundation
2010-07-17 18:31:31 +00:00
Pawel Jakub Dawidek
0356e5fcb5 MFp4 180933:
Initialize rw_count properly so that zdb(8) doesn't trigger assertion in
rw_enter():

	ASSERT(rwlp->rw_count == 0);

While here, assert that rw_count is 0 when destroying the lock.

MFC after:	1 week
2010-07-14 06:37:43 +00:00