History log of /freebsd-src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c (Results 1 – 25 of 49)
Revision Date Author Comments
# 096a5c6c 25-Jan-2025 Mark Johnston <markj@FreeBSD.org>

libdtrace: Generalize handling of data models a bit

Make it easier to support data models other than ILP32 and LP64 by
avoiding constructs which assume that it must be one or the other.

No function

libdtrace: Generalize handling of data models a bit

Make it easier to support data models other than ILP32 and LP64 by
avoiding constructs which assume that it must be one or the other.

No functional change intended.

MFC after: 2 weeks
Sponsored by: Innovate UK

show more ...


# 93f27766 03-Jan-2024 Domagoj Stolfa <domagoj.stolfa@gmail.com>

dtrace: Add the 'oformat' libdtrace option

This option can be used to specify a format to use in DTrace output.
The following formats are supported:
- json
- xml
- html
- none (default DTrace ou

dtrace: Add the 'oformat' libdtrace option

This option can be used to specify a format to use in DTrace output.
The following formats are supported:
- json
- xml
- html
- none (default DTrace output)

This is implemented using libxo and integrated into libdtrace. Client
code only works with the following API:

- dtrace_oformat_setup(dtrace_hdl_t *) -- to be called when output is starting.
- dtrace_oformat_teardown(dtrace_hdl_t *) -- to be called when output is finished
- dtrace_oformat(dtrace_hdl_t *) -- check if oformat is enabled.
- dtrace_set_outfp(FILE *) -- sets the output file for oformat.
- Ensure that oformat is correctly checked in the drop handler and record
processing callbacks.

This commit also adds tests which check if the generated output is
valid (JSON, XML) and extends the dtrace(1) describing the structured output.

Reviewed by: markj
Discussed with: phil
MFC after: 2 months
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D41745

show more ...


# ecdd0b48 24-Jan-2023 Kristof Provost <kp@FreeBSD.org>

dtrace: remove stray {

Fixes: da81cc6035f8283b6adda1ef466977e8c1c5389e
PR: 269128


# da81cc60 24-Jan-2023 Andrew Gallatin <gallatin@FreeBSD.org>

dtrace: conditionally load the systrace_linux klds when loading dtrace.

When dtrace starts, it tries to detect if the dtrace klds are loaded,
and if not, it loads them by loading the dtraceall kld.

dtrace: conditionally load the systrace_linux klds when loading dtrace.

When dtrace starts, it tries to detect if the dtrace klds are loaded,
and if not, it loads them by loading the dtraceall kld. This module
depends on most dtrace modules, including systrace for the native
freebsd and freebsd32 ABIs. However, it does not depend on the
systrace_linux klds, as they in turn depend on the linux ABI klds, and
we don't want to load an ABI module that the user has not explicitly
requested. This can leave a naive user in a state where they think all
syscall providers have been loaded, yet linux ABI syscalls are
"invisible" to dtrace.

To fix this, check to see if the linux ABI modules are loaded. If they
are, then load their systrace klds.

Reviewed by: markj, (emaste & jhb, earlier versions)
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D37986

show more ...


# 2179a159 11-Oct-2022 Christos Margiolis <christos@FreeBSD.org>

libdtrace: Add kinst support

kinst does not instantiate its probes automatically, it only does so on
demand via an ioctl interface implemented by /dev/kinst. This change
modifies libdtrace to perfo

libdtrace: Add kinst support

kinst does not instantiate its probes automatically, it only does so on
demand via an ioctl interface implemented by /dev/kinst. This change
modifies libdtrace to perform that work when the script references the
kinst provider, similar to the way pid provider probes are implemented.

Reviewed by: markj
MFC after: 3 months
Sponsored by: Google, Inc. (GSoC 2022)
Differential Revision: https://reviews.freebsd.org/D36852

show more ...


# bdd101c4 04-Oct-2022 Mark Johnston <markj@FreeBSD.org>

dtrace: Add a "regs" variable

This allows invop-based providers (i.e., fbt and kinst) to expose the
register file of the CPU at the point where the probe fired. It does
not work for SDT providers b

dtrace: Add a "regs" variable

This allows invop-based providers (i.e., fbt and kinst) to expose the
register file of the CPU at the point where the probe fired. It does
not work for SDT providers because their probes are implemented as plain
function calls and so don't save registers. It's not clear what
semantics "regs" should have for them anyway.

This is akin to "uregs", which nominally provides access to the
userspace registers. In fact, DIF already had a DIF_VAR_REGS variable
defined, it was simply unimplemented.

Usage example: print the contents of %rdi upon each call to
amd64_syscall():

fbt::amd64_syscall:entry {printf("%x", regs[R_RDI]);}

Note that the R_* constants are defined in /usr/lib/dtrace/regs_x86.d.
Currently there are no similar definitions for non-x86 platforms.

Reviewed by: christos
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D36799

show more ...


# 1ef441f6 23-Feb-2022 Mark Johnston <markj@FreeBSD.org>

libdtrace: Add a missing newline to an error message

MFC after: 1 week
Sponsored by: The FreeBSD Foundation


# d8f743dc 28-Feb-2020 Mark Johnston <markj@FreeBSD.org>

Do not load dtraceall.ko if dtrace.ko is already loaded.

This was the intent of the existing code, but instead it would
unconditionally load dtraceall.ko because of a stale errno value.

Reported by

Do not load dtraceall.ko if dtrace.ko is already loaded.

This was the intent of the existing code, but instead it would
unconditionally load dtraceall.ko because of a stale errno value.

Reported by: pho
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

show more ...


# 0b56e7a8 10-Aug-2018 Mark Johnston <markj@FreeBSD.org>

Disable the D subroutines msgsize() and msgdsize().

They are specific to illumos and the corresponding DIF subroutines are
already disabled on FreeBSD.

Reported by: gnn


# 224e0c2f 12-Jan-2018 Mark Johnston <markj@FreeBSD.org>

Add "jid" and "jailname" variables to DTrace.

These return the jail ID and jail name for the traced process,
respectively, and are analogous to "zonename" on Solaris/illumos.
"zonename" is now alias

Add "jid" and "jailname" variables to DTrace.

These return the jail ID and jail name for the traced process,
respectively, and are analogous to "zonename" on Solaris/illumos.
"zonename" is now aliased to "jailname".

Also add some stress tests for the new variables.

Submitted by: Domagoj Stolfa <domagoj.stolfa@gmail.com>
Reviewed by: dteske (previous version)
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D13877

show more ...


# 04006780 03-Dec-2017 Mark Johnston <markj@FreeBSD.org>

Complete support for dtrace's -x setenv option.

This allows one to override the environment for processes created with
dtrace -c. By default, the environment is inherited.

This support was original

Complete support for dtrace's -x setenv option.

This allows one to override the environment for processes created with
dtrace -c. By default, the environment is inherited.

This support was originally merged from illumos in r249367 but was lost
when the commit was later reverted and then brought back piecemeal.

Reported by: Samuel Lepetit <slepetit@apple.com>
MFC after: 2 weeks

show more ...


# eb381eda 24-Nov-2017 Mark Johnston <markj@FreeBSD.org>

Fix the type signature for sx(9) DTrace subroutines.

MFC after: 1 week


# b934b564 12-Sep-2017 Mark Johnston <markj@FreeBSD.org>

Add a O_CLOEXEC use missed in r323166.

PR: 199810
Reported by: Jukka A. Ukkonen <jau789@gmail.com>
MFC after: 3 days


# afd2f355 05-Sep-2017 Mark Johnston <markj@FreeBSD.org>

Use O_CLOEXEC when opening persistent handles in libdtrace.

PR: 199810
Submitted by: jau@iki.fi
MFC after: 1 week


# d935f34b 23-Feb-2017 Mark Johnston <markj@FreeBSD.org>

Fix memory leaks in error cases in libdtrace.

Submitted by: Tom Rix <trix@juniper.net>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D9705


# 375c8b20 12-Nov-2016 Mark Johnston <markj@FreeBSD.org>

Remove the DTrace printt and typeref actions.

These are FreeBSD-specific and were added in r178576 to provide the ability
to pretty-print instances of compound types. However, the print action has
l

Remove the DTrace printt and typeref actions.

These are FreeBSD-specific and were added in r178576 to provide the ability
to pretty-print instances of compound types. However, the print action has
long since been augmented to provide this functionality with a simpler
interface.

Discussed with: gnn
Differential Revision: https://reviews.freebsd.org/D8478

show more ...


# 650f66ac 16-Aug-2016 Mark Johnston <markj@FreeBSD.org>

MFV r304057:
7085 add support for "if" and "else" statements in dtrace

illumos/illumos-gate@c3bd3abd8856e8e75d820f65c58031cd6cbac818

Add syntactic sugar to dtrace: "if" and "else" statements. The s

MFV r304057:
7085 add support for "if" and "else" statements in dtrace

illumos/illumos-gate@c3bd3abd8856e8e75d820f65c58031cd6cbac818

Add syntactic sugar to dtrace: "if" and "else" statements. The sugar is
baked down to standard dtrace features by adding additional clauses with
the appropriate predicates.

Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Bryan Cantrill <bryan@joyent.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Matthew Ahrens <mahrens@delphix.com>

MFC after: 2 weeks
Relnotes: yes

show more ...


# 8436cb81 06-Jun-2015 Mark Johnston <markj@FreeBSD.org>

libdtrace: allow D libraries to declare dependencies on kernel modules

The "depends_on module" pragma can be used to declare a dependency on a
DTrace module, which for kernel probes corresponds to a

libdtrace: allow D libraries to declare dependencies on kernel modules

The "depends_on module" pragma can be used to declare a dependency on a
DTrace module, which for kernel probes corresponds to a KLD. Such
dependencies cannot be checked if the KLD is compiled into the kernel.
Therefore, allow a module dependency to be satisfied if either a kernel
module or a KLD with the specified name is loaded.

Differential Revision: https://reviews.freebsd.org/D2653
Reviewed by: gnn, rpaulo
Reported by: gnn

show more ...


# 0fff3baa 17-May-2015 Mark Johnston <markj@FreeBSD.org>

Respect the libdir option when linking drti.o, rather than hardcoding the
default path of /usr/lib(32)/dtrace.

MFC after: 3 weeks


# 03a5f9f0 18-Feb-2015 Mark Johnston <markj@FreeBSD.org>

Remove drti.o's dependency on libelf. This makes it possible to add DTrace
probes to userland programs and libraries without also needing to link
libelf.

dtrace -G places the __SUNW_dof symbol at th

Remove drti.o's dependency on libelf. This makes it possible to add DTrace
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

show more ...


# bc96366c 17-Jan-2015 Steven Hartland <smh@FreeBSD.org>

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

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.

MFC after: 1 month
Sponsored by: Multiplay

show more ...


# 4ddb46f6 22-Aug-2014 Xin LI <delphij@FreeBSD.org>

Make DTrace stuff compile with C99 standard.


# a43f0be9 26-Jun-2014 Rui Paulo <rpaulo@FreeBSD.org>

MFV illumos

4471 DTrace count() with histogram
4472 DTrace full width distribution histograms
4473 DTrace frequency trails

MFC after: 2 weeks


# 8e648814 26-Jun-2014 Rui Paulo <rpaulo@FreeBSD.org>

MFV illumos

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

MFC after: 2 weeks


# b1f9167f 26-Jun-2014 Rui Paulo <rpaulo@FreeBSD.org>

MFV illumos

4477 DTrace should speak JSON

MFC after: 2 weeks


12