How to locate an event within the source file ?
Optional informations such as file name and line number may be added to the
events recorded files to identify the traced statements (generators).
The identification of events generators is performed on a per source file basis.
It is triggered by defining the SOURCE_FILE_NAME macro as a file name
string before including the ath0.h include file :
#define SOURCE_FILE_NAME "my_source_file_name"
#include <ath0.h>
SOURCE_FILE_NAME can also be defined by a -D option in the
a0cc commmand
line. For trace buffer management efficiency, too long file name strings will
be truncated to A0_PERF_RECORD_STRING_MAX_LENGTH (currently defined as 48).
How to disable tracing for some Athapascan-0 primitives ?
When a source file is compiled, the C preprocessor replaces Athapascan
primitives names by the library function names implementing them. For instance
a0Send will be replaced by _a0Send (name of the standard library function implementing a0Send).
In a file compiled with Athapascan-tr, a0Send will be replaced by
either _a0_perf_a0Send (instrumented a0Send function), or
_a0_sperf_a0Send (instrumented a0Send function with the
identification of events generators) when SOURCE_FILE_NAME macro is
defined.
To prevent tracing of a primitive, it is sufficient to define the primitive
name macro accordingly before including ath0.h.
For instance, in the following file my_prog.c :
#define SOURCE_FILE_NAME "my_prog.c"
#define a0Pack _a0Pack
#define a0Unpack _a0Unpack
#define a0Send _a0_perf_Send
#include <ath0.h>
No a0Pack or a0Unpack will be traced, and a0Send
calls will be traced without source file and line information. Other
Athapascan-0 functions will be traced with event generators identification.
To prevent tracing of a single occurence of a0Send, it is sufficient
to replace it with _a0Send in the source file text.
How to add user defined events in the trace ?
A specific function a0UserEvent is available to record a dated event with user
specific informations in the trace file. It takes an integer and a character
string as parameters:
a0tError a0UserEvent(int integer,char *string);
Example :
...
for (i=0; i
{
x = compute_value (I);
a0UserEvent (i,"Computing");
}
...
|