LazProfiler: what changed
Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | 1 | ## About | |
| 2 | 2 | ||
| 3 | 3 | LazProfiler is an IDE addon which adds a One-Click-Profiler to Lazarus. | |
| 4 | 4 | ||
| 5 | 5 | ### Screenshot | |
| 6 | 6 | ||
| 7 | 7 | \ | |
| 8 | - | ||
| 8 | + | ||
| 9 | 9 |  | |
| 10 | 10 | ||
| 11 | 11 | ### Download | |
| 12 | 12 | ||
| 13 | 13 | - It's available on [GitHub](https://github.com/PascalRiekenberg/LazProfiler). | |
| 14 | 14 | ||
| 15 | 15 | ### System Requirements / Dependencies | |
| 16 | 16 | ||
| 17 | 17 | - FPC trunk (needs generics and additional PascalParser funktionality) or fixes_3_2 | |
| 18 | 18 | - Lazarus trunk (revision 60719 and above) or fixes_2_0 | |
| 19 | 19 | ||
| 20 | 20 | ### Installation | |
| 21 | 21 | ||
| 22 | 22 | Download from [here](https://github.com/PascalRiekenberg/LazProfiler/releases) and install manually.\ | |
| 23 | 23 | It depends on LCLExtension and EpikTimer. | |
| 24 | 24 | ||
| 25 | 25 | ### Support page | |
| 26 | 26 | ||
| 27 | 27 | <http://forum.lazarus.freepascal.org/index.php/topic,38983.0.html> | |
| 28 | 28 | ||
| 29 | 29 | ## Using LazProfiler | |
| 30 | 30 | ||
| 31 | 31 | ### Start profiling | |
| 32 | 32 | ||
| 33 | 33 | - Open your project (if not done already) | |
| 34 | 34 | - Activate Profiler: | |
| 35 | 35 | - Open Configuration:\ | |
| 36 | 36 |  | |
| 37 | 37 | - Check "Activate LazProfiler":\ | |
| 38 | 38 |  | |
| 39 | 39 | - Choose "Profile" from Run menu:\ | |
| 40 | 40 |  | |
| 41 | 41 | - Use your program | |
| 42 | 42 | - Close your program | |
| 43 | 43 | - study LazProfiler output:\ | |
| 44 | 44 |  | |
| 45 | 45 | ||
| 46 | 46 | ### Show output | |
| 47 | 47 | ||
| 48 | 48 | - Choose "Profiler (Results and Configuration)" from View menu:\ | |
| 49 | 49 |  | |
| 50 | 50 | ||
| 51 | 51 | ### Cleanup profiler | |
| 52 | 52 | ||
| 53 | 53 | In case the instrumenting of the sources produce not compileable code you can reset the profiler and tidy things up by choosing\ | |
| 54 | 54 | "Cleanup Profiler and restore original files" from Run menu:\ | |
| 55 | 55 |  | |
| 56 | 56 | ||
| 57 | 57 | ### Influencing profiling | |
| 58 | 58 | ||
| 59 | 59 | #### Hints in source code | |
| 60 | 60 | ||
| 61 | 61 | By default the profiling automatically starts. If you just want to profile some parts of your code you can surround it by two comments:\ | |
| 62 | 62 | ||
| 63 | 63 | ``` pascal | |
| 64 | 64 | // start-profiler | |
| 65 | 65 | code_to_profile; | |
| 66 | 66 | // stop-profiler | |
| 67 | 67 | ``` | |
| 68 | 68 | ||
| 69 | 69 | #### Disable instrumenting | |
| 70 | 70 | ||
| 71 | 71 | If you want to exclude procedures/functions/classes/units/packages from beeing instrumented,\ | |
| 72 | 72 | just uncheck the checkbox in front of the procedure/function/class/unit/package name\ | |
| 73 | 73 | in the profiler output window.\ | |
| 74 | 74 | \ | |
| 75 | 75 | ||
| 76 | 76 | > **Note:** Packages are only visible if tree is sorted by package\ | |
| 77 | 77 | > Units are onyl visible if tree is sorted by package or unit.\ | |
| 78 | 78 | > Classes are only visible if tree is sorted by package, unit or class. | |
| 79 | 79 | ||
| 80 | 80 | ## How does it work? | |
| 81 | 81 | ||
| 82 | 82 | When profiling is started the following steps are done: | |
| 83 | 83 | ||
| 84 | 84 | - project is build to test if project is okay | |
| 85 | 85 | - all sources in the projects unit and include directories are backuped (except units below fpc and lazarus source directories) | |
| 86 | 86 | - procedures and funtions in units are instrumented with special profiling code | |
| 87 | 87 | - project is build with instrumented code | |
| 88 | 88 | - instumented sources are deleted and backups are restored | |
| 89 | 89 | - program is run with no debugger | |
| 90 | 90 | - profiling result is shown when program ends | |
| 91 | 91 | ||
| 92 | 92 | ## Known issues | |
| 93 | 93 | ||
| 94 | 94 | - Profiling does not pause counting at ShowModal, ShowMessage, ... | |
| 95 | 95 | ||
| 96 | 96 | ## Version History | |
| 97 | 97 | ||
| 98 | 98 | - 0.1.0.0 | |
| 99 | 99 | - Initial release | |
| 100 | 100 | - 0.1.1.0 | |
| 101 | 101 | - leaving sources instrumented if compile after instrumenting fails | |
| 102 | 102 | - 0.1.2.0 | |
| 103 | 103 | - checking if backup was successfully created before writing instrumented code to original file | |
| 104 | 104 | - 0.1.3.0 | |
| 105 | 105 | - renamed menu entries | |
| 106 | 106 | - include IncludePath. Patch by zamtmn. | |
| 107 | 107 | - minor refactoring | |
| 108 | 108 | - fixed recognition of declared record in procedure var section | |
| 109 | 109 | - fixed memory leaks | |
| 110 | 110 | - 0.2.0.0 | |
| 111 | 111 | - new Result-TreeView\ | |
| 112 | 112 | \- group by Unit\ | |
| 113 | 113 | \- group by Object | |
| 114 | 114 | - fixed include handling | |
| 115 | 115 | - last group and sort column and order is saved to settings file now | |
| 116 | 116 | - refactoring | |
| 117 | 117 | - 0.2.1.0 | |
| 118 | 118 | - fixed recursive directory scan | |
| 119 | 119 | - do not scan include path | |
| 120 | 120 | - ignore units belonging to packages | |
| 121 | 121 | - fixed memory leak | |
| 122 | 122 | - 0.2.2.0 | |
| 123 | 123 | - Update for Lazarus 2.0 | |
| 124 | 124 | - 0.3.0.0 | |
| 125 | 125 | - profiling of packages (only if outside of Lazarus source directory) | |
| 126 | 126 | - renamed columns "Net" -\> "Σ Net", "Gross" -\> "Σ Gross" | |
| 127 | 127 | - new columns: "% Net", "% Gross", "Ø Net", "Ø Gross" | |
| 128 | 128 | - fixed parsing of operator functions | |
| 129 | 129 | - fixed parsing of "START-PROFILER" and "STOP-PROFILER" if inside un-instrumented procedure/function | |
| 130 | 130 | - Activation of LazProfiler (default is inactive) | |
| 131 | 131 | ||
| 132 | 132 | --- | |
| 133 | 133 | *From the Free Pascal wiki, page "LazProfiler", as it stood on 2019-10-10 after a change by PascalR, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* | |
| 134 | 134 | Category: Debugging | |
| 135 | 135 | Category: Profiling |
