Series About Profile (2)

zhaozj2021-02-17  48

PLIST

PLIST converts the result of the .pbt file to a formatted text file.

grammar

PList [options] InputFile

PLIST reads the command line in order from left to right, so the rightmost command line parameters may overwrite the left and zyx command line parameters. All parameters are not sensitive. However, you have to add (/) or (-) symbol before the option, and the parameters are separated by spaces.

Under the default, the results of the PLIST are output to the standard output stream (STDOUT). Use one (>) symbol to redirect the result string to a file or device.

PLIST must perform in a program that performs performance testing.

parameter

description

Options

Refer to the optional parameters below.

InputFile

Specify the PLIST read. PPT file.

Options

Option

Description

/ C count

Specifies the minimum number of functions that need to be displayed.

/ D Directory

Specify an additional directory for the PLIS search source file. Multiple / D parameters can be used to specify multiple directories. Use this option when the PLIST does not find the source file.

/ F

List the full path in a tabular file.

/ Flat

When the properties of the function are displayed (refer to the PREP / AT option), the function attribute is displayed.

/ H [ELP]

Provides simple help information about the parameters of the PLIST.

/ Indent

The properties of the output function are formatted when the properties of the function are displayed (refer to the PREP / AT option). This is the default parameter if there is no / flat or / tab parameter.

/ NOLOGO

Remove the profile version information.

/ PL Length

Set the output length (behavior) of the page. The length must be 0 or between 15 and 255. If 0 is removed, the page symbol is removed. The default is 0.

/ Pw width

Set the page width (character unit) of the output. This width must be between 1 and 511. The default width is 511.

/ Sc

The output is sorted in accordance with the count, the count is on top.

/ SL

Sort the output in the order of order. This is the default setting for performance statistics by source code line.

/ SLS

Forced to output according to the output of the source code line according to the overlay format.

/ SN

Sort the output according to the alphabetical order of the function name. This option is only valid when testing the performance of the function.

/ SNS

Display the number of call times and functions of the function in the form of function override. The result is sorted in alphabetical order.

/ ST

The output is sorted by time, and the most at the time is on top.

/ T

Use the table to divide the output. Generate a data from the .pbt file. When this parameter is used, all other parameters are ignored.

/ Tab indent

When the properties of the function are displayed (refer to the PREP / AT option), set the text width to the indent display function information.

/?

Provides simple help information about the parameters of the PLIST.

Environment variable

PLIST

Specifies the default command line parameters.

If you do not specify the environment variable of the PLIST, the default parameter is determined by the Profile, as shown in the table below.

PROFILE type

Sort option

Call count option

Function timing

/ ST

/ C 1

Function call count

/ Sc

/ C 1

Function overlay

/ SN

/ C 0

Count

/ SL

/ C 0

Row

/ SLS

/ C 0

Profiler Won't Merge Statistics from Two DiffERENT OPERATING SYSTEMS on The Same Computer

(Translator Note: The title of this section is: "Do not attempt to merge the performance statistics generated by PROFILER under different operating systems on the same computer". Membed means that the data and previous results are performed when performing this performance statistics. Data merge, generate a average statistical result.)

The Profile tool does not merge the Profile session generated on two different operating systems. If you copy a profile session from Windows to Windows 95 and try to merge results, you will generate the following error: preP: Fatal Error PRF1463: Different Clock / Sampling Frequency

Don't try to merge the performance statistics resulting on two different operating systems, please note that this is the designer of Profile.

Error reproduction

Generate an example program and perform performance test settings using the Engineering Setup dialog. (In the settings option of the Build menu). Compilation project. Click the Profile option under the Build menu and select Function Timing. Exit and enter a different operating system, for example, if you use Windows95, you will now enter WindowsNT (or in contrast, exit from Windows NT and enter Windows 95). Enter the IDE of the VC, click the Profile option under the build menu, and select Merge to run the Profiler.

Precautions

If it is the same operating system under different computers, it will not be wrong when performing performance test. Even if it is inconsistent time statistics, merge operations can be performed.

Profiler Will Not Profile Dlls That Are FREED, THEN RELOADED

Microsoft Source Profiler can perform performance statistics for dynamic libraries that are loaded in any Windows application, but it cannot continue to collect after the application is released. Performance data of the dynamic library loaded again (using dynamic method loading).

Dynamically loaded dynamic libraries with loadLibrary (), when they are released, and performance statistics will not be performed again, as statistics are incorrect.

This behavior of Profile, you can observe the following action:

Dynamically load a dynamic library using LoadLibrary (). Use freeLibrary () to release the dynamic library. Load the dynamic library again using LoadLibrary ().

There is currently no way to bypass this limitations, and the ability to get dynamically reloaded under Windows has been taken into account in the next version of PROFILER (Translator Note: I don't know the new version of VC provides this feature. No, please tell me if you know.

Onboard System Memory Cache and Disk Caches May Affect Profile Times

Microsoft Source Profiler may be executed on some specific processor systems, the displayed application execution time will be strange, including 80386 and 80486 processors with built-in cache. The only way to remove these cache to performance is to set these caches, because we can't control which things can be placed in the cache, and which cannot be placed in the cache.

These strange performance statistics are due to the behavior of the cache. If the program code that is performing performance statistics is in the cache, the execution time of the program is shorter than normal. On the other hand, when the code instruction of the Profiler itself is placed in the cache, it seems that the cache seems to be dominated by Profiler. This result is that the execution time of the program itself performs performance test will increase. The impact of the cache to the applet exceeds the big program. This is because the cache is the cause of the hit rate.

Since the presence of cache hinders the correct execution performance test, if you need to get a very accurate performance test result, use a system that is not cached. Regardless of how, a cached system gives all the impacts that make this system run faster, so, when performing performance test, there is no need to consider this additional efficiency. too much. Profiling Windows NT Services

The theme of this section is to perform performance testing of the Windows NT service process.

You can find a service routine from the following directory: Samples / SDK / WinNT / Service (of course, install the SDK routine), follow the steps below to get the time information of its service function.

Perform performance testing for Windows NT services

Use the system control panel to set the necessary environment variables (Translator Note: Windows 2000 is the Environment Variable Settings dialog box under the Advanced Tags of System Features). You can find some environmental variables such as COMSPEC, WINDIR, and PATH. Add two new environment variables.

__Profilepbi =

__Profilepbo =

Please be careful not to miss the underscore before the two environment variables. If you don't have a correct setting, you will get a warning given by Profile.dll, it can't find the above settings. In this example, if your compiler is on the drive D, the value of the environment variable should be set to:

D: /.../ Samples / SDK / WINNT / Service / Simple.PBI

D: /.../ Samples / SDK / WINNT / Service / Simple.pbo

Copy Profiler's dynamic library, profile.dll, copy from the directory "Program Files / Microsoft Visual Studio / VC98 / BIN" to or service, or any directory specified by the PATH environment variable. Compilation routine, Simple.exe. Remember to let the compiler generate .map files. Run preP and generate simple._xe, which is a modified executable for Performance Test:

Prep / OM / FT / SF _WORKER_THREAD SIMPLE.exe

This command also sets the call stack of tracking worker_thread (). By default, PROFILER starts performance test from the main thread. If the service request is executed by the second thread, if not specified / sf parameters, we The incomplete result will be obtained. In this routine, this second thread is a request service by calling CreateThread (), if the primary thread responds to service request, you don't need to use / sf parameters. Rename Simple._XE is Simple.exe. This will override the original version using the modified version (for PROFILING), and the code in this version can be hooked by Profiler (HOOK). Use the service manager under the Control Panel and run the client program, then stop the service, you can use the following command line instruction to get the performance statistics:

Prep / M Simple

PLIST SIMPLE

Error Writing to .pdb file after line Profile Operation

If you execute the performance statistics of a source code line in the project, try to rebuild the project (Build or Rebuild), you might get the following error message:

LNK1201: Error Writing to Program Database "C: / Microsoft Visual Studio / Common / MSDEV98 / MYPROJECTS / YOURAPP / Debug / Yourapp.pdb"; Check for Insufficient Disk Space Because this time the development environment is executing source code line performance statistics Program data file (.pdb). At this time, try to rebuild the project, the linker cannot write information in .pdb, this causes the LNK1201 error.

There are several ways to solve this problem:

Exit the development environment and then open the project. Run the debugger, select the debug command under the Build menu (shortcut F5). Then close the application or stop debugging. This will close the .pdb file. Use a patch file to perform your program performance test. You can use the Custom Settings under the PROFILE dialog to specify the LCOVER.BAT file, it is easy to do.

PROFILER FATAL ERRORS PRF1012 and PRF1306

When using the VC's integrated development environment (IDE) attempts to perform performance testing of a program, you may get the following fatal error message:

Profile.dll: Fatal Error PRF1012: Cannot Read Expected Number of Bytes from File /xxxx.pbi

PREP: FATAL ERROR PRF1306: PBT or PBO file /xxx.pbo is not derived from Same PBI File

It may also be such an error message:

Profile.dll: Fatal Error PRF1005: Operating System Ran Out of Memory.

All of these error messages are caused by PROFILERs in the process of loading a dynamic library. The most likely case is the version of Windows NT loaded. DLL version is version 1.0 version of Visual C 32-bit version.

To correct this error, confirm that profile.dll used by Profiler is 2.0 or version 2.1 version of the Visual C 32-bit version. Please use the file search on your system to see if there is an old version of Profile.dll, if you have renamed or delete this file directly. Please confirm that your system is loaded in the Program Files / Microsoft Visual Studio / VC98 / BIN directory, which is used by VC . DLL.

If you do not exist in the Program Files / Microsoft Visual Studio / VC98 / BIN directory, you can use the VC installer to install, so you can restore this file.

When you do this, you will first empty all options under the Tools Options dialog box, just keep "Profiler". Of course, you should also be sure that your designation directory is your current VC installation directory.

Incorrect Profile.dll file may be found in the WinNT / System32 directory, where Winnt is the installation directory of Windows NT. Or this DLL will be found in the other directory specified by the PATH environment variable. The correct document should be located in the "Visual C Program Files / Microsoft Visual Studio / VC98 / BIN" directory.

The following is the date and file size of the Profile.dll file before VC 6.0.

Visual C 5.0: 10/01/97 10: 47P 107, 520 Profile.dll Visual C 4.2: 02/08/96 07: 48P 93,184 Profile.dll Visual C 4.1: 02/08/96 07: 48P 93, 184 Profile.dllvisual C 4.0 : 09/29/95 09: 49P 78, 848 Profile.dll (Translator Note: I have encountered this question, I have encountered it, this may be a phenomenon of Siki.).

转载请注明原文地址:https://www.9cbs.com/read-28852.html

New Post(0)