History log of /freebsd-current/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c
Revision Date Author Comments
# 1112883e 27-Jul-2023 Eric van Gyzen <vangyzen@FreeBSD.org>

dtrace: remove dead code for PR_REQUESTED

libproc's PR_REQUESTED is not implemented on FreeBSD. Remove dead code
in dtrace that would handle it.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D41225


# bcbce2a2 25-Jul-2023 Eric van Gyzen <vangyzen@FreeBSD.org>

dtrace: do not overload libproc flags

dtrace stored its PR_RLC and PR_KLC flags in the proc_handle's flags,
where they collided with PATTACH_FORCE and PATTACH_RDONLY, respectively.
Thus, Psetflags(PR_KLC) effectively also set the PATTACH_RDONLY flag.

Since the flags are private to dtrace (at least on FreeBSD), store them in
dtrace's own dt_proc structure instead.

On FreeBSD, either PR_RLC or PR_KLC was always set, so remove code that
would handle the case where neither was set.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D41121


# 837f6ecd 25-Jul-2023 Eric van Gyzen <vangyzen@FreeBSD.org>

dtrace: remove illumos code from dt_proc.c

The illumos #ifdef's in this file make it harder to read and maintain.
There is little change upstream, and increasing changes for FreeBSD.
Remove the illumos code with `unifdef`. The only manual changes here
are the #includes and #defines at the top, and removing blank lines.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D41173


# dad11f99 10-Jul-2023 Eric van Gyzen <vangyzen@FreeBSD.org>

dtrace: prevent forked child from running after an error condition

The pid/killonerror test uses an invalid probe specifier to verify that
the child process is killed. It occasionally fails because the "date"
command is allowed to run long enough to print the date. This is harmless
in this case, but is clearly not ideal.

When the dt_proc_control thread is about to exit, and the dtrace command
forked the child, do not make the child runnable.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D40976


# 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 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


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

Add an envp argument to proc_create().

This is needed to support dtrace's -x setenv option.

MFC after: 2 weeks


# 732f2c69 27-Oct-2017 Ed Maste <emaste@FreeBSD.org>

libdtrace: replace "DOODAD" with more descriptive string

Previously some unimplemented libdtrace routines printed the function,
file and line number, followed by "DOODAD." That is not particularly
informative, so replace it with a message reporting the actual issue.

Sponsored by: The FreeBSD Foundation


# 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 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


# 03836978 16-Apr-2013 Pedro F. Giffuni <pfg@FreeBSD.org>

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


# 26d121f5 01-Aug-2012 George V. Neville-Neil <gnn@FreeBSD.org>

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


# 72cc304a 13-Apr-2012 George V. Neville-Neil <gnn@FreeBSD.org>

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


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# 0f2bd1e8 21-Aug-2010 Rui Paulo <rpaulo@FreeBSD.org>

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


# 31a396ad 02-Aug-2010 Rui Paulo <rpaulo@FreeBSD.org>

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


# 1e634b7b 31-Jul-2010 Rui Paulo <rpaulo@FreeBSD.org>

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


# f28bde1a 31-Jul-2010 Rui Paulo <rpaulo@FreeBSD.org>

Update to the new proc_detach() function.

Sponsored by: The FreeBSD Foundation


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# 56b35563 05-Nov-2008 Craig Rodrigues <rodrigc@FreeBSD.org>

Merge latest DTrace changes from Perforce.

Approved by: jb


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# bbda5851 25-Apr-2008 John Birrell <jb@FreeBSD.org>

* 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.