Commit Graph

552 Commits

Author SHA1 Message Date
gson 7c2276b8da Use space between words 2018-06-16 15:18:33 +00:00
maya 93c55cb558 Avoid declaring ulonglong_t.
Comment here already says it isn't necessary and will be removed.
Hasten the process for us and avoid the problematic typedef.

This is useful because u_longlong_t would otherwise need to be
provided by compat headers.
2018-06-13 04:21:21 +00:00
kamil d2d2a14700 Replace HAVE_GCC with ACTIVE_CC == gcc checks
Kernel modules build with GCC and Clang/LLVM.

Requested by <joerg>
2018-06-07 13:21:44 +00:00
kamil 60490a027e Correct compilation of osnet/dev/systrace/systrace.c under Clang
Mark arguments to dtrace_probe_lookup() with __UNCONST().
The proper fix constifying it causes pollution of const in too many files.

This could be done with -W flags, but they are incompatible between
compilers.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
2018-06-06 17:47:10 +00:00
kamil 3982d87926 Correct compilation of osnet/dev/profile/profile.c under Clang
Constify char* types when initialized with liternals.

This could be done with -W flags, but they are incompatible between
compilers.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
2018-06-06 17:19:49 +00:00
kamil afef2ab3de Correct compilation of osnet/dev/dtrace/x86/dis_tables.c under Clang
Constify dgr_suffix.

This could be done with -W flags, but they are incompatible between
compilers.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
2018-06-06 17:16:56 +00:00
kamil 9a546da821 Correct compilation of osnet/dev/dtrace/dtrace_hacks.c under Clang
Use __UNCONST() to remove const from an argument.

This could be done with -W flags, but they are incompatible between
compilers.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
2018-06-06 15:54:03 +00:00
kamil 03c04814f0 Correct compilation of osnet/dist/uts/common/dtrace/dtrace.c under Clang
Add missing const keywords in dtrace_strncmp().

Initialize lim1 and lim2 to zero always. This prevents a false positive
about potentially unset but used variable.

This could be done with -W flags, but they are incompatible between
compilers.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
2018-06-06 15:24:57 +00:00
kamil ec5a3bbdb8 Swap conditions HAVE_LLVM -> HAVE_GCC 2018-06-06 15:01:13 +00:00
kamil 76b9fb4568 Make cddl/osnet/Makefile.zfs compatible with MKLLVM=yes
Clang/LLVM does not recognize:
 - -Wno-discarded-qualifiers

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
2018-06-06 14:47:54 +00:00
kamil 8627ada168 Correct compilation of osnet/dist/cmd/dtrace/dtrace.c under Clang
Add missing const keywords.

This could be done with -W flags, but they are incompatible between
compilers.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
2018-06-06 14:46:58 +00:00
kamil 54f848644c Make cddl/osnet/usr.sbin/dtrace -W compatible with MKLLVM=yes
Clang/LLVM does not recognize:
 - -Wno-discarded-qualifiers
 - -Wno-unused-but-set-variable

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
2018-06-06 14:31:45 +00:00
kamil 38533b841d Make cddl/osnet/lib/libdtrace buildable with MKLLVM=yes
Clang/LLVM does not recognize:
 - -Wno-maybe-uninitialized
 - -Wno-unused-but-set-variable

MKGCC=yes still builds the distribution.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
2018-06-06 14:18:39 +00:00
christos cc268b724c remove <sys/proc.h> done in the dtrace header now. 2018-06-05 12:04:19 +00:00
christos 61c2ab4099 add <sys/proc.h> because the header needs proc_t kthread_t etc. 2018-06-04 21:36:03 +00:00
christos fbc4edde8d better to put this (<sys/proc.h>) in the dtrace header where the definitions
are needed.
2018-06-04 21:35:29 +00:00
kre fea21eb07e The (dtrace version of) <sys/proc.h> is needed for kthread_t
(same as the amd64 version).   This should fix (one of) the
current i386 build breakages.
2018-06-04 20:12:45 +00:00
christos 8f1adcbb03 Add a blurb of a general approach how to maintain these files. 2018-06-03 20:59:49 +00:00
christos 68837537fe The native mutex.h has a userland visible portion. make it so and fix the
build.
2018-06-03 14:56:52 +00:00
chs bbfe9dbd31 tweak the osnet compat headers to allow building on MacOS and Linux hosts. 2018-06-03 05:55:08 +00:00
chs 01d6e97218 avoid calling kpause() with a delay of 0. 2018-06-03 03:05:56 +00:00
christos 5a38769f09 - Remove more extraneous includes to avoid circular dependencies with the
real header files.
- Add <sys/errno.h> to <sys/systm.h> to avoid changing the source, but
  it should really belong to the source.
2018-06-02 18:46:34 +00:00
christos 50f0215b97 don't include <sys/proc.h> 2018-06-02 15:47:22 +00:00
christos a4bb88f1bb Use a constant to prevent dynamic array allocation which messes up SSP. 2018-06-02 01:19:46 +00:00
kre c0824e2dbe Avoid duplicate typedefs so these headers can be used
as part of tools build, when the base system compiler does
not allow duplicate type definitions.

Someone please fix this some better way than this!
2018-06-01 00:56:19 +00:00
kre 12c661f52d Build fix attempt, use TOOL_AWK (with fallback to "awk") rather than "nawk". 2018-05-29 01:09:49 +00:00
chs 710a39faba add some new files missed by my script:
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
 - dtrace FBT probes can now be placed in kernel modules.
 - ZFS now supports mmap().
2018-05-28 23:47:39 +00:00
chs ba2539a980 merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
 - dtrace FBT probes can now be placed in kernel modules.
 - ZFS now supports mmap().
2018-05-28 21:04:59 +00:00
chs 3227e6cf66 import new CDDL dtrace and ZFS code from FreeBSD svn r315983. 2018-05-28 20:52:50 +00:00
christos bacfdb6969 add casts 2018-01-07 20:02:52 +00:00
christos 7eaaf56ed8 add trivial handling for DW_ATE_UTF, does not work. 2017-12-31 03:08:49 +00:00
kre 4464b377cc Let's define symbols before using them. 2017-11-18 18:52:59 +00:00
christos 3be9d673a3 use symbolic constant for 0 2017-11-18 13:51:56 +00:00
christos 114ddb80d3 our pool code needs either PR_SLEEP or PR_NOWAIT; arrange for that explaining
the current choice :-)
2017-11-17 18:18:01 +00:00
christos 7de85f86e1 kill another wrong ELFSIZE setting. 2017-11-06 04:43:50 +00:00
christos eed7a256a0 need to undef KERN_ELFSIZE too here... 2017-11-06 03:51:37 +00:00
sevan 35823e7391 Include scripts from the DTrace Toolkit if DTrace support is enabled.
The following scripts are installed:
dtruss    - a DTrace version of truss.
execsnoop - snoop process execution as it occurs.
opensnoop - snoop file opens as they occur.
procsystime - print process system call time details.

ok riastradh
2017-09-17 00:00:39 +00:00
abhinav 062266a272 Undo the previous
While it fixed the problem of trailing spaces, but if the probe specifier
contained leading spaces, it would brake dtrace. The proper fix would be
to skip the leading spaces in the string as well.

However, it would result in a bigger diff for a very small benefit. While
a new import of dtrace is impending, it's better not to have this change.

Discussed with christos.
2017-06-05 21:19:32 +00:00
abhinav 143b096d8f Fix the trailing space in the probe specifier's name in dtrace(1)'s output.
When using dtrace using one of the tracing options, such as -n, -P, -i, -f etc.,
the first line of output from dtrace one is something like this:

sudo dtrace -n 'syscall:::entry /pid == 100/ {@num[probefunc] = count();}'
dtrace: description 'syscall:::entry ' matched 482 probes

There is a trailing space at the end of the probe specifier name ('syscall:::entry ').
This happens beucase dtrace tries to separate the probe name from the predicate and actions
using `{' and `/' as the separators but doesn't consider space also as a possible separator.

Output after this change:
sudo dtrace -n 'syscall:::entry /pid == 100/ {@num[probefunc] = count();}'
dtrace: description 'syscall:::entry' matched 482 probes

ok christos@
2017-06-05 17:11:10 +00:00
joerg 47fb074ea2 Fix argument order. 2017-05-26 22:50:35 +00:00
riastradh 7f7aad09bd Make VOP_RECLAIM do the last unlock of the vnode.
VOP_RECLAIM naturally has exclusive access to the vnode, so having it
locked on entry is not strictly necessary -- but it means if there
are any final operations that must be done on the vnode, such as
ffs_update, requiring exclusive access to it, we can now kassert that
the vnode is locked in those operations.

We can't just have the caller release the last lock because some file
systems don't use genfs_lock, and require the vnode to remain valid
for VOP_UNLOCK to work, notably unionfs.
2017-05-26 14:20:59 +00:00
abhinav 9f1571e578 Fix a typo: s/intepretation/interpretation 2017-05-12 21:01:36 +00:00
abhinav 8a253e32f4 Change section number from 1M to 1
The man page gets installed in section 1 anyway.

Ok christos, mrg
2017-05-12 20:58:35 +00:00
riastradh 6fa7b15833 Change VOP_REMOVE and VOP_RMDIR to preserve lock/ref on dvp.
No change to vp -- the plan is to replace the node by the
componentname in the vop parameters, and let all directory vops do
lookups internally.

Proposed on tech-kern with no objections:
https://mail-index.netbsd.org/tech-kern/2017/04/17/msg021825.html
2017-04-26 03:02:47 +00:00
riastradh 87fb32292e Make VOP_INACTIVE preserve vnode lock on return.
Discussed on tech-kern:
https://mail-index.netbsd.org/tech-kern/2017/04/01/msg021751.html

Ride 7.99.68, a bumpy bus of incremental vfs improvements!
2017-04-11 14:24:59 +00:00
chs 44b9f41144 apply changes equivalent to freebsd r256822, r267759 and r298171:
fix the dtrace "args" variable to return correct values.
simplify the invop handlers a bit by changing the second argument
from a pointer into the stack to a pointer to the trapframe.
2017-02-27 06:46:59 +00:00
hannken 326db3aaf6 Add generic genfs_suspendctl() and use it for all file systems.
Layered file systems need work.
2017-02-17 08:31:23 +00:00
chs e2632a59f3 put back the include of dtrace_bsd.h, it actually is needed. 2017-02-01 21:59:09 +00:00
chs 82ba364bfa fix this module to depend on the solaris module rather than the dtrace module.
remove an unneeded header.
2017-02-01 20:06:21 +00:00
chs 769e07db09 add some missing bits from freebsd r211554:
remove the DOODAD from prochandler().
we are now DOODAD-compatible with current freebsd.
2017-02-01 20:02:22 +00:00