rtsDDe (1158446), страница 4
Текст из файла (страница 4)
The initial and end memory area addresses with program code are specified by the program, starting Run-Time System by writing these addresses to the Run-Time System executable module. The same program calculates and writes to Run-Time System executable module reference checksum of code memory. During its operating (in particularly, for trace events) it checks code memory, comparing its current checksum with reference one.
Controlling mechanisms of memory area checking is implemented by the following parameters of the files systrace.*.
-
EveryEventCheckBound flag to check all dynamically allocated memory blocks for each traced event.
-
EveryTraceCheckBound flag to check all dynamically allocated memory blocks in each call of trace output functions, described in section . The checking includes the checking specified by parameter EveryEventCheckBound, because it is performed for non-traced (disabled) events also.
-
dvm_StartAddr initial address of checked memory area when tracing.
-
dvm_FinalAddr end address of checked memory area when tracing.
-
EveryEventCheckMem flag to check the memory area, specified by parameters dvm_StartAddr and dvm_FinalAddr for each traced event.
-
EveryTraceCheckMem flag to check the memory area, specified by parameters dvm_StartAddr and dvm_FinalAddr in each call of trace output functions, described in section . The checking includes the checking specified by parameter EveryEventCheckMem, because it is performed for disabled events also.
-
EveryEventCheckCodeMem flag to check memory area with program code in each traced event.
-
EveryTraceCheckCodeMem flag to check memory area with program code in each call of trace output functions, considered in section . The checking includes the checking, specified by parameter EveryEventCheckCodeMem.
Besides specified memory area check tools, considered above, Run-Time System provides a possibility to output specified variable values to the trace. The output is controlled by the following parameters of systrace.* files:
-
TraceVarAddr = <address of the variable, output to the trace>;
-
TraceVarType = <type number of variable, output to the trace>;
The variable address can be decimal or hexadecimal one (according to C rules). If the address is zero, the variable is not output to the trace.
The variable type number can be:
-
int;
-
long;
-
float;
-
double;
-
char;
-
short.
If other type is specified, the variable is not output to the trace.
7.2.6Controlling output of additional information when tracing some Run-Time System functions in extended mode
-
distr_Trace – flag to output additional information when tracing the function distr_ There are reported abstract machine representation map, ranges of local values of indexes for each dimension of abstract machine representation, flag of replication for all dimensions of the processor system (Repl) and flag of mapping an element (the elements may be differ) of abstract machine representation (Every) on each processor.
-
align_Trace flag to output additional information when tracing the function align_. There are reported distributed array map and ranges of local values of indexes for each its dimension.
-
mappl_Trace – режим вывода дополнительной информации при трассировке функции mappl_:
0
не выводить дополнительной информации;
1
выводить выходные начальные и конечные значения индексных переменных параллельного цикла для текущего процессора;
2
дополнительно выводить карту отображения цикла.
-
dopl_Trace – flag to output additional information when tracing the function dopl_. The next set of ranges of local values of indexes for each dimension of the parallel loop is output.
-
PLTimeTrace flag to output the execution time information for parallel loop iteration ranges.
-
RedVarTrace – flag to output addresses, types and values of all variables of reduction group when executing functions saverv_ and strtrd_ and also at the beginning and at the end of execution of the function waitrd_.
-
OutIndexTrace – flag to output result values of indexes for each dimension of distributed array when executing internal Run-Time System function GetIndexArray.
-
diter_Trace – flag to output index array when the function diter_ of interconnection with DVM-debugger is traced.
-
drmbuf_Trace – flag to output index array when function drmbuf_ of interconnection with DVM-debugger is traced.
-
dyn_GetLocalBlock_Trace – flag to trace DVM-debugger subsidiary function dyn_GetLocalBlock.
7.3Information output functions to trace streams
Information output to the trace streams is implemented by the following functions (the parameter format and the following parameters are similarly to correspondent parameters of printf function of C language).
int tprintf (char *format, ... );
The function outputs information to opened trace streams. Account of output symbols is returned.
| int pprintf ( | int | prefix, |
The function outputs information to opened trace streams, redirected to the memory buffer and directly to the file. Moreover, the output is done to the streams for output of Run-Time System information messages (parameter prefix is equal to 0 or 1) or to the streams for error messages (prefix is equal to 2 or 3) (see section 8).
If prefix is equal to 1 or 3, the output is performed by each processor, assigned to the task, and processor number precedes to specified information (see sections 1.3 and 4). If prefix is equal to 0 or 2, each processor concerned output information to trace streams, but only main processor output information to all other streams (see section 4). The processor number is not output in this case.
A number of output symbols is returned.
| void dvm_trace ( | int | number, |
The function outputs information about occurred event with the number to the opened trace streams. The information consists of:
-
standard information for trace event with number;
-
additional information specified by parameter format and the following parameters, if they exist.
The standard information includes:
-
a name of trace event with number;
-
program execution time, passed from a moment of previous actual output of information to the trace streams by the dvm_trace function;
-
file name and line number, together defining a point of occurred event with number;
Actual information output to trace streams is performed only in the case, if the event with number is enabled.
The output of additional information is performed only in verbose trace mode or if the verbose mode is specified for the event with number.
The file name and line number, defining the point of occurred event, are passed to trace program by DVM_CALL macrocall. The macro has such name because of all trace events, except of several ones, are Run-Time System function calls. If the event is occurred inside Run-Time System and function call is the event, then RTL_CALL macrocall is used. The macrocalls DVM_CALL and RTL_CALL must be performed immediately before event and disposed maximally near the event in the program file. Thus event tracing is done by the following scheme:
DVM_CALL; (or RTL_CALL;)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
< point of occurred event >
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
dvm_trace ( ........ );
Tracing Run-Time System functions is implemented in such a manner, that dvm_trace call is performed inside traced function. When tracing functions more preferable way of using DVM_CALL and DVM_TRACE macrocalls is applying operation of sequential calculation:
( DVM_CALL , < function call > )
or
( RTL_CALL , < function call > ) .
In this case line number, passed to the trace program, will be exactly equal to line number of occurred event (function call), and function call in any C expression can be equivalently changed by some of the constructions above.
Note. File name and line number, defining the point of occurred event, can be also passed to Run-Time System by the functions
| long fname_ ( | char | *FileNamePtr, |
| long lnumb_ ( | long | *LineNumberPtr ); |
| FileNamePtr | | pointer to the text string with file name. |
| FileNameLength | | size of file name string in bytes. |
| *LineNumberPtr | | line number. |
The function fname_ assigns zero to the last byte of file name string. The functions return zero values.
The functions can be used preprocessor programs to bind a point of intended event with own input text.
Note that call sequence
long line;
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
line = __LINE__ ;
fname_ ( __FILE__ ,
strlen(__FILE__)+1 ) ;
lnumb_ ( &line ) ;
is equivalent to macrocall
DVM_CALL ; .
| void eprintf ( | char | *FileNamePtr, |
The function outputs information to opened trace streams, redirected to the memory buffer and directly to a file, and to the error message streams (see section 8) and then terminates execution of a user program and Run-Time System. The current processor number is placed before the information, output to error message streams.
After output of the information, specified by parameter format and following parameters (if such ones are), the string, specified by the pointer FileNamePtr and integer, specified by parameter Line are output. It is assumed, that output string and number are file name and line number, containing given call of the function eprintf, that is eprintf call has the form:
eprintf (__FILE__ , __LINE__ , format , . . . );
Moreover, the function eprintf outputs coordinates of user program point, where the last Run-Time System call was (file name and line number).
| void epprintf ( | int | prefix, |
The function is similarly to eprintf function considered above but if prefix has zero value, only main processor (see section 4) outputs information in the streams intended for error messages. The current processor number is not reported in this case.
8Output of informational messages of Run-Time System and error messages
8.1Functions of informational and error messages output
Each message, reported by Run-Time System, is either informational or error message.
Informational messages are output by the functions rtl_printf, rtl_mprintf (see section 1.3), and by the function pprint with parameter prefix, equal to 0 or 1 (see section ).
Moreover, for informational messages output Run-Time System provides the function rtl_iprintf that is syntactically equivalent to the function printf and returns the number of output symbols:
int rtl_iprintf (char *format, . . . );
Any trace information, output to informational message stream by tprintf and dvm_trace functions (see section ) is informational message too.
Error message output is performed by eprintf and epprintf functions, and also by the function pprint with prefix parameter, equal to 2 or 3 (see section ).
8.2Controlling standard output streams and streams of informational and error message output
The direction and redirection of the streams, intended for output of information and error messages, is performed by the parameter current.par and syspar.* files.
The file current.par is the parameter file of current startup of Run-Time System and is created by Run-Time System startup program in the current working directory. The file consists of the following line sequence:















