| 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_report_transaction" 3 "August 2008" "arm4.org" "ARM 4 Programmer's Manual" |
|---|
| 7 | .SH NAME |
|---|
| 8 | arm_report_transaction \- report transaction statistics |
|---|
| 9 | .SH SYNOPSIS |
|---|
| 10 | .B #include <arm4.h> |
|---|
| 11 | .sp |
|---|
| 12 | \fBarm_error_t |
|---|
| 13 | .br |
|---|
| 14 | arm_report_transaction( |
|---|
| 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_tran_status_t \fItran_status\fB, |
|---|
| 21 | .br |
|---|
| 22 | const arm_response_time_t \fIresponse_time\fB, |
|---|
| 23 | .br |
|---|
| 24 | const arm_stop_time_t \fIstop_time\fB, |
|---|
| 25 | .br |
|---|
| 26 | const arm_correlator_t *\fIparent_correlator\fB, |
|---|
| 27 | .br |
|---|
| 28 | const arm_correlator_t *\fIcurrent_correlator\fB, |
|---|
| 29 | .br |
|---|
| 30 | const arm_int32_t \fIflags\fB, |
|---|
| 31 | .br |
|---|
| 32 | const arm_buffer4_t *\fIbuffer4\fB);\fR |
|---|
| 33 | .SH DESCRIPTION |
|---|
| 34 | \fBarm_report_transaction()\fR is used to report statistics about a transaction that has already |
|---|
| 35 | completed. |
|---|
| 36 | |
|---|
| 37 | \fBarm_report_transaction()\fR may be used instead of a paired \fBarm_start_transaction()\fR and |
|---|
| 38 | \fBarm_stop_transaction()\fR call. The application would have measured the response time. The |
|---|
| 39 | transaction could have executed on the local system or on a remote system. If it executes on a |
|---|
| 40 | remote system, the system address sub-buffer passed on the \fBarm_start_application()\fR provides |
|---|
| 41 | the addressing information for the remote system. |
|---|
| 42 | |
|---|
| 43 | If the transaction represented by the \fBarm_report_transaction()\fR call is the correlation parent of |
|---|
| 44 | another transaction, \fBarm_generate_correlator()\fR must be used to get a parent correlator, prior to |
|---|
| 45 | invoking the child transaction (because it must be passed to the child). In this case, the sequence |
|---|
| 46 | is the following: |
|---|
| 47 | |
|---|
| 48 | .IP 1. |
|---|
| 49 | Call \fBarm_generate_correlator()\fR to get a correlator for this transaction. |
|---|
| 50 | .IP 2. |
|---|
| 51 | Invoke the child transaction, passing the correlator returned in step (1) to the child. |
|---|
| 52 | .IP 3. |
|---|
| 53 | When this transaction is complete, invoke \fBarm_report_transaction()\fR to report the |
|---|
| 54 | statistics about the transaction. |
|---|
| 55 | .P |
|---|
| 56 | When used, it prevents certain types of proactive management, such as monitoring for hung |
|---|
| 57 | transactions or adjusting priorities, because the ARM implementation is not invoked when the |
|---|
| 58 | transaction is started. Because of this, the use of \fBarm_start_transction()\fR and |
|---|
| 59 | \fBarm_stop_transaction()\fR is preferred over \fBarm_report_transaction()\fR. |
|---|
| 60 | |
|---|
| 61 | The intended use is to report status and response time about transactions that recently completed |
|---|
| 62 | (typically several seconds ago) in the absence of an ARM-enabled application and/or ARM |
|---|
| 63 | implementation on the system on which the transaction executed. |
|---|
| 64 | |
|---|
| 65 | \fIapp_handle\fR is a handle returned in an out parameter from an \fBarm_start_application()\fR call in the |
|---|
| 66 | same process. |
|---|
| 67 | |
|---|
| 68 | \fIbuffer4\fR is a pointer to the user data buffer, if any. If the pointer is null (\fBARM_BUF4_NONE\fR), |
|---|
| 69 | there is no buffer. The sub-buffers that may be used are |
|---|
| 70 | \fBarm_subbuffer_diag_detail_t\fR, \fBarm_subbuffer_metric_values_t\fR, |
|---|
| 71 | \fBarm_subbuffer_tran_context_t\fR, and \fBarm_subbuffer_user_t\fR. |
|---|
| 72 | |
|---|
| 73 | \fIcurrent_correlator\fR is a pointer to the correlator for the transaction that has completed, if any. If the pointer |
|---|
| 74 | is null (\fBARM_CORR_NONE\fR), there is no current correlator. |
|---|
| 75 | |
|---|
| 76 | \fIflags\fR contains 32-bit flags. In the least significant byte, 0x00000001 |
|---|
| 77 | (\fBARM_FLAG_TRACE_REQUEST\fR) is set if the application requests/suggests a |
|---|
| 78 | trace. |
|---|
| 79 | |
|---|
| 80 | \fIparent_correlator\fR is a pointer to a parent correlator, if any. If the pointer is null (\fBARM_CORR_NONE\fR), |
|---|
| 81 | there is no parent correlator. |
|---|
| 82 | |
|---|
| 83 | \fIresponse_time\fR is the response time in nanoseconds. |
|---|
| 84 | |
|---|
| 85 | \fIstop_time\fR is an \fBarm_int64_t\fR that contains the number of milliseconds since Jan 1, 1970 using |
|---|
| 86 | the Gregorian calendar. The time base is GMT (Greenwich Mean Time). There is |
|---|
| 87 | one special value, -1 (\fBARM_USE_CURRENT_TIME\fR), which means use the |
|---|
| 88 | current time. |
|---|
| 89 | |
|---|
| 90 | \fItran_id\fR is a transaction ID returned in an out parameter from an \fBarm_register_transaction()\fR |
|---|
| 91 | call in the same process. |
|---|
| 92 | |
|---|
| 93 | \fItran_status\fR indicates the status of the transaction. The following values are allowed: |
|---|
| 94 | |
|---|
| 95 | .IP 0 |
|---|
| 96 | (\fBARM_STATUS_GOOD\fR) = transaction completed successfully |
|---|
| 97 | .IP 1 |
|---|
| 98 | (\fBARM_STATUS_ABORTED\fR) = transaction was aborted before it completed. For |
|---|
| 99 | example, the user might have pressed "Stop" or "Back" on a browser while a |
|---|
| 100 | transaction was in process, causing the transaction, as measured at the browser, to |
|---|
| 101 | be aborted. |
|---|
| 102 | .IP 2 |
|---|
| 103 | (\fBARM_STATUS_FAILED\fR) = transaction completed in error |
|---|
| 104 | .IP 3 |
|---|
| 105 | (\fBARM_STATUS_UNKNOWN\fR) = transaction completed but the status was |
|---|
| 106 | unknown. This would most likely occur if middleware or some other form of proxy |
|---|
| 107 | instrumentation measured the transaction. This instrumentation may know enough |
|---|
| 108 | to know when the transaction starts and stops, but does not understand the |
|---|
| 109 | application-specific semantics sufficiently well to know whether the transaction |
|---|
| 110 | was successful. |
|---|
| 111 | .SH "RETURN VALUE" |
|---|
| 112 | On success, the function returns \fBARM_SUCCESS\fR. A non-zero value indicates |
|---|
| 113 | an error. |
|---|
| 114 | .SH ERRORS |
|---|
| 115 | If the return code is negative, an error occurred. If the return code is not negative, an error may |
|---|
| 116 | or may not have occurred - the determination of what is an error and whether an error code is |
|---|
| 117 | returned is at the discretion of the ARM implementation. The application can test the return code |
|---|
| 118 | if it wants to provide its own error logging. |
|---|
| 119 | |
|---|
| 120 | The following errors are recognized by this implementation, but may not be portable to other implementations: |
|---|
| 121 | |
|---|
| 122 | .TP |
|---|
| 123 | .B ARM_FAILURE_NULL_ARGUMENT |
|---|
| 124 | The \fItran_id\fR must not be null. |
|---|
| 125 | .TP |
|---|
| 126 | .B ARM_FAILURE_INVALID_ARGUMENT |
|---|
| 127 | The \fIapp_handle\fR provided is invalid. |
|---|
| 128 | .TP |
|---|
| 129 | .B ARM_FAILURE_INTERNAL_ERROR |
|---|
| 130 | An internal error has occurred that prevented the operation from completing. Check your |
|---|
| 131 | system log for more details. |
|---|
| 132 | .SH "CONFORMING TO" |
|---|
| 133 | ARM Issue 4.0 C Language Bindings, Version 2 |
|---|
| 134 | .SH EXAMPLE |
|---|
| 135 | None. |
|---|
| 136 | .SH "SEE ALSO" |
|---|
| 137 | .BR arm_generate_correlator (3), |
|---|
| 138 | .BR arm_register_transaction (3), |
|---|
| 139 | .BR arm_start_application (3), |
|---|
| 140 | .BR arm_start_transaction (3), |
|---|
| 141 | .BR arm_stop_transaction (3) |
|---|