summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2020-08-13 11:26:40 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2020-08-13 11:26:40 +0000
commitbbaf42c1175df984baa58b30aabcee656f39d66c (patch)
tree43aa8cfe6eff15e1df36a6c381286af05ac4a289
parent6e2b3bb17fd24dcdbf8b2011a9668299a05dd9a1 (diff)
Document ioctl interface.
-rw-r--r--share/man/man4/dt.464
1 files changed, 60 insertions, 4 deletions
diff --git a/share/man/man4/dt.4 b/share/man/man4/dt.4
index fffc7758286..57423fdf7c0 100644
--- a/share/man/man4/dt.4
+++ b/share/man/man4/dt.4
@@ -1,4 +1,4 @@
-.\" $OpenBSD: dt.4,v 1.5 2020/05/18 07:03:44 jmc Exp $
+.\" $OpenBSD: dt.4,v 1.6 2020/08/13 11:26:39 mpi Exp $
.\"
.\" Copyright (c) 2019 Martin Pieuchot <mpi@openbsd.org>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: May 18 2020 $
+.Dd $Mdocdate: August 13 2020 $
.Dt DT 4
.Os
.Sh NAME
@@ -33,13 +33,69 @@ This device can only be opened when the
.Va kern.allowdt
.Xr sysctl 2
variable is set.
-.\"Sh IOCTL INTERFACE
-.\"
+.Sh IOCTL INTERFACE
+The
+.Xr ioctl 2
+command codes below are defined in
+.In dev/dt/dtvar.h .
+.Bl -tag -width xxxxxx
+.It Dv DTIOCGPLIST Fa "struct dtioc_probe *dtpr"
+Get available probe entries.
+.Bd -literal
+struct dtioc_probe {
+ size_t dtpr_size;
+ struct dtioc_probe_info *dtpr_probes;
+};
+.Ed
+.Pp
+If
+.Va dtpr_size
+is non-zero, as many probes as possible that can fit into this size
+will be copied into the supplied buffer.
+On exit,
+.Va dtpr_size
+is always set to the total size required to hold all probe entries
+(i.e., it is set to
+.Li sizeof(struct dtioc_probe_info) * dt_nprobes ) .
+.It Dv DTIOCGSTATS Fa "struct dtioc_stat *dtst"
+Get statistics for current recording.
+.Bd -literal
+struct dtioc_stat {
+ uint64_t dtst_readevt;
+ uint64_t dtst_dropevt;
+};
+.Ed
+.It Dv DTIOCRECORD Fa "int on"
+Start or stop recording.
+.It Dv DTIOCPRBENABLE Fa "struct dtioc_req *dtrq"
+Enable the given probe for recording.
+.Bd -literal
+struct dtioc_req {
+ uint32_t dtrq_pbn;
+ struct dt_filter dtrq_filter;
+ uint32_t dtrq_rate;
+ uint64_t dtrq_evtflags;
+};
+.Ed
+.El
.Sh FILES
.Bl -tag -width /dev/dt -compact
.It Pa /dev/dt
dynamic tracing device.
.El
+.Sh ERRORS
+An open of
+.Pa /dev/dt
+will fail if:
+.Bl -tag -width Er
+.It Bq Er EPERM
+the
+.Va kern.allowdt
+.Xr sysctl 2
+variable wasn't set.
+.It Bq Er ENOMEM
+not enough memory space was available.
+.El
.Sh SEE ALSO
.Xr ioctl 2
.\".Xr bt 5 ,