Skip to content

Commit

Permalink
fix some dtrace
Browse files Browse the repository at this point in the history
  • Loading branch information
laffer1 committed Nov 20, 2024
1 parent e1ffe4b commit ddfcf00
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
30 changes: 28 additions & 2 deletions cddl/contrib/opensolaris/cmd/dtrace/dtrace.1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
.\" CDDL HEADER END
.\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
.\"
.\"
.Dd February 25, 2020
.Dd September 7, 2021
.Dt DTRACE 1
.Os
.Sh NAME
Expand Down Expand Up @@ -576,6 +575,17 @@ Must be specified in number-per-second with the
suffix.
.It Sy cpu Ns = Ns Ar scalar
Specifies the CPU on which to enable tracing.
.It Sy cpp
Run a C preprocessor over input files.
Same as the
.Fl C
flag.
.It Sy cpppath Ns = Ns Ar path
Use the specified path for the C preprocessor rather than
searching for
.Dq cpp
in
.Ev PATH .
.It Sy defaultargs
Allow references to unspecified macro arguments.
.It Sy destructive
Expand All @@ -601,8 +611,20 @@ Number of default stack frames for
.It Sy jstackstrsize Ns = Ns Ar scalar
Default string space size for
.Fn jstack .
.It Sy ldpath Ns = Ns Ar path
When
.Fl G
is specified, use the specified path for a static linker
rather than searching for
.Dq "ld"
in
.Ev PATH .
.It Sy libdir Ns = Ns Ar path
Add a directory to the system library path.
.It Sy nspec Ns = Ns Ar scalar
Number of speculations.
.It Sy nolibs
Do not load D system libraries.
.It Sy quiet
Set quiet mode.
Same as the
Expand All @@ -626,6 +648,10 @@ output.
Rate of status checking.
.It Sy switchrate Ns = Ns Ar time
Rate of buffer switching.
.It Sy syslibdir Ns = Ns Ar path
Path to system libraries.
Defaults to
.Pa /usr/lib/dtrace .
.It Sy ustackframes Ns = Ns Ar scalar
Maximum number of userspace stack frames to unwind when executing the
.Fn ustack
Expand Down
9 changes: 9 additions & 0 deletions cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include <libproc.h>
#endif
#ifdef __MidnightBSD__
#include <locale.h>
#include <spawn.h>
#endif

Expand Down Expand Up @@ -1316,6 +1317,14 @@ main(int argc, char *argv[])
struct ps_prochandle *P;
pid_t pid;

#ifdef __MidnightBSD__
/* For %'d and the like. */
(void) setlocale(LC_NUMERIC, "");

/* For %T. */
(void) setlocale(LC_TIME, "");
#endif

g_pname = basename(argv[0]);

if (argc == 1)
Expand Down

0 comments on commit ddfcf00

Please sign in to comment.