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

# [NAME](#NAME)

function::target - Return the process ID of the target process

# [SYNOPSIS](#SYNOPSIS)

```


    target:long()
```

# [ARGUMENTS](#ARGUMENTS)

None

# [DESCRIPTION](#DESCRIPTION)

This function returns the process ID of the target process. This is useful in conjunction with the -x PID or -c CMD command-line options to stap. An example of its use is to create scripts that filter on a specific process.

-x &lt;pid&gt; **target** returns the pid specified by -x

-c &lt;command&gt; **target** returns the pid for the executed command specified by -c

# [SEE ALSO0](#SEE_ALSO0)

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

September 2026 SystemTap Tapset Reference Ver

---

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