source: trunk/man/arm_generate_correlator.3 @ 704

Revision 614, 5.3 KB checked in by dcarter, 4 years ago (diff)

see #111 - Build beta3

Line 
1.\" Copyright (c) 2005-2008 David Carter <dcarter@arm4.org> and others.
2.\" All rights reserved.   This program and the accompanying materials
3.\" are made available under the terms of the Eclipse Public License v1.0
4.\" which accompanies this distribution, and is available at
5.\" http://www.eclipse.org/legal/epl-v10.html
6.TH "arm_generate_correlator" 3 "August 2008" "arm4.org" "ARM 4 Programmer's Manual"
7.SH NAME
8arm_generate_correlator \- generate a correlator
9.SH SYNOPSIS
10.B #include <arm4.h>
11.sp
12\fBarm_error_t
13.br
14arm_generate_correlator(
15.br
16    const arm_app_start_handle_t \fIapp_handle\fB,
17.br
18    const arm_id_t *\fItran_id\fB,
19.br
20    const arm_correlator_t *\fIparent_correlator\fB,
21.br
22    const arm_int32_t \fIflags\fB,
23.br
24    const arm_buffer4_t *\fIbuffer4\fB,
25.br
26    arm_correlator_t *\fIcurrent_correlator\fB);\fR
27.SH DESCRIPTION
28\fBarm_generate_correlator()\fR is used to generate a correlator for use with
29\fBarm_report_transaction()\fR.
30 
31A correlator is a correlation token passed from a calling transaction to a called transaction. The
32correlation token may be used to establish a calling hierarchy across processes and systems. A
33correlator contains a two-byte length field, a one-byte format ID, a one-byte flag field, plus it
34may contain other data that is used to uniquely identify an instance of a transaction. Applications
35do not need to understand correlator internals. The maximum length is 512
36(\fBARM_CORR_MAX_LENGTH\fR) bytes.
37
38It is useful to think about its use in the context of what \fBarm_start_transaction()\fR and
39\fBarm_stop_transaction()\fR do:
40.IP *
41\fBarm_start_transaction()\fR performs two functions. It establishes the identity of a transaction
42instance (encapsulated in the current correlator) and begins the measurements of the
43instance. \fBarm_stop_transaction()\fR causes the measurements to be captured. The start
44handle links an \fBarm_start_transaction()\fR and an \fBarm_stop_transaction()\fR.
45.IP *
46\fBarm_generate_correlator()\fR establishes the identity of a transaction instance, like
47\fBarm_start_transaction()\fR, also encapsulating it in a correlator. It has no relationship to
48measurements about the transaction instance. \fBarm_report_transaction()\fR combines the
49measurement function of both \fBarm_start_transaction()\fR and \fBarm_stop_transaction()\fR.
50.P
51Based on this positioning, it should be clear that \fBarm_generate_correlator()\fR can be used
52whenever an \fBarm_start_transaction()\fR can be used. More specifically, the following calls must
53have been executed first: \fBarm_register_application()\fR, \fBarm_register_transaction()\fR, and
54\fBarm_start_application()\fR. The same parameters are also used, except there's no need for a start
55handle, and there's no need for the arrival time or metric values sub-buffers. The other sub-
56buffers may be used. The correlator that is output can be used in the same way that a correlator
57output from \fBarm_start_transaction()\fR is used.
58
59\fIapp_handle\fR is a value returned from an \fBarm_start_application()\fR call in the same process. The
60ARM implementation may use this handle to access application instance data that
61may become part of the correlator; e.g., the \fBarm_subbuffer_system_address_t\fR.
62
63\fIbuffer4\fR is a pointer to the user data buffer, if any. If the pointer is null (\fBARM_BUF4_NONE\fR),
64there is no buffer. The sub-buffers that may be used are
65\fBarm_subbuffer_trancontext_t\fR, and \fBarm_subbuffer_user_t\fR.
66
67\fIcurrent_correlator\fR is a pointer to a buffer into which the ARM implementation will store a correlator for
68the transaction instance, if any. The length of the buffer should be (at least) 512
69(\fBARM_CORR_MAX_LENGTH\fR). The value must be non-null.
70
71\fIflags\fR Contains 32-bit flags. These values may be combined using a binary or (|) operation.
72.IP
730x00000001 (\fBARM_FLAG_TRACE_REQUEST\fR) is present if the application
74requests/suggests a trace.
75.IP
760x00000004 (\fBARM_FLAG_CORR_IN_PROCESS\fR) is present if the application is stating
77that it will not send the correlator outside the current process. An ARM
78implementation may be able to optimize correlator handling if it knows this,
79because it may be able to avoid serialization to create the correlator.
80.P
81\fIparent_correlator\fR is a pointer to the parent correlator, if any. The pointer may be null
82(\fBARM_CORR_NONE\fR).
83
84\fItran_id\fR is a transaction ID returned in an out parameter from an \fBarm_register_transaction()\fR
85call in the same process.
86.SH "RETURN VALUE"
87On success, the function returns \fBARM_SUCCESS\fR. A non-zero value indicates
88an error.
89.SH ERRORS
90If the return code is negative, an error occurred. If the return code is not negative, an error may
91or may not have occurred - the determination of what is an error and whether an error code is
92returned is at the discretion of the ARM implementation. The application can test the return code
93if it wants to provide its own error logging.
94
95The following errors are recognized by this implementation, but may not be portable to other implementations:
96
97.TP
98.B ARM_FAILURE_NULL_ARGUMENT
99The \fIcurrent_correlator\fR must not be null.
100.SH "CONFORMING TO"
101ARM Issue 4.0 C Language Bindings, Version 2
102.SH EXAMPLE
103None.
104.SH "SEE ALSO"
105.BR arm_register_application (3),
106.BR arm_register_transaction (3),
107.BR arm_report_transaction (3),
108.BR arm_start_application (3),
109.BR arm_start_transaction (3),
110.BR arm_stop_transaction (3)
Note: See TracBrowser for help on using the repository browser.