Synergy DBL Profiler
WTSupported in traditional Synergy on Windows
|
|
USupported on UNIX
|
VSupported on OpenVMS
|
By providing profiling information about your programs, the Synergy DBL Profiler helps you determine where and how you can best optimize them. A profiled routine counts the CPU time it uses (in ticks), including any system calls, and it counts the number of times the routine is XCALLed. It also shows I/O on Windows and both I/O and page faults on OpenVMS.
Depending on which system options you’ve set, profiling can also include any Synergy DBL subroutines that are XCALLed by the current routine. In this case, the total CPU time for a program can be counted many times, and the total CPU time is the time taken by the root module, rather than the sum of all the modules.
On UNIX and OpenVMS, the profiler calculates accumulated CPU time. On Windows, you can choose whether you want (low-granularity) accumulated CPU time or (high-granularity) elapsed CPU time by setting the PROFILE_PROCESSOR_TIME environment variable. (See Keep in mind… below.)
You can profile all routines or specific routines by setting one of the following system options. (See Setting a system option.) With some of these options, you must also use the profiling compiler option as described in Profiling your routines below.
Routines to profile |
System option |
---|---|
All routines |
|
The current routine (if the profiling compiler option is specified) |
|
The current routine and all routines XCALLed by the current routine (if the profiling compiler option is specified) |
|
Synergy programs at the line level (if the profiling compiler option is set). You cannot specify an exclusion file when you use this option. |
Profiling your routines
To profile your routines,
1. | Set the desired system option as shown in the table above. |
2. | Compile. If you set system option #40, #41, or #52, compile using the profiling compiler option (-u or -qprofile on Windows and UNIX or /profile on OpenVMS). |
3. | Run the resulting program. |
When the program is run, a file called profile.dat (or lines.dat if system option #52 is set) is output. This data file is used to get the profile. On Windows (except for xfServerPlus applications) and UNIX, this file is written to the current directory. On OpenVMS, it is written to SYS$SCRATCH:. When profiling an xfServerPlus application on Windows, the file is written to c:\users\public\documents. See Synergex KnowledgeBase article 2400 for more information about using the profiler with xfServerPlus.
4. | Follow the instructions below to decode the profile.dat or lines.dat file to get the profile results. |
Decoding the profile.dat or lines.dat file
Depending on which system option was set when you compiled, either profile.dat or lines.dat was created.
- To decode the profile.dat file, enter
dbr DBLDIR:profile [-x exclusion_file]
The profile program interprets profile.dat and outputs the results to a file called profile.lst.
You can specify an exclusion file that contains a list of routines to exclude from the profile output. The routine names listed in this text file can be on one or more lines and must be separated by commas. (Although the exclusion file option is available on all platforms, it provides the greatest benefit on Windows, due to the granularity of the measurements.) If the -x option is not specified, the profiler uses the default exclusion file, tkexclude.txt, which is distributed with UI Toolkit in the directory pointed to by the WND environment variable. This file is provided because when elapsed CPU time is profiled on Windows, Toolkit input routines such as I_INPUT_P can consume a large amount of time. Excluding the Toolkit input routines enables you to get a more accurate idea of how much CPU time is actually being used.
- To decode the lines.dat file, enter
dbr DBLDIR:profline
The profline program interprets lines.dat and outputs the results to a file called lines.lst, which is sorted according to which statements are used most often.
Keep in mind…
Routine profiling is only as accurate as the CPU times posted to your process by the operating system. Especially on faster systems, misleading results can be generated. On a fast CPU, 10 millisecond ticks encompass a lot of Synergy DBL instructions.
On OpenVMS, the DIO count includes any I/O required to write the profile.dat file, which can account for DIO counts in routines in which no I/O occurs. In addition, the I/O is only updated every 10 milliseconds.
On Windows, the Synergy DBL Profiler calculates elapsed CPU time according to the high-granularity system clock. To calculate accumulated CPU time, which is only updated every 20 milliseconds, set the PROFILE_PROCESSOR_TIME environment variable. Note that on a very fast processor, accumulated CPU time results can be so imprecise as to be almost meaningless, but may be advantageous when profiling significant amounts of input or on a multiprocessor or hyperthreaded CPU.
You cannot use the Synergy DBL Profiler with the non-interactive runtimes (dbs, dbssvc, and dbspriv).