FUNCTION::USTACK(3stap) Context Functions FUNCTION::USTACK(3stap)

# [NAME](#NAME)

function::ustack - Return address at given depth of user stack backtrace

# [SYNOPSIS](#SYNOPSIS)

```


    ustack:long(n:long)
```

# [ARGUMENTS](#ARGUMENTS)

*n*

number of levels to descend in the stack.

# [DESCRIPTION](#DESCRIPTION)

Performs a simple (user space) backtrace, and returns the element at the specified position. The results of the backtrace itself are cached, so that the backtrace computation is performed at most once no matter how many times **ustack** is called, or in what order.

# [SEE ALSO0](#SEE_ALSO0)

[*tapset::ucontext-symbols*(3stap)](/man/enterprise-packages/systemtap/tapset::ucontext-symbols.3stap)

September 2026 SystemTap Tapset Reference Ver

---

Document: function::ustack(3stap) from systemtap 5.6-r0 (Chainguard OS)
Source: https://sourceware.org/git/systemtap.git
