An AddOn for displaying the time spent inside functions, to help find bottle necks in code. For developers only.
This AddOn is used exclusively through slash commands.
Enabling/Disabling CPU Profiling
- /fp e
Enable CPU Profiling.
This uses extra CPU cycles, even when the AddOn isn't running, so be sure to turn it off when you're done. This will cause the user interface to be reloaded.
- /fp d
Disable CPU Profiling.
This will cause the user interface to be reloaded.
Adding/Removing Watches
By default, FunctionProfiler watches _G.
- /fp a [function | table]
Add a watch for a function or table.
Tables and their metatables are recursively checked for functions, and all found functions are added.
- /fp l
Lists all watched functions or tables.
- /fp r [function | table]
Removes a watched function or table.
- /fp rs
Rescans watched tables, useful if what you wanted to watch didn't exist when the AddOn was loaded.
- /fp f pattern
Filters watched functions using a Lua pattern.
The above slash commands can of course only watch things that are globally visible. This AddOn creates two global functions which you can call from inside your AddOn to watch local variables.
- AddFunctionWatch([function | table], name)
Watches a function or table. name is used for display purposes.
- RemoveFunctionWatch([function | table])
Removes a watch previously added by AddFunctionWatch().
The Graph Window
- /fp s
Shows the graph window.
- /fp h
Hides the graph window.
The graph window can be dragged around using the left mouse button. The mouse wheel will increase or decrease the number of objects displayed. Right clicking changes how the items are sorted.
- Exclusive Time
Sort by the total time spent inside a function, not counting time spent in functions that it called.
- Inclusive Time
Sort by the total time spent inside a function, including time spent inside functions that it in turn called.
- Inclusive Time Per Call
Sort by the average total time spent inside a single call to a function, including the time spent in functions that it in turn called.
- Exclusive Time Per Call
Sort by the average time spent inside a single call to a function, not counting time spent in functions that it called.
When displaying inclusive calls, the bright part is the time spent inside the function in question, the dark part is time spent in functions that it called.
When a function can be seen from multiple locations, the one that would result in the shortest name is displayed.
Known Bugs
The time between when a co-routine yields and when it is resumed counts towards the execution time of the function that yielded.
The code that searches for functions tries to find the shortest function name; if your filter is applied to a table that was found under multiple names, and a shorter name was discovered that didn't match the pattern first, any longer names, even if they do match, will be filtered anyway. I expect filtering works properly in most cases, and that the effort of checking every possible permutation isn't worth it.
tag 1.1
5e46d12a4159455490250947e67d73fc4e4af914
smariot <smariot@gmail.com>
2009-04-16 13:10:03 +0000
1.1 Release.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (GNU/Linux)
iEYEABEKAAYFAknnLjUACgkQPImfE9laVHIcVgCgvNpp+5/HPsRj9JzKjaBRDaGO
Dt4AoJ55DiT7pCqAMzIsdFPlSd5y2Yqn
=ol1k
-----END PGP SIGNATURE-----
--------------------
smariot:
Added ability to filter functions using a pattern.
Updated TOC for new patch.
Installation Guide
- Exit "World of Warcraft" completely
- Download the mod you want to install
- Make a folder on your desktop called "My Mods"
- Save the .zip/.rar files to this folder.
- If, when you try to download the file, it automatically "opens" it... you need to RIGHT click on the link and "save as..." or "Save Target As".
- Extract the file - commonly known as 'unzipping'
Do this ONE FILE AT A TIME!
- Windows
- Windows XP has a built in ZIP extractor. Double click on the file to open it, inside should be the file or folders needed. Copy these outside to the "My Mods" folder.
- WinRAR: Right click the file, select "Extract Here"
- WinZip: You MUST make sure the option to "Use Folder Names" is CHECKED or it will just extract the files and not make the proper folders how the Authors designed
- Mac Users
- StuffitExpander: Double click the archive to extract it to a folder in the current directory.
- Verify your WoW Installation Path
That is where you are running WoW from and THAT is where you need to install your mods.
- Move to the Addon folder
- Open your World of Warcraft folder. (default is C:\Program Files\World of Warcraft\)
- Go into the "Interface" folder.
- Go into the "AddOns" folder.
- In a new window, open the "My Mods" folder.
- The "My Mods" folder should have the "Addonname" folder in it.
- Move the "Addonname" folder into the "AddOns" folder
- Start World of Warcraft
- Make sure AddOns are installed
- Log in
- At the Character Select screen, look in lower left corner for the "addons" button.
- If button is there: make sure all the mods you installed are listed and make sure "load out of date addons" is checked.
- If the button is NOT there: means you did not install the addons properly. Look at the above screenshots. Try repeating the steps or getting someone who knows more about computers than you do to help.
Translations
When you download a mod, please be sure that the mod is compatible with your translation of wow. Some mods only work on the US versions, while some only work on some of the various European versions. These variations are called "Localizations".
TOC Numbers (Out of Date Mods)
When Blizzard patches WoW, they change the Interface number. This means that all mods will be "out of date" unless or until the author releases a new version for that interface. Some people go into the .toc files and update the numbers themselves, but this is STRONGLY advised against as it will cause problems locating possible incompatibilities addons. When you log into WoW after a patch, you DO NOT have to delete your interface directory. All you have to do is simply tell WoW to ignore the interface numbers and load all the mods anyway. All you have to do is, while at the "character select" screen, look in the lower left corner and click on the "addons" button. A window will pop up listing all your installed mods.
If you look in the upper left corner of that window there should be a box that says "Load Out of Date AddOns". You want to CHECK this box. Now simply go into WoW normally and all your mods should load. As of the 1.9 patch, you will have to do this after EVERY patch/update that Blizzard posts! If you encounter any problems with a mod after a patch, please be sure to let the author of the mod know so they can fix it.
See also: About "Out Of Date AddOns"
Mac Support
WoW addons are not platformed based. As such, they can be used on either Mac or PC. You can extract both .zip and .rar files on a Mac using StuffitExpander.
Directory Structure
World of Warcraft
|_ Interface
|_AddOns
|_*AddonName*
|_ *AddonName*.toc
|_ *AddonName*.xml
|_ *AddonName*.lua
|_ (possibly others as well)...