xref: /freebsd/lib/libsys/utrace.2 (revision 8aac90f18aef7c9eea906c3ff9a001ca7b94f375)
1.\"	$NetBSD: utrace.2,v 1.11 2003/04/24 12:17:49 wiz Exp $
2.\"
3.\" Copyright (c) 2000 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Gregory McGarry <g.mcgarry@ieee.org>.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28.\"
29.Dd December 11, 2015
30.Dt UTRACE 2
31.Os
32.Sh NAME
33.Nm utrace
34.Nd insert user record in ktrace log
35.Sh LIBRARY
36.Lb libc
37.Sh SYNOPSIS
38.In sys/param.h
39.In sys/time.h
40.In sys/uio.h
41.In sys/ktrace.h
42.Ft int
43.Fn utrace "const void *addr" "size_t len"
44.Sh DESCRIPTION
45Adds a record to the process trace with information supplied by user.
46The record contains
47.Fa len
48bytes from memory pointed to by
49.Fa addr .
50This call only has an effect if the calling process is being traced.
51.Sh RETURN VALUES
52.Rv -std
53.Sh ERRORS
54.Bl -tag -width Er
55.It Bq Er EINVAL
56Specified data length
57.Fa len
58was bigger than
59.Dv KTR_USER_MAXLEN .
60.It Bq Er ENOMEM
61Insufficient memory to honor the request.
62.It Bq Er ENOSYS
63Currently running kernel was compiled without
64.Xr ktrace 2
65support
66.Pq Cd "options KTRACE" .
67.El
68.Sh SEE ALSO
69.Xr kdump 1 ,
70.Xr ktrace 1 ,
71.Xr truss 1 ,
72.Xr ktrace 2 ,
73.Xr sysdecode_utrace 3
74.Sh HISTORY
75The
76.Fn utrace
77system call first appeared in
78.Fx 2.2 .
79