ibm-information-center/dist/eclipse/plugins/i5OS.ic.apis_5.4.0.1/p0zprnt.htm

233 lines
7.0 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
<title>Qp0zUprintf()--Print Formatted User Trace Data</title>
<!-- Begin Header Records ========================================== -->
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<!-- Change History: -->
<!-- YYMMDD USERID Change description -->
<!-- Direct1 SCRIPT J converted by B2H R4.1 (346) (CMS) by V2KEA304 -->
<!-- at RCHVMW2 on 17 Feb 1999 at 11:05:09 -->
<!-- Edited by Kersten Feb 02 -->
<!-- This file has undergone error code cleanup on 04/30/02 by JET -->
<!-- End Header Records -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<!-- Java sync-link -->
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
</script>
<a name="Top_Of_Page"></a>
<h2>Qp0zUprintf()--Print Formatted User Trace Data</h2>
<div class="box" style="width: 60%;">
<br>
&nbsp;&nbsp;Syntax<br>
<pre>
#include &lt;qp0ztrc.h&gt;
int Qp0zUprintf(char <em>*format-string</em>, ...);
</pre>
<br>
&nbsp;&nbsp;Service Program Name: QP0ZCPA<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Default Public Authority: *USE<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Threadsafe: Yes<br>
<!-- iddvc RMBR -->
<br>
</div>
<p>The <strong>Qp0zUprintf()</strong> function prints user data specified by
the <em>format-string</em> parameter to the user trace.</p>
<p>If a second parameter, <em>argument-list</em>, is provided, <strong>
Qp0zUprintf()</strong> converts each entry in the <em>argument-list</em> and
writes the entry to the user trace according to the corresponding format
specification in <em>format-string</em>. If there are more entries in <em>
argument-list</em> than format specifications in <em>format-string</em>, the
extra <em>argument-list</em> entries are evaluated and then ignored. If there
are less entries in <em>argument-list</em> than format specifications in <em>
format-string</em>, the user trace output for those entries is undefined, and
the <strong>Qp0zUprintf()</strong> function may return an error.</p>
<p>An application should not use the tracing function in performance critical
code. These functions are intended for debugging exception or error conditions.
The user trace is a permanent user space object named <em>
QP0Z&lt;jobnumber&gt;</em> in the QUSRSYS library. The user trace is created
the first time any thread in a job writes trace output. See the Change User
Trace (CHGUSRTRC), Dump User Trace (DMPUSRTRC) and Delete User Trace
(DLTUSRTRC) CL commands for information about manipulating the user trace
properties and objects.</p>
<br>
<h3>Parameters</h3>
<dl>
<dt><strong><em>format-string</em></strong></dt>
<dd>(Input) The format string representing the format of the data to be
printed. See the <strong>printf()</strong> function in the <a href=
"../books/sc092712.pdf" target="_blank">ILE C/C++ Programmer's Guide</a><img
src="wbpdf.gif" alt="Link to PDF"> for a description of valid format
strings.<br>
<br>
</dd>
<dt><strong><em>... (argument-list)</em></strong></dt>
<dd>(Input) An optional list of arguments that contain entries to be formatted
and printed to the user trace.</dd>
</dl>
<br>
<h3>Authorities</h3>
<p>None.</p>
<br>
<h3>Return Value</h3>
<table cellpadding="5">
<!-- cols="10 90" -->
<tr>
<td align="left" valign="top"><em>value</em></td>
<td align="left" valign="top"><strong>Qp0zUprintf()</strong> was successful.
The value returned is the number of characters successfully printed.</td>
</tr>
<tr>
<td align="left" valign="top"><em>-1</em></td>
<td align="left" valign="top"><strong>Qp0zUprintf()</strong> was not
successful. The <em>errno</em> variable is set to indicate the error.</td>
</tr>
</table>
<br>
<br>
<h3>Error Conditions</h3>
<p>If <strong>Qp0zUprintf()</strong> is not successful, <em>errno</em>
indicates one of the following errors. Under some conditions, <em>errno</em>
could indicate an error other than those listed here.</p>
<dl>
<dt><em>[EINVAL]</em></dt>
<dd>
<p>The value specified for the argument is not correct.</p>
<p>A function was passed incorrect argument values, or an operation was
attempted on an object and the operation specified is not supported for that
type of object.</p>
<p>An argument value is not valid, out of range, or NULL. An invalid <em>
format-string</em> or <em>argument-list</em> was specified.</p>
</dd>
<dt><em>[EFAULT]</em></dt>
<dd>
<p>The address used for an argument is not correct.</p>
<p>In attempting to use an argument in a call, the system detected an address
that is not valid.</p>
<p>While attempting to access a parameter passed to this function, the system
detected an address that is not valid.</p>
</dd>
</dl>
<br>
<h3><a name="USAGE_NOTES">Usage Notes</a></h3>
<ol>
<li>No locks are held on the user trace between calls to the tracing functions.
The user trace can be deleted while in use. The next function that produces
trace output will create the user trace again.<br>
<br>
</li>
<li>If another job on the system has the same job number as an existing user
trace, the existing trace data is cleared, and the trace data from the new job
replaces it.<br>
<br>
</li>
<li>As the format of the user trace records can change, only the following CL
commands can be used to manipulate the user trace properties and objects:<br>
<br>
<ul>
<li>Change User Trace (CHGUSRTRC) can be used to change the characteristics of
the user trace.<br>
<br>
</li>
<li>Dump User Trace (DMPUSRTRC) can be used to dump trace records to a file or
to standard output.<br>
<br>
</li>
<li>Delete User Trace (DLTUSRTRC) can be used to delete the user trace
objects.</li>
</ul>
</li>
</ol>
<br>
<h3>Related Information</h3>
<ul>
<li><a href="p0zdmp.htm">Qp0zDump()</a>--Dump Formatted Storage Trace Data<br>
<br>
</li>
<li><a href="p0zdmps.htm">Qp0zDumpStack()</a>--Dump Formatted Stack Trace
Data<br>
<br>
</li>
<li><a href="p0zdmpt.htm">Qp0zDumpTargetStack()</a>--Dump Formatted Stack Trace
Data of the Target Thread<br>
<br>
</li>
<li><a href="p0zlog.htm">Qp0zLprintf()</a>--Print Formatted Job Log Data</li>
</ul>
<br>
<h3>Example</h3>
<p>See <a href="../apiref/aboutapis.htm#codedisclaimer">Code disclaimer information</a>
for information pertaining to code examples.</p>
<p>See <a href="p0zdmp.htm">Qp0zDump()</a>--Dump Formatted Storage Trace
Data.</p>
<br>
<hr>
API introduced: V4R3
<hr>
<center>
<table cellpadding="2" cellspacing="2">
<tr align="center">
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> | <a href=
"unix.htm">UNIX-Type APIs</a> | <a href="aplist.htm">APIs by category</a></td>
</tr>
</table>
</center>
</body>
</html>