1.\" $NetBSD: utrace.2,v 1.7 2002/02/08 01:28:23 ross 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.\" 3. All advertising materials mentioning features or use of this software 18.\" must display the following acknowledgement: 19.\" This product includes software developed by the NetBSD 20.\" Foundation, Inc. and its contributors. 21.\" 4. Neither the name of The NetBSD Foundation nor the names of its 22.\" contributors may be used to endorse or promote products derived 23.\" from this software without specific prior written permission. 24.\" 25.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 26.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 27.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 28.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 29.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 30.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35.\" 36.Dd December 28, 2000 37.Dt UTRACE 2 38.Os 39.Sh NAME 40.Nm utrace 41.Nd insert user record to ktrace records 42.Sh LIBRARY 43.Lb libc 44.Sh SYNOPSIS 45.Fd #include \*[Lt]sys/types.h\*[Gt] 46.Fd #include \*[Lt]sys/param.h\*[Gt] 47.Fd #include \*[Lt]sys/time.h\*[Gt] 48.Fd #include \*[Lt]sys/uio.h\*[Gt] 49.Fd #include \*[Lt]sys/ktrace.h\*[Gt] 50.Ft int 51.Fn utrace "const char *label" "void *addr" "size_t len" 52.Sh DESCRIPTION 53Adds a record to process trace with information supplied by user. 54The record is identified by 55.Fa label 56and contains 57.Fa len 58bytes from memory pointed to by 59.Fa addr . 60This call has only effect if the caller process is being traced. 61.Sh RETURN VALUES 62Upon successful completion, a value of 0 is returned. 63Otherwise, a value of -1 is returned and 64.Va errno 65is set to indicate the error. 66.Sh ERRORS 67.Bl -tag -width Er 68.It Bq Er ENOSYS 69Currently running kernel was compiled without 70.Xr ktrace 2 71support (option KTRACE). 72.It Bq Er EINVAL 73Specified data length 74.Fa len 75was bigger than 76.Dv KTR_USER_MAXLEN . 77.El 78.Sh SEE ALSO 79.Xr kdump 1 , 80.Xr ktrace 1 , 81.Xr ktruss 1 , 82.Xr fktrace 2 , 83.Xr ktrace 2 , 84.Xr options 4 85.Sh HISTORY 86The 87.Fn utrace 88system call first appeared in 89.Fx 2.2 . 90It was added to 91.Nx 92in 93.Nx 1.6 . 94The 95.Fa label 96argument is 97.Nx 98extension. 99