source: trunk/man/arm_register_transaction.3 @ 704

Revision 614, 5.7 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_register_transaction" 3 "August 2008" "arm4.org" "ARM 4 Programmer's Manual"
7.SH NAME
8arm_register_transaction \- describe transaction
9.SH SYNOPSIS
10.B #include <arm4.h>
11.sp
12\fBarm_error_t
13.br
14arm_register_transaction(
15.br
16    const arm_id_t *\fIapp_id\fB,
17.br
18    const arm_char_t *\fItran_name\fB,
19.br
20    const arm_id_t *\fIinput_tran_id\fB,
21.br
22    const arm_int32_t \fIflags\fB,
23.br
24    const arm_buffer4_t *\fIbuffer4\fB,
25.br
26    arm_id_t *\fIoutput_tran_id\fB);\fR
27.SH DESCRIPTION
28\fBarm_register_transaction()\fR describes metadata about a transaction.
29 
30The application uses \fBarm_register_transaction()\fR to inform the ARM library of metadata about
31the transaction measured by the application. This metadata does not change from one application
32instance to another. It is the equivalent of the ARM 2.0 call \fBarm_getid()\fR.
33 
34ARM generates an ID that is passed in to \fBarm_start_transaction()\fR and \fBarm_report_transaction()\fR.
35
36\fIapp_id\fR is an application ID returned from an \fBarm_register_application()\fR call in the same
37process.
38
39\fIbuffer4\fR is a pointer to the user data buffer, if any. If the pointer is null (\fBARM_BUF4_NONE\fR),
40there is no buffer. The sub-buffers that may be used are
41\fBarm_subbuffer_metric_bindings_t\fR and \fBarm_subbuffer_tran_identity_t\fR.
42 
43The names of any transaction context properties are supplied in the
44\fBarm_subbuffer_tran_identity_t\fR sub-buffer. They do not change afterwards; that
45is, the names are immutable. The transaction context values may change with each
46\fBarm_start_transaction()\fR or \fBarm_report_transaction()\fR.
47 
48\fIflags\fR contains 32-bit flags. No values are currently defined. The field should be zero
49(\fBARM_FLAG_NONE\fR).
50 
51\fIinput_tran_id\fR is a pointer to an optional 128-bit ID (16 bytes) that is unique and that can be treated as
52an alias for the other metadata. It can be any value except all zeros or all ones. If the
53pointer is null (\fBARM_ID_NONE\fR), no ID is provided.
54 
55An ID is unique if the probability of the ID being associated with more than one set
56of metadata is vanishingly small. The selection of 128-bit IDs yields 3.4 x 10**38
57unique IDs, so the objective is to select an ID that makes use of all 128 bits and is
58reasonably likely to not be selected by another person creating an ID of the same
59form. Two suggested algorithms that generate 128-bit values with these
60characteristics are:
61 
62.IP 1.
63The Universal Unique Identifier (UUID) algorithm that is part of The Open
64Group specification: DCE 1.1: Remote Procedure Call. A developer could use the
65algorithm at the time the application is developed using a utility on his or her
66system, and be reasonably certain that nobody else would generate the same 128-bit
67ID.
68 
69.IP 2.
70The MD5 Message\-Digest Algorithm, described in IETF RFC 1321. Applying
71this algorithm to a concatenation of all the metadata properties would almost
72certainly result in a value that would not collide with any other ID created with a
73different set of metadata properties.
74.P
75If an ARM implementation is passed an ID that was previously registered within
76this process, the implementation can ignore the other metadata parameters and
77assume they are identical to the previously registered metadata. The transaction
78metadata consists of the following fields: \fIapp_id\fR, \fItran_name\fR, and the
79\fBarm_subbuffer_metric_bindings_t\fR and \fBarm_subbuffer_tran_identity_t\fR
80sub-buffers passed in \fIbuffer4\fR.
81
82\fIoutput_tran_id\fR is a pointer to a 16-byte field. ARM will store a 16-byte value. There are no
83requirements on the value it is set to, except that it must be possible to pass it on
84other calls, such as \fBarm_start_transaction()\fR, without the application needing to do
85any error checking.
86
87\fItran_name\fR is a pointer to a null-terminated string containing the name of the transaction. Each
88transaction registered by an application must have a unique name. The maximum
89length of the string is 128 characters, including the termination character. It serves
90no purpose and is illegal to make this call if the pointer is null. The name should not
91contain trailing blank characters or consist of only blank characters.
92.SH "RETURN VALUE"
93On success, the function returns \fBARM_SUCCESS\fR. A non-zero value indicates
94an error.
95.SH ERRORS
96If the return code is negative, an error occurred. If the return code is not negative, an error may
97or may not have occurred - the determination of what is an error and whether an error code is
98returned is at the discretion of the ARM implementation. The application can test the return code
99if it wants to provide its own error logging.
100
101The following errors are recognized by this implementation, but may not be portable to other implementations:
102
103.TP
104.B ARM_FAILURE_NULL_ARGUMENT
105The \fIoutput_tran_id\fR pointer must not be null.
106.TP
107.B ARM_FAILURE_INVALID_ARGUMENT
108The \fItran_name\fR argument doesn't match the string requirements.
109.TP
110.TP
111.B ARM_FAILURE_BAD_ALIAS
112The alias provided contains all 0's or all 1's.
113.TP
114.B ARM_FAILURE_DUPLICATE_ALIAS
115The alias provided already refers to a transaction with different metadata.
116.B ARM_FAILURE_INTERNAL_ERROR
117An internal error has occurred that prevented the operation from completing. Check your
118system log for more details.
119.SH "CONFORMING TO"
120ARM Issue 4.0 C Language Bindings, Version 2
121.SH EXAMPLE
122None.
123.SH "SEE ALSO"
124.BR arm_register_application (3),
125.BR arm_report_transaction (3),
126.BR arm_start_transaction (3)
Note: See TracBrowser for help on using the repository browser.