<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>function::target</title><meta name="generator" content="DocBook XSL Stylesheets V1.69.1"><link rel="start" href="index.html" title="SystemTap Tapset Reference Manual"><link rel="up" href="ch02.html" title="Chapter 2. Context Functions"><link rel="prev" href="re60.html" title="function::symname"><link rel="next" href="re62.html" title="function::task_backtrace"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span>function::target</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="re60.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Context Functions</th><td width="20%" align="right"> <a accesskey="n" href="re62.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="API-target"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>function::target — Return the process ID of the target process </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="programlisting"> target:long() </pre></div><div class="refsect1" lang="en"><a name="idp5320192"></a><h2>Arguments</h2><p> None </p></div><div class="refsect1" lang="en"><a name="idp5321408"></a><h2>Description</h2><p> 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. </p><p> -x <pid> <code class="function">target</code> returns the pid specified by -x </p><p> -c <command> <code class="function">target</code> returns the pid for the executed command specified by -c </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="re60.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="re62.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span>function::symname</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span>function::task_backtrace</span></td></tr></table></div></body></html>