History log of /freebsd-10-stable/cddl/contrib/opensolaris/lib/libdtrace/common/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
318784 24-May-2017 avg

MFC r316853: dtrace: fix normalization of stddev aggregation

Sponsored by: Panzura

297953 14-Apr-2016 markj

MFC r297827:
libdtrace: Add a missing unlock to an error handler.

297129 21-Mar-2016 pfg

MFC r296816:

libdtrace: use calloc(3) instead of malloc(3) when it makes sense.

calloc(3) is faster and occasionally safer than malloc(3) + bzero(3).

In one case, pointed out by Mark[1], this also cleans up a calculation.

Reviewed by: markj [1]

297077 20-Mar-2016 mav

MFC r277300 (by smh): Mechanically convert cddl sun #ifdef's to illumos

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.


/freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/lockstat/sym.c
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/mdb/tools/common/die.c
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/mdb/tools/common/util.h
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c
/freebsd-10-stable/cddl/contrib/opensolaris/common/util/strtolctype.h
/freebsd-10-stable/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c
drti.c
dt_aggregate.c
dt_cc.c
dt_consume.c
dt_dof.c
dt_error.c
dt_handle.c
dt_ident.c
dt_impl.h
dt_lex.l
dt_link.c
dt_map.c
dt_module.c
dt_open.c
dt_options.c
dt_parser.c
dt_pid.c
dt_pragma.c
dt_printf.c
dt_proc.c
dt_program.c
dt_provider.c
dt_subr.c
dt_work.c
dtrace.h
/freebsd-10-stable/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c
/freebsd-10-stable/cddl/contrib/opensolaris/lib/libgen/common/gmatch.c
/freebsd-10-stable/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
/freebsd-10-stable/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
/freebsd-10-stable/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c
/freebsd-10-stable/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
/freebsd-10-stable/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c
/freebsd-10-stable/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
/freebsd-10-stable/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
/freebsd-10-stable/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c
/freebsd-10-stable/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c
/freebsd-10-stable/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.h
/freebsd-10-stable/cddl/contrib/opensolaris/tools/ctf/cvt/ctfconvert.c
/freebsd-10-stable/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c
/freebsd-10-stable/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
/freebsd-10-stable/cddl/contrib/opensolaris/tools/ctf/cvt/output.c
/freebsd-10-stable/cddl/contrib/opensolaris/tools/ctf/cvt/tdata.c
/freebsd-10-stable/cddl/contrib/opensolaris/tools/ctf/cvt/util.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zvol.h
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/os/callb.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/os/fm.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/sys/ctf.h
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/sys/procset.h
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent.h
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/sys/u8_textprep.h
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
/freebsd-10-stable/sys/cddl/dev/dtrace/amd64/instr_size.c
/freebsd-10-stable/sys/cddl/dev/dtrace/dtrace_ioctl.c
/freebsd-10-stable/sys/cddl/dev/dtrace/i386/instr_size.c
/freebsd-10-stable/sys/cddl/dev/dtrace/x86/regset.h
287226 27-Aug-2015 markj

MFC r286169:
Perform bounds checking when constructing a format string.

PR: 201657

284131 07-Jun-2015 markj

MFC r283025:
As dtrace(1) processes D libraries under /usr/lib/dtrace, the compiler may
return an error if one of the depends_on directives in a library is not
satisfied. In this case, libdtrace is supposed to ignore the library and
carry on. However, the remainder of the library may still be buffered by
the lexer, causing libdtrace to erroneously continue processing it on the
next call to yyparse(). Fix this by explicitly flushing the input buffer
each time the compiler state is reset.

281473 12-Apr-2015 markj

MFC r280882:
Fix a misparenthesization that could cause a crash if TERM is not set.

281472 12-Apr-2015 markj

MFC r278114:
libdtrace: Let the standard deviation of the empty set be 0.

PR: 197260

276732 06-Jan-2015 markj

MFC r276250:
DOF tables are aligned according to the DOF section's alignment constraint,
so take this into account when iterating over DOF tables.

PR: 195555

276267 26-Dec-2014 markj

MFC r272671:
Treat D keywords as identifiers in certain postfix expressions. This allows
one to, for example, access the "provider" field of a struct g_consumer,
even though "provider" is a D keyword.

PR: 169657

276265 26-Dec-2014 markj

MFC r275011:
The module load address always needs to be included when setting the dm_*_va
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.

275516 05-Dec-2014 markj

MFC r271695:
Fix some incorrect endianness checks.

273595 24-Oct-2014 markj

MFC r258902:
The uaddr, ufunc, umod and usym functions all seem to work as expected on
FreeBSD, so stop hiding them behind a "#if defined(sun)".

270214 20-Aug-2014 markj

MFC r269524:
Preserve the errno value of an ioctl before calling free(3). Previously,
errno was very occasionally being clobbered, resulting in a bogus error from
dt_consume() and thus an error from dtrace(1).

270030 16-Aug-2014 pfg

MFC r267875:

4251 libdtrace leaks open file handles

Illumos commit: 93ed8d0d4b068b95d0bb50d57bb854df462a8485
(partial)
Reference:
https://www.illumos.org/issues/4251

Discussed with: Robert Mustacchi
Obtained from: Illumos

269986 14-Aug-2014 markj

MFC r257877:
Don't try to use the 32-bit drti.o unless the data model is explicitly set
to ILP32. Otherwise dtrace -G will attempt to use it on amd64 if it can't
determine which data model to use, which happens when -64 is omitted and
no object files are provided, e.g. with

# dtrace -G -n BEGIN

This would result in a linker error, but now works properly.

Also remove an unnecessary #ifdef.

269912 13-Aug-2014 rpaulo

MFC r269776
Remove the BROKEN_LIBELF section.

269724 08-Aug-2014 markj

MFC r265631:
Re-apply r248644. This fixes an annoying problem which caused dtrace -c to
fail to attach to stripped binaries. With the _r_debug_postinit symbol,
dtrace(1) can now set a breakpoint in the victim process after it has
registered its DOF table(s) with the kernel. r_debug_state cannot be used
for this purpose since it is called before DOF is made available, in which
case dtrace(1) cannot create USDT probes before the program begins
execution.

269520 04-Aug-2014 markj

MFC r256571:
Add a function, memstr, which can be used to convert a buffer of
null-separated strings to a single string. This can be used to print the
full arguments of a process using execsnoop (from the DTrace toolkit) or
with the following one-liner:

dtrace -n 'syscall::execve:return {trace(curpsinfo->pr_psargs);}'

Note that this relies on the process arguments being cached via the struct
proc, which means that it will not work for argvs longer than
kern.ps_arg_cache_limit. However, the following rather non-portable
script can be used to extract any argv at exec time:

fbt::kern_execve:entry
{
printf("%s", memstr(args[1]->begin_argv, ' ',
args[1]->begin_envv - args[1]->begin_argv));
}

The debug.dtrace.memstr_max sysctl limits the maximum argument size to
memstr().

269263 29-Jul-2014 markj

MFC r264486:
Use the correct format specifiers for wide characters and strings of wide
characters.

269245 29-Jul-2014 markj

MFC r262669:
When our linker merges .SUNW_dof sections from multiple files, it simply
concatenates the DOF tables into one section. Previously, the USDT init
code in drti.o would only look at the first table in the DOF section; with
this change, it iterates over all the tables, passing each DOF table to
the kernel.

PR: 186821

268578 12-Jul-2014 rpaulo

MFC 267929, 267937, 267939, 267940, 267941, 267942, 267987, 268006:

2915 DTrace in a zone should see "cpu", "curpsinfo", et al
2916 DTrace in a zone should be able to access fds[]
2917 DTrace in a zone should have limited provider access
4477 DTrace should speak JSON
Add stubs for CTF functions which are not yet implemented.
4474 DTrace Userland CTF Support
4475 DTrace userland Keyword
4476 DTrace tests should be better citizens
4479 pid provider types
4480 dof emulation is missing checks
4471 DTrace count() with histogram
4472 DTrace full width distribution histograms
4473 DTrace frequency trails


/freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh.out
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d.out
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d.out
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.fds.ksh
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.func_access.ksh
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.getf.ksh
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.procpriv.ksh
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.providers.ksh
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/strtoll
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf
/freebsd-10-stable/cddl/contrib/opensolaris/common/ctf/ctf_open.c
/freebsd-10-stable/cddl/contrib/opensolaris/common/ctf/ctf_types.c
/freebsd-10-stable/cddl/contrib/opensolaris/common/util
dt_aggregate.c
dt_as.c
dt_cc.c
dt_consume.c
dt_decl.c
dt_decl.h
dt_dis.c
dt_error.c
dt_grammar.y
dt_ident.c
dt_impl.h
dt_lex.l
dt_module.c
dt_module.h
dt_open.c
dt_options.c
dt_parser.c
dt_parser.h
dt_pid.c
dt_pid.h
dt_print.c
dt_printf.c
dt_provider.c
dt_xlator.c
dtrace.h
/freebsd-10-stable/cddl/lib/libdtrace/libproc_compat.h
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/dtrace/sdt_subr.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h
/freebsd-10-stable/sys/cddl/dev/dtrace/dtrace_cddl.h
/freebsd-10-stable/sys/modules/dtrace/dtrace/Makefile
266667 25-May-2014 markj

MFC r262329:
Define the KM_NORMALPRI flag for kmem_alloc(), as it is used in some
upstream DTrace code.

MFC r262330:
1452 DTrace buffer autoscaling should be less violent

illumos/illumos-gate@6fb4854bed54ce82bd8610896b64ddebcd4af706

265234 02-May-2014 pfg

MFC r264040:

4248 dtrace(1M) should never create DOF with empty probes section
4249 Only probes from the first DTrace object file will be included

Illumos Revision: 4a20ab41aadcb81c53e72fc65886e964e9add59

Reference:
https://www.illumos.org/issues/4248
https://www.illumos.org/issues/4249

Obtained from: Illumos

262067 17-Feb-2014 avg

MFC r261122: dtrace: remove unexplained 16MB limitation from dt_alloc/dt_zalloc

262060 17-Feb-2014 markj

MFC r260051:
When clearing relocations to __dtrace* symbols, handle both SHT_REL and
SHT_RELA sections properly instead of assuming that the relocation section
is of type SHT_REL.

260670 15-Jan-2014 jhibbits

MFC r256543,r259245,r259421,r259668,r259674

r256543:

Add fasttrap for PowerPC. This is the last piece of the DTrace/ppc puzzle.
It's incomplete, it doesn't contain full instruction emulation, but it should be
sufficient for most cases.

r259245,r259421: (FBT)

FBT now does work fully on PowerPC.

Save r3 before using it for the trap check, else we end up saving the new r3,
containing the trap instruction encoding (0x7c810808), and restoring it back
with the frame on return. This caused it to panic on my ppc32 machine.

r259668,r259674:
Fix a typo in the FBT code.

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


254197 10-Aug-2013 rpaulo

Load the dtraceall module if /dev/dtrace/dtrace doesn't exist.

MFC after: 3 days


253726 28-Jul-2013 pfg

DTrace: re-apply r249426 now that the underlying issues have been solved.

Merge change from illumos:

3519 DTrace fails to resolve const types from fbt
3520 dtrace internal error -- token type 316 is not a valid D
compilation token
3521 clean up dtrace unit tests

Illumos Revision: e98f46c

Reference:
https://www.illumos.org/issues/3519
https://www.illumos.org/issues/3520
https://www.illumos.org/issues/3521

Tested by: Fabian Keil
Obtained from: Illumos
MFC after: 1 month


253725 28-Jul-2013 pfg

DTrace: re-merge remainder of r249367 (original from Illumos).

Bring back some important fixes from Illumos:

3022 DTrace: keys should not affect the sort order when sorting by value
3023 it should be possible to dereference dynamic variables
3024 D integer narrowing needs some work

We particularly avoid the LD_NOLAZYLOAD changes that Illumos made
as those don't apply to FreeBSD and were causing problems in
interactive mode.

Illumos Revision: 13758:23432da34147

Reference:

https://www.illumos.org/issues/3022
https://www.illumos.org/issues/3023
https://www.illumos.org/issues/3024

MFC after: 1 month
Tested by: markj


250820 20-May-2013 markj

Remove a block of code that was not intended to be part of the previous
revision.

X-MFC with: r250812


250812 19-May-2013 markj

Re-introduce another part of r249367. This commit fixes a register leak in
dt_cg_ptrsize() and generally cleans up some of the error handling around
register allocation.

This change corresponds to part of illumos-gate commit e5803b76927480:
3025 register leak in D code generation

Reviewed by: pfg
Obtained from: illumos
MFC after: 1 month


250574 12-May-2013 markj

Bring back part of r249367 by adding DTrace's temporal option, which allows
users to guarantee that the output of DTrace scripts will be time-ordered.
This option is enabled by adding the line

#pragma D option temporal

to the beginning of a script, or by adding '-x temporal' to the arguments of
dtrace(1).

This change fixes a bug in the original port of the temporal option. This
bug was causing some assertions to fail, so they had been disabled; in this
revision the assertions are working properly and are enabled.

The DTrace version number has been bumped from 1.9.0 to 1.9.1 to reflect
the language change that's being introduced.

This change corresponds to part of illumos-gate commit e5803b76927480:
3021 option for time-ordered output from dtrace(1M)

Reviewed by: pfg
Obtained from: illumos
MFC after: 1 month


249884 25-Apr-2013 avg

revert r248644 because of the regression for usdt probes

USDT probes are advertised to kernel by initialization code with
atrribute((constructor))). It seems that on Solaris the .init-ish code
of the main object is executed before RD_PREINIT point is hit. On
FreeBSD that is not the case. And because on FreeBSD there is no other
well-defined point between RD_PREINIT and main() we have to parse a
DTrace script when main is hit, for time being.

A footnote: currently we actually post RD_POSTINIT event, but that's a
bug because the event is triggered by hitting r_debug_state which
happens before any init code is executed.

Reported by: markj


249575 17-Apr-2013 pfg

DTrace: Revert r249426

This change actually depends on r249367 which had to be reverted

Pointy Hat: pfg


249573 17-Apr-2013 pfg

DTrace: Revert r249367

The following change from illumos brought caused DTrace to
pause in an interactive environment:

3026 libdtrace should set LD_NOLAZYLOAD=1 to help the pid provider

This was not detected during testing because it doesn't
affect scripts.

We shouldn't be changing the environment, especially since the
LD_NOLAZYLOAD option doesn't apply to our (GNU) ld.
Unfortunately the change from upstream was made in such a way
that it is very difficult to separate this change from the
others so, at least for now, it's better to just revert
everything.

Reference:
https://www.illumos.org/issues/3026

Reported by: Navdeep Parhar and Mark Johnston


249563 16-Apr-2013 pfg

DTrace: print() should try to resolve function pointers

Merge changes from illumos:

3675 DTrace print() should try to resolve function pointers
3676 dt_print_enum hardcodes a value of zero

Illumos Revision: b1fa6326238973aeaf12c34fcda75985b6c06be1

Reference:
https://www.illumos.org/issues/3675
https://www.illumos.org/issues/3676

Obtained from: Illumos
MFC after: 1 month


249426 12-Apr-2013 pfg

Dtrace: resolve const types from fbt and other fixes.

Merge change from illumos:

3519 DTrace fails to resolve const types from fbt
3520 dtrace internal error -- token type 316 is not a valid D
compilation token
3521 clean up dtrace unit tests

Illumos Revision: e98f46c

Reference:
https://www.illumos.org/issues/3519
https://www.illumos.org/issues/3520
https://www.illumos.org/issues/3521

Tested by: Fabian Keil
Obtained from: Illumos
MFC after: 1 month


249367 11-Apr-2013 pfg

DTrace: option for time-ordered output

Merge changes from illumos:

3021 option for time-ordered output from dtrace(1M)
3022 DTrace: keys should not affect the sort order when sorting by value
3023 it should be possible to dereference dynamic variables
3024 D integer narrowing needs some work
3025 register leak in D code generation
3026 libdtrace should set LD_NOLAZYLOAD=1 to help the pid provider

This brings yet another feature implemented in upstream DTrace.
A complete description is available here:
http://dtrace.org/blogs/ahl/2012/07/28/my-new-dtrace-favorite/

This change bumps the DT_VERS_* number to 1.9.1 in
accordance to what is done in illumos.

This change was somewhat complicated because upstream is mixed many
changes in an individual commit and some of the tests don't really
apply to us.

There are also appear to be differences in timestamping with Solaris
so we had to workaround some assertions making sure no regression
happened.

Special thanks to Fabian Keil for changes and testing.

Illumos Revisions: 13758:23432da34147

Reference:
https://www.illumos.org/issues/3021
https://www.illumos.org/issues/3022
https://www.illumos.org/issues/3023
https://www.illumos.org/issues/3024
https://www.illumos.org/issues/3025
https://www.illumos.org/issues/1694

Tested by: Fabian Keil
Obtained from: Illumos
MFC after: 1 months


248848 28-Mar-2013 gnn

Commit a patch that fixes a problem in the #pragma statement when searching
for and loading dependent modules. This addresses a bug seen with
io.d where it was being doubly included.

PR: 171678
Submitted by: Mark Johnston
MFC after: 2 weeks


248708 25-Mar-2013 pfg

Dtrace: Add SUN MDB-like type-aware print() action.

Merge change from illumos:

1694 Add type-aware print() action

This is a very nice feature implemented in upstream Dtrace.
A complete description is available here:
http://dtrace.org/blogs/eschrock/2011/10/26/your-mdb-fell-into-my-dtrace/

This change bumps the DT_VERS_* number to 1.9.0 in
accordance to what is done in illumos.

While here also include some minor cleanups to ease further merging
and appease clang with a fix by Fabian Keil.

Illumos Revisions: 13501:c3a7090dbc16
13483:f413e6c5d297

Reference:
https://www.illumos.org/issues/1560
https://www.illumos.org/issues/1694

Tested by: Fabian Keil
Obtained from: Illumos
MFC after: 1 month


248706 25-Mar-2013 pfg

Dtrace: add toupper()/tolower() and enhancements to lltostr().

Merge changes from illumos:

1451 DTrace needs toupper()/tolower() subroutines
1457 lltostr() D subroutine should take an optional base

This change bumps the DT_VERS_* number to 1.8.1 in
accordance to what is done in illumos.

The test suite we currently include is outdated and
doesnt support some updates in tst.subr.d which had to
be left out for now.

Illumos Revisions: r13458 5e394d8db762
r13459 c3454574dd1a

Reference:
https://www.illumos.org/issues/1451
https://www.illumos.org/issues/1457

Tested by: Fabian Keil
Obtained from: Illumos
MFC after: 1 month


248690 24-Mar-2013 pfg

Dtrace: add optional size argument to tracemem().

Merge change from illumos:

1455 DTrace tracemem() should take an optional size argument

Our local enhancements to dt_print_bytes were equivalent to
those in illumos but we made it match the illumos version
to ease further code merges.

For now leave out tst.smallsize.d and tst.smallsize.d.out
since those don't seem to work cleanly on FreeBSD.

This change bumps the DT_VERS_* number to 1.7.1 in accordance
to what is done in illumos.

Illumos Revision: 13457:571b0355c2e3

Reference:
https://www.illumos.org/issues/1455

Tested by: Fabian Keil
Obtained from: Illumos
MFC after: 1 month


248644 23-Mar-2013 avg

dtrace: ensure that we can always catch a process (e.g. when -c is used)

It is not guaranteed that a program has a symbol table entry for main
and thus that it would be possible to set a breakpoint on it.

Reviewed by: rpaulo
Discussed with: rpaulo
MFC after: 13 days


241021 28-Sep-2012 kevlo

Make sure that each va_start has one and only one matching va_end,
especially in error cases.


238979 01-Aug-2012 gnn

When we return with an error we cannot unlock the mutex, because
it's been freed. Protect against that, hopefully unlikely, case.

Reviewed by: rpaulo
MFC after: 2 weeks


238558 17-Jul-2012 pfg

Dtrace: improve handling of library paths.

Merge changes from illumos

906 dtrace depends_on pragma should search all library paths, not just the
current one

949 dtrace should only include the first instance of a library found on
its library path

Illumos Revisions: 13353:936a1e45726c
13354:2b2c36a81512

Reference:
https://www.illumos.org/issues/906
https://www.illumos.org/issues/949

Tested by: Fabian Keil
Obtained from: Illumos
MFC after: 3 weeks


238509 15-Jul-2012 pfg

Use libc's strndup() instead of Dtrace's reimplementation.

Corresponds partially to OpenSolaris change:
PSARC 2010/299 GNU/Linux/BSD compatibility functions
6901783 strndup would be nice

MFC after: 2 weeks


238457 14-Jul-2012 pfg

Merge illumos commit 13455:7205f7794835

1458 D compiler fails to generate error on sizeof() an undefined struct

Reference:
https://www.illumos.org/issues/1458

Tested by: Fabian Keil
MFC after: 3 weeks


238071 03-Jul-2012 dim

Fix clang warning, introduced in the recent dtrace import.

MFC after: 3 days


237716 28-Jun-2012 pfg

Safer fix for building with Clang.

error: format specifies type 'long long' but the argument
has type 'int64_t' (aka 'long')

Reported by: Ed Maste


237714 28-Jun-2012 pfg

Fix build with Clang.

error: format specifies type 'long long' but the argument
has type 'int64_t' (aka 'long')

Reported by: Ed Maste


237624 27-Jun-2012 pfg

Bring llquantize support into Dtrace.

Bryan Cantrill implemented the equivalent of semi-log graph
paper for Dtrace so llquantize will use one logarithmic and
one linear scale.

Special thanks to Mark Peek for providing fix to an
assertion and to Fabian Keill for testing the port.

Illumos Revision: 13355:15b74a2a9a9d

Reference:
https://www.illumos/issues/905

Obtained from: Illumos
Tested by: Fabian Keill, mp
MFC after: 4 days


234691 26-Apr-2012 rstone

Implement the D "cpu" variable, which returns curcpu. I have chosen not
to follow the example of OpenSolaris and its descendants, which implemented
cpu as an inline that took a value out of curthread. At certain points in
the FreeBSD scheduler curthread->td_oncpu will no longer be valid (in
particukar, just before the thread gets descheduled) so instead I have
implemented this as its own built-in variable.

Sponsored by: Sandvine Inc.
MFC after: 1 week


234234 13-Apr-2012 gnn

Change SIGUSR1 to SIGTHR to properly wake up a process that is being
traced. The use of SIGUSR1 caused traced processes (those attached to
with dtrace -p) to exit when dtrace exited.

MFC in: 1 week


228580 16-Dec-2011 dim

In cddl/contrib/opensolaris/lib/libdtrace/common/dt_handle.c, some
uint64_t values are snprintf'd using %llx. On amd64, uint64_t is
typedef'd as unsigned long, so cast the values to u_longlong_t, as is
done similarly in the rest of the file.

MFC after: 1 week


228579 16-Dec-2011 dim

In cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c, some
uint64_t values are snprintf'd using %llx. On amd64, uint64_t is
typedef'd as unsigned long, so cast the values to u_longlong_t, as is
done similarly in the rest of the file.

MFC after: 1 week


228550 15-Dec-2011 dim

In cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c, the
dt_popc() function assumes that either _ILP32 or _LP64 is defined,
otherwise it has no suitable implementation.

However, the _ILP32 and _LP64 macros come from isa_defs.h, which is not
included in this file. Add the include now, to get the macros defined.

MFC after: 1 week


228549 15-Dec-2011 dim

In cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c, use the
correct printf format for a key_t (aka long).

MFC after: 1 week


228547 15-Dec-2011 dim

Cast away a clang alignment warning in drti.c's fixsymbol() function.
This code only runs on i386 and amd64, so there should be no problems if
buf + sec->dofs_offset is not aligned (which is unlikely anyway).

MFC after: 1 week


223293 19-Jun-2011 simon

Do not use #warning to warn about missing implementation of dt_popc(),
but just have a comment that this is broken.

This is just a bandaid until somebody can fix this correctly. The code
is just a broken as it was before r223262 - now buildworld just doesn't
fail.

Tested by: i386 + amd64 buildworld
With hat: benl co-mentor


223262 18-Jun-2011 benl

Fix clang warnings.

Approved by: philip (mentor)


212495 12-Sep-2010 rpaulo

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


212462 11-Sep-2010 rpaulo

Disable debug by default.

Sponsored by: The FreeBSD Foundation


212414 10-Sep-2010 rpaulo

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


212358 09-Sep-2010 rpaulo

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


212092 01-Sep-2010 rpaulo

Include <sys/sdt.h> on a generated header.

Sponsored by: The FreeBSD Foundation


211554 21-Aug-2010 rpaulo

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


210776 02-Aug-2010 rpaulo

Fix another mismerge: bring back the definition of DT_MUTEX_HELD().


210775 02-Aug-2010 rpaulo

Fix the result of a mismerge. MUTEX_HELD should be DT_MUTEX_HELD() and
Plmid() is not supposed to be called.


210767 02-Aug-2010 rpaulo

MFV OpenSolaris DTrace userland bits.


210695 31-Jul-2010 rpaulo

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


210692 31-Jul-2010 rpaulo

Update to the new proc_detach() function.

Sponsored by: The FreeBSD Foundation


210425 23-Jul-2010 avg

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


209358 20-Jun-2010 marcel

Unbreak platforms with char unsigned by default. Oddly enough, GCC isn't
satisfied with a simple cast to int in the check against EOF, so the fix
is a bit involved by actually having to go through a temporary variable.


209305 18-Jun-2010 kan

Do not allow EOF token to be put back into input buffer.

This reimplements previous change from r20930 in more generic way.

MFC after: 1 week


209030 11-Jun-2010 kan

In dtrace lexer, do not unput token if it is EOF.

This is harmless with OpenSolaris fex and yacc, but with FreeBSD
causes '\xff' symbol to be physically put into input buffer, causing
subsequent syntax error.

MFC after: 1 week


187347 16-Jan-2009 jhb

Correct the sense of the "use32" terenary operator so that it uses
'lib32' for 32-bit binaries on amd64 and 'lib' for 64-bit binaries.
Remove an #ifdef __i386__ that defined use32 to the wrong value on
i386 to workaround the bug in the terenary operator.

MFC after: 1 month


184696 05-Nov-2008 rodrigc

Merge latest DTrace changes from Perforce.

Approved by: jb


183153 18-Sep-2008 imp

Mips doesn't have a long double that's different in size from double.


178576 26-Apr-2008 jb

* Handle the different ioctl design.
* Add a couple of FreeBSD action extensions.


178575 26-Apr-2008 jb

Make this file compile cleanly.


178574 26-Apr-2008 jb

Leave out some header files.


178573 26-Apr-2008 jb

* Handle building on FreeBSD for i386 and amd64.
* Add stubs for the other FreeBSD arches.
* Make the file compile cleanly.


178572 26-Apr-2008 jb

* Make this file compile cleanly.
* Add FreeBSD constructor/destructor definitions.


178570 26-Apr-2008 jb

* Add FreeBSD action extensions.
* Get the kernel module file name rather than hard-coding it like on Solaris.
* Use FreeBSD's process library API.
* Handle FreeBSD's different lock types.
* Get the list of loaded providers via a syscall.


178569 26-Apr-2008 jb

* Handle the different ioctl design.
* Make this file compile cleanly.


178568 26-Apr-2008 jb

There is a lot of commented out code here which applies to future work
for userland tracing.

For now we need the basic functions to be in place so that DTrace can
be used for kernel tracing.


178567 26-Apr-2008 jb

Leave out a header file.


178566 26-Apr-2008 jb

Merge FreeBSD include file changes with some code that should have come
in on the vendor branch.


178565 26-Apr-2008 jb

* Use FreeBSD's process library instead of the Solaris one.
* There are a few placeholders in here for which there isn't libproc
support code yet. This is relevent to userland tracing. This set of
commits is designed to get kernel tracing up and running, with the
userland stuff to follow later.


178564 26-Apr-2008 jb

Leave out the hook that Solaris has into it's rtld.


178563 26-Apr-2008 jb

* Add a couple of action definitions for FreeBSD extensions.
* Handle the different ioctl design.
* Add support for the get and set error location.
* Add support for freopen().


178562 26-Apr-2008 jb

* Handle the different ioctl design.
* Make the file compile cleanly.


178561 26-Apr-2008 jb

There are many places in libdtrace where errno can be set. When an
error is returned all the way back to the dtrace app, it's hard to
figure out where that error came from.

Add a couple of functions to get and set the error location which can
be optionally compiled into the library.


178560 26-Apr-2008 jb

Add some error definitions for FreeBSD action extensions.


178559 26-Apr-2008 jb

* Make this file compile cleanly.
* Use FreeBSD's kld syscalls to get kernel module information instead
of using an object file system like Solaris uses.


178558 26-Apr-2008 jb

* Handle the different ioctl design.
* Use FreeBSD's process library API.
* Make the file compile cleanly.


178557 26-Apr-2008 jb

Just leave out a few includes to compile this on FreeBSD.


178556 26-Apr-2008 jb

* Get the maximum number of CPUs via a sysctl.
* Handle the different ioctl design.
* Support the freopen() changes.
* Use functions in FreeBSD's process library rather than the CDDL
library that Solaris has which sits on top of their process file
system and is therefore unsuitable for use on FreeBSD. The libproc
API for FreeBSD is deliberately different to that on Solaris because
Sun wouldn't release the libproc.h header under a BSD license.


178555 26-Apr-2008 jb

* Define YY_INPUT for flex since input() can't be re-defined.
* On FreeBSD define both LITTLE_ENDIAN and BIG_ENDIAN and then set the
BYTE_ORDER to the one we are using. On Solaris they define one or
the other but not both. For us to keep using FreeBSD header files,
we need to use endian definitions the same way we do in pure BSD
code.


178553 26-Apr-2008 jb

Handle the different level of indirection between ioctl on SYSV vs BSD.


178552 26-Apr-2008 jb

freopen() on FreeBSD behaves differently to the Solaris one.


178551 26-Apr-2008 jb

* Use a portable POSIX timed wait.
* Handle the different ioctl format.


178550 26-Apr-2008 jb

* Fix a function prototype.
* Allow for the different level of indirection between SYSV's ioctl and BSD's.
* Map a couple of sysconf definitions to one that FreeBSD has.


178547 26-Apr-2008 jb

'echo' behaviour differs between SYSV and BSD.


178529 26-Apr-2008 jb

This commit was generated by cvs2svn to compensate for changes in r178528,
which included commits to RCS files with non-trunk default branches.


178480 25-Apr-2008 jb

This commit was generated by cvs2svn to compensate for changes in r178479,
which included commits to RCS files with non-trunk default branches.