[Declaration] If you need to copy, spread, please attach this statement, thank you. Original source: http://morningspace.51.net/, MOYINGZZ@etang.com (Continued) PROFILE The role of PROFILE helps you analyze and discover the bottleneck running, find time consumption, and help you find it will not be executed Code. Thus the optimization of the program is ultimately realized. PROFILE The composition of Profile consists of 3 command line tools: Prep, Profile, PLIST. You can run the Profile in a command line, the process is: Prep reads the executable of the application and generates a .PBI file and a .pbt file; Profile According to the .PBI file, actually run and analyze the program, generate .PBO output files PREP generates a new .pbt file according to the .pbo file and .pbt file; PLIST generates readable output according to the .pbt file. The specific function of Profile is evaluated to evaluate the time spending the program on a specific function. This function can be activated via the Profile dialog. In the analysis result, the FUNC TIME column records the function to run in seconds. The next column shows the percentage of the function time to account for the total runtime; the FUNC Child Time column records the function and the subunies thereof The total time spent, the next column shows the percentage of the aforementioned time of time, the number of times the hit count column records the function being called; the function name is displayed. Function Coverage: Records whether a particular function is called, which can be used to determine the unforgettable portion in the code. This function can be activated via the Profile dialog. The analysis results list all the functions of all analytical functions and use the * markup function. Function Counting: The number of times the program calls a specific function. Select Custom in the Profile dialog and specify fcount.bat in Custom Settings (located in the VC98 / BIN directory). It should be noted that when specifying the directory where FCount.Bat is specified, it is best not to use the long file name, so it is possible to errors, such as writing C: / Program Files into C: / Progra ~ 1. Line Counting: The number of times in the code executed by the program. Select Custom in the Profile dialog and specify LCOUNT.BAT in Custom Settings (located in the VC98 / BIN directory). This feature uses the debug information in .exe to start the Profile, so it doesn't need .map file. In the analysis result, the line number is labeled the line number of the source code. The Hit Count column records the number of executions, the next column shows the percentage of the number of executions of all code lines, Source Line shows the corresponding source code. LINE COVERAGE: The specific row in the record code is executed, which can be used to determine the unforgettable portion in the code. This function can be activated via the Profile dialog. The analysis result lists all the rows of code to be analyzed, and the line executed using the * mark. Since Line Coverage only records whether the code line is executed, its execution is smaller than the Line Counting. In addition, the Profile dialog provides a MERGE function to combine the statistics after running Profile.
If you are using the function coverage feature, you will see if all functions are tested; if you are using the function Timing feature, you will see the accumulated time for all merger operations in this analysis with this analysis. In the IDE environment, the use of PROFILE uses the function of function analysis to select Project-> Settings-> link. Select Enable Profiling check box to rebuild the project Select Build-> Profile. After the PROFILE dialog box is necessary, select OK, start the program For functions involving row analysis
Select Project-> Settings-> Link, select the Enable Profiling check box and the Generate debug info check box Select Project-> Settings-> C / C , select the Line Numbers Only Rebuild Project Select Build-> Profile, pop up the Profile dialog After setting, select OK, start running the program to configure Profile to modify the Profiler.ini file PROFILER.INI in the VC98 / BIN directory, in its [PROFILER], you can specify the LIB file or OBJ that does not participate in the analysis file. For example: [PROFILER]
Exclude: user32.lib
Exclude: GDI32.LIB Specify options in the Profile dialog box If you select the Funciton Timing, Function Coverage or Line Coverage option, you can specify a further range in Advanced Settings, such as: You want PROFILE to simply analyze simpleapp.cpp files The code within a specific range can be filled in Advanced Settings, / Excall / INC SampleApp.cpp (30-67). Another example: You want file1.obj and file2.obj to participate in analysis, you can fill in the Advanced Settings, / Exc file1.Obj / Exc file2.obj. Another example: You want to only describe the specified function, you can fill in the Advanced Settings, / sf? Samplefunc @@ yaxpah @@, keeping the sf parameter is the modifier name of the specific function, get the simplest way of this name. It is found in the MAP file generated when you create a project. SF, EXCALL, EXC, INC are pre-command line parameters, and detailed descriptions of other parameters can be obtained by entering preP / h at the command line prompt. The write batch command file can refer to FCount.bat, Fcover.bat, FTIME.BAT, LCOUNT.BAT, and LCOVER.BAT output data PLIST / T commands from Profile Allow PLIST to output the .pbt file content to a text file in a table format. This format is suitable for input into a spreadsheet or database. For example: PLIST / T myProg> MyProg.txt, generated myprog.txt can be imported into the Microsoft Excel spreadsheet using Profiler.xlm (located in the VC98 / BIN directory). Note, the meaning of the entire program is not large, because most Windows applications, main time spending on the message waiting, and therefore accurately positioning the code to be analyzed, can speed up the execution speed of Profile, improve its analysis accuracy. Try to close other inseparable applications during PROFILE execution. If remote debugging is enabled, you cannot call the PROFILE function from the Build menu. For the inline function, the compiler replaces the function call in an actual code, so the inline function does not generate a .map file or call instruction, so PROFILE will not be able to know, time, time, etc., etc. The function of the function. Profile provides the number of running times and overwriting information about the INLINE function. For multithreaded applications, PROFILE behavior depends on what you choose, for Line Counting and Line Coverage, PROFILE does not distinguish between threads, which will contain all threads currently run. For Function Timing, Function Coverage, and Function Counting, the analysis results depend on the thread, you can analyze a stand-alone thread in the following way: declare the main function of the thread as the initial function (do not use the preP / sf option) Using the Prep / EXC option) Otherwise, the analysis results are difficult to explain. (Finish)