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