---
name: "utrace"
section: "2"
platform: "linux"
package: "freebsd-manpages"
version: "6.0-5"
release: "Debian 4.0 (Etch)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/utrace"
---

# utrace(2)

insert user record in ktrace log

## NAME

**utrace** – insert user record in ktrace log

## LIBRARY

Standard C Library (libc, -lc)

## SYNOPSIS

**#include \<sys/types.h\>**

**#include \<sys/param.h\>**

**#include \<sys/time.h\>**

**#include \<sys/uio.h\>**

**#include \<sys/ktrace.h\>**

*int*\

**utrace**(*const void \*addr*, *size\_t len*);

## DESCRIPTION

Adds a record to the process trace with information supplied by user. The record contains *len* bytes from memory pointed to by *addr*. This call only has an effect if the calling process is being traced.

## RETURN VALUES

The **utrace()** function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error.

## ERRORS

- \[EINVAL\]

  Specified data length *len* was bigger than KTR\_USER\_MAXLEN.

- \[ENOMEM\]

  Insufficient memory to honor the request.

- \[ENOSYS\]

  Currently running kernel was compiled without [ktrace(2)](/ktrace/2.md) support (**options KTRACE**).

## SEE ALSO

[kdump(1)](/kdump/1.md), [ktrace(1)](/ktrace/1.md), [ktrace(2)](/ktrace/2.md)

## HISTORY

The **utrace**() system call first appeared in FreeBSD 2.2.
