Commit Graph

508 Commits

Author SHA1 Message Date
joerg
f2e47b4038 Merge r274564 from FreeBSD:
Fix a couple of bugs around the handling of structs and unions of size zero.
These would cause ctfconvert(1) to return an error when attempting to
resolve valid C types.
2016-03-01 14:52:14 +00:00
riastradh
a37e72fe0d Let MKCTF alone control whether we build libctf.
If MKDTRACE=yes MKCTF=no makes no sense, we can express that
somewhere else, not as a confusing set lists error at the end -- as
far as I know, there's no way to express MKDTRACE *or* MKCTF as a
condition for set list entries.
2016-02-29 17:46:54 +00:00
riastradh
9e84fa00b8 uint64_t can't be negative. 2016-02-29 16:19:20 +00:00
riastradh
a9ebcda81c Sprinkle some more zfs range lock reference count kasserts.
From a debugging session months ago, might as well share them.
2016-02-29 16:18:37 +00:00
riastradh
0ba9aea45e Cast int64_t to long long before printfing with %lld.
Not doing so broke something months ago and I forgot why.
2016-02-29 16:14:57 +00:00
riastradh
886308980e Add __printflike as appropriate. 2016-02-29 02:19:37 +00:00
christos
042ef76aff - Add missing ioctl.h
- Hide dprintf
2016-02-28 19:10:45 +00:00
christos
91780cc76d hook drti 2016-02-28 19:10:10 +00:00
joerg
f247f26769 Make the default CPP path a list and check if they are access(2)able.
If no match is found, fallback to looking for cpp in PATH.
2016-02-24 21:11:34 +00:00
joerg
5e22f35b4d Keep the if chain going. 2016-02-21 13:33:47 +00:00
joerg
486516affa Clang 3.7 and newer provide the array size via DW_AT_count, not via
DW_AT_upper_bound. Recognize the former as well as the latter.
2016-02-20 23:09:03 +00:00
joerg
4fa4785fa4 Don't nuke input on errors, it makes debugging a nightmare. 2016-02-20 22:08:44 +00:00
joerg
f9442aa68f Shuffle include order to avoid missing free on glibc. 2016-02-20 21:50:02 +00:00
christos
604231c4f0 - don't barf if the object does not have DWARF debug data.
- bump size of types to 1K to avoid string overflow
(both are needed for the new elftoolchain).
2016-02-20 02:39:47 +00:00
joerg
b0b911ff3e Don't use #pragma weak to implicitly change argument types. 2016-02-19 19:25:59 +00:00
joerg
e9ae0934d6 dmu_objset_rename is an alias for dsl_dataset_rename, but differs in
constness of the first argument. Newer clang checks for this and
prohibits it, so just be consistent by constifying the latter.
2016-02-19 19:25:22 +00:00
christos
c628030d37 reduce ifdefs 2016-02-13 21:37:12 +00:00
joerg
66313330f0 SDT is not a disease. Use const consistently. 2016-02-06 18:19:59 +00:00
riastradh
8e1ee72c35 Need nbtool_config.h for __dead in tools. 2016-02-05 20:39:50 +00:00
riastradh
32e3d5d381 Need nbtools_config.h for __unused.
Fixes

.../src/tools/ctfmerge/../../external/cddl/osnet/dist/tools/ctf/common/list.c:73:47: error: expected ';', ',' or ')' before '__unused'
 list_defcmp(void *d1, void *d2, void *private __unused)
                                               ^~~~~~~~

on non-NetBSD systems, where <assert.h>, <stdlib.h>, <stdio.h>, and
<sys/types.h> don't define __unused.
2016-02-05 19:56:00 +00:00
roy
871759c0d7 Fix the actual issue rather than silencing the warning.
Thanks to gson@
2016-02-05 10:14:49 +00:00
roy
f4a5ac8842 Add -Wno-format-nonliteral 2016-02-04 21:26:48 +00:00
roy
5baa0e8c89 dtrace needs Wno-format-security for clang it seems. 2016-02-04 20:06:29 +00:00
roy
a118806971 Add some __printflike and __dead love. Init some structs fully. 2016-02-04 20:05:53 +00:00
roy
80df5a39da Fix build. 2016-02-04 18:47:14 +00:00
roy
440c6b2902 Mark more functions as __printflike and __dead. 2016-02-04 18:46:37 +00:00
roy
5e1375a115 Mark more functions as __dead. 2016-02-04 17:47:43 +00:00
roy
dd3d664f77 Disable -Wformat-nonliteral here to build. 2016-02-04 17:42:34 +00:00
roy
1e48e626cd More printflike and dead fixes. 2016-02-04 17:40:55 +00:00
roy
985adb8dc0 Fix printf formats and casts. 2016-02-04 17:27:32 +00:00
roy
b9ae60933c Correct a prior patch by moving __printflike marking from the .c files
to the .h ones.
2016-02-04 16:58:11 +00:00
roy
b31be80ab9 Mark __printflike and __dead. 2016-02-04 16:48:34 +00:00
roy
c29f38a653 Mark printflike functions as __printflike. 2016-02-04 15:23:29 +00:00
riz
c1e4fb302e Adapt getmajor and getminor signatures for NetBSD. 2016-02-03 17:50:12 +00:00
christos
efcb6e5b0c Split the opensolaris types into opentypes.h because linux includes
sysmacros.h from types.h and we can't interpose ourselves to define
the needed types otherwise.
Disable unused macros, get rid of __APPLE__
2016-02-01 02:12:55 +00:00
christos
d3b8f3fc89 prevent re-defines 2016-02-01 02:09:54 +00:00
christos
117f317b41 define it when we have vaddr_t exposed. 2016-01-31 06:15:39 +00:00
christos
73c5431c9d we don't keed page count in userland. 2016-01-31 05:31:28 +00:00
christos
aa2825fe7d only need pgcnt_t in kernel. 2016-01-31 05:21:53 +00:00
christos
d53e8ce2b1 don't link/depend on libpthread if we are a hostprog.
XXX: should be using -pthread instead?
2016-01-27 18:43:25 +00:00
christos
9a678359e4 sys/conf.h is a kernel only header 2016-01-24 22:00:53 +00:00
christos
ffeb8dbf4e Define _KERNTYPES for things that need it. 2016-01-23 21:22:45 +00:00
riastradh
d604e653d0 Omit spurious include of <sys/isa_defs.h> in dtrace tools build.
Fixes dtrace tools cross-build from architectures with no dtrace
support:

#   compile  libctf/ctf_create.lo
[...]
/export/anoncvs/src/tools/libctf/../../external/cddl/osnet/sys/sys/isa_defs.h:50:2: error: #error "architecture not supported"
 #error "architecture not supported"
  ^
2016-01-23 15:45:42 +00:00
christos
b41dd0142f We don't need to declare clock_gettime if we don't have it and we don't need
to __RENAME if we are not NetBSD.
2015-12-27 21:42:09 +00:00
christos
585cc407b7 Override roundup. 2015-12-27 21:40:21 +00:00
christos
da5e76ddef don't re-define __assert. 2015-12-27 21:39:34 +00:00
christos
81dbb529d3 add nbtool_config.h 2015-12-27 21:39:01 +00:00
christos
d941e4fe7e add return 2015-12-27 21:38:46 +00:00
joerg
08c2098fe3 Our time.h defines clock_gettime with assembler name after including
sys/time.h. The Solaris compat code in sys/time.h wants to use it in an
inline function, but misses a prototype (and the relabeling). As stopgap
for getting consistent defines of clock_gettime duplicate the prototype
here.
2015-12-21 13:28:39 +00:00
christos
952d11cd49 catch up with DIOCGPART -> DIOCGPARTINFO 2015-12-08 20:56:21 +00:00
pgoyette
82344b6ce9 When loading the module, if devsw_attach() fails, call dtrace_unload()
to undo the effects of dtrace_load().  And if dtrace_unload() fails,
panic (since we can't get the system back to its earlier stable state).

When unloading the module, call devsw_detach() first, to lock out any
new access.  Then call dtrace_unload().  If dgtrace_unload() fails,
reattach the devsw, and if that fails, panic.

Implements fixes described in PR kern/43032
2015-11-28 22:41:36 +00:00
riz
d39dd3ba38 Declare variables under the same conditions as their use. 2015-11-12 22:10:48 +00:00
christos
d4aeb196d8 make too many struct or union members non-fatal. 2015-10-21 13:43:49 +00:00
christos
4ace1867fc make this kind of work. 2015-10-07 02:22:29 +00:00
christos
ee7dd36d49 fix the remaining problem with pcinfo; the dtracetoolkit execsnoop script
works.
2015-10-07 00:35:23 +00:00
christos
5a472843c6 Adjust for NetBSD. 2015-10-07 00:34:37 +00:00
christos
8e6eeb3dcf almost fixed... Need to figure out what to do with curlwp. 2015-10-06 22:12:09 +00:00
riz
84d94196b6 Make this build for me. 2015-10-06 01:18:47 +00:00
christos
665d810b64 Start matching some of the field names to NetBSD's
XXX: needs work
2015-10-05 17:49:40 +00:00
christos
7948227e4f Arrange to install the dtrace files (some are broken, sets will need to be
fixed)
2015-10-05 17:49:10 +00:00
christos
4cea25895d load the kernel for NetBSD (for now) 2015-10-05 17:48:09 +00:00
christos
5fbaf483b1 Add definitions for uid_t and gid_t for NetBSD because we are screwing up
with the names in the kernel and the ctf sections end up having only __uid_t
and __gid_t.
2015-10-05 17:47:37 +00:00
christos
ea79cab59b put back module filename finding code. 2015-10-04 23:25:32 +00:00
riz
ee3b021d7b Restore some defines lost in last update, and don't include sys/cpuvar.h
MKDTRACE=yes now builds for arm platforms again.
2015-10-02 22:16:38 +00:00
riz
701e808f1d Update signature of unimplemented function to match prototype. 2015-10-02 22:15:18 +00:00
christos
aef619cb8a put back the DTRACE macros 2015-10-02 17:28:57 +00:00
christos
75a404098e we don't need any of this now. 2015-10-02 17:13:58 +00:00
christos
46b66d3b89 Merge conflicts 2015-10-02 17:13:32 +00:00
christos
d1b373115b Adapt to NetBSD modules and link set access.
XXX: We don't have an event system so that we can issue callback that
     will be run on construction or destruction to enable and disable probes
XXX: We don't have a way to use link_sets across modules properly.
2015-10-02 16:59:23 +00:00
riz
f2d2d6c3e9 Redo previous so as to not break non-arm MKDTRACE=yes builds. 2015-10-01 20:51:19 +00:00
riz
41784a61b4 Only declare 'ldn' where it's actually used. Fixes build on arm
with MKDTRACE=yes.
2015-10-01 19:45:37 +00:00
christos
c29d517558 Import the dtrace toolkit from FreeBSD; simple scripts such as dtruss work
unmodified. For others we'll need to add the missing probes and adjust.
This is not attached to the build.
2015-09-30 22:01:06 +00:00
christos
ae335351bb Add proc:::exit
XXX: I am going to kill that soon and make the providers register automagically
with linker sets. This can't scale.
2015-09-30 20:59:44 +00:00
christos
7264d1b96c recognize the proc provider as belonging to sdt 2015-09-30 20:59:13 +00:00
christos
35d37febae do the stack protector stuff like the other files. 2015-09-30 00:17:09 +00:00
christos
5a76c68ec9 detect dynamically if we need -e for echo 2015-09-29 23:50:52 +00:00
christos
85c412e566 - make the generated file rules depend on the source files
- hack for clang on Darwin
2015-09-29 23:50:17 +00:00
christos
ec4b0d739b for the endian macros don't use the _ names, Darwin does not define them. 2015-09-29 20:43:16 +00:00
christos
f651117f07 no other ctf program needs -lrt, why does this one? 2015-09-29 20:31:43 +00:00
christos
302f5a4b29 return an error for actions we don't understand. 2015-09-29 14:31:22 +00:00
wiz
ff1e46a1cb Remove reference to mdb(1). 2015-09-29 06:33:01 +00:00
wiz
f3752eafe8 Fix Dt. New sentence, new line. Fix xrefs.
Still leaves:
trailing Xref to mdb(1)
trailing Xref to libctf(3)
2015-09-28 22:00:26 +00:00
christos
431e9fd675 avoid compiler warnings 2015-09-26 03:32:17 +00:00
christos
3a8db65df5 catch up with unsigned long -> proc_breakpoint_t change. 2015-09-26 00:33:34 +00:00
christos
f94f34a53d include <sys/proc.h> explicitly for kthread_t 2015-09-24 19:55:00 +00:00
christos
bcf65cfcd7 %j needs uintmax_t not uintptr_t 2015-09-24 19:16:06 +00:00
christos
72494a1078 Add build stuff. 2015-09-24 14:36:54 +00:00
christos
5377c71070 use the alternate syscall names if available 2015-09-24 14:26:44 +00:00
christos
bae6f8e175 new from FreeBSD 2015-09-24 14:26:09 +00:00
christos
c0855460da sync with FreeBSD 2015-09-24 14:25:29 +00:00
christos
2cd1ca309f remove dup copies of code that we've moved to dev a long while ago 2015-09-24 14:23:39 +00:00
christos
26e9b7f568 sync with FreeBSD 2015-09-24 14:21:35 +00:00
christos
3745d9fb72 Sync with FreeBSD 2015-09-24 14:20:18 +00:00
christos
74f0118d99 sync with FreeBSD 2015-09-24 14:18:24 +00:00
christos
fbb8599f9a We have libproc now 2015-09-24 14:17:20 +00:00
christos
fe20ccddcc don't depend on the installed version of libz 2015-09-17 01:53:48 +00:00
christos
dce63dea1d no need for LIBDPLIBS here 2015-09-16 19:47:14 +00:00
christos
661f541135 libctf depends on libz 2015-09-15 18:38:41 +00:00
riz
3922b03876 include <sys/lwp.h> for curlwp. From ozaki-r. 2015-09-10 19:56:13 +00:00
chs
f047745321 reapply some fixes to make multi-threaded ctfmerge work
that were lost in the overzealous resync with freebsd.
remove the hacks which were applied to work around those problems.
2015-07-06 00:21:51 +00:00